diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-08 12:28:21 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-08 12:30:27 +0100 |
commit | 715acc7622255f7cc99d632c57aac14af4bac89a (patch) | |
tree | 69fb9946c5e434c8796b95089a0761ea23148e3b /src/mesa/pipe/i915simple/i915_prim_emit.c | |
parent | cf3fb4e3ef16ec1ab08fdbe418afe15c48df73fc (diff) |
The i915simple driver now runs well enough to lock up hardware.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_prim_emit.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_prim_emit.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/pipe/i915simple/i915_prim_emit.c b/src/mesa/pipe/i915simple/i915_prim_emit.c index 97e337451e..6d7cfe2e3e 100644 --- a/src/mesa/pipe/i915simple/i915_prim_emit.c +++ b/src/mesa/pipe/i915simple/i915_prim_emit.c @@ -35,6 +35,7 @@ #include "i915_winsys.h" #include "i915_reg.h" #include "i915_state.h" +#include "i915_batch.h" @@ -91,17 +92,17 @@ static inline unsigned char float_to_ubyte( float f ) /* Hardcoded vertex format: xyz/rgba */ static inline void -emit_hw_vertex( unsigned *ptr, +emit_hw_vertex( struct i915_context *i915, struct vertex_header *vertex ) { - ptr[0] = fui( vertex->data[0][0] ); - ptr[1] = fui( vertex->data[0][1] ); - ptr[2] = fui( vertex->data[0][2] ); - - ptr[3] = pack_ub4( float_to_ubyte( vertex->data[1][0] ), - float_to_ubyte( vertex->data[1][1] ), - float_to_ubyte( vertex->data[1][2] ), - float_to_ubyte( vertex->data[1][3] ) ); + OUT_BATCH( fui(vertex->data[0][0]) ); + OUT_BATCH( fui(vertex->data[0][1]) ); + OUT_BATCH( fui(vertex->data[0][2]) ); + + OUT_BATCH( pack_ub4(float_to_ubyte( vertex->data[1][0] ), + float_to_ubyte( vertex->data[1][1] ), + float_to_ubyte( vertex->data[1][2] ), + float_to_ubyte( vertex->data[1][3] )) ); } @@ -134,12 +135,12 @@ emit_prim( struct draw_stage *stage, /* Emit each triangle as a single primitive. I told you this was * simple. */ - *ptr++ = (_3DPRIMITIVE | + OUT_BATCH(_3DPRIMITIVE | hwprim | ((4 + vertex_size * nr)/4 - 2)); for (i = 0; i < nr; i++) { - emit_hw_vertex(ptr, prim->v[i]); + emit_hw_vertex(i915, prim->v[i]); ptr += vertex_size / sizeof(int); } } |