Don't reemit hardware state *every* primitive.

This commit is contained in:
Keith Whitwell
2007-08-09 12:02:45 +01:00
parent fb8caffea8
commit 277e4989f3
4 changed files with 11 additions and 1 deletions
+1
View File
@@ -56,6 +56,7 @@ struct i915_context
struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
GLuint dirty;
GLuint hw_dirty;
GLuint *batch_start;
+5 -1
View File
@@ -120,7 +120,11 @@ emit_prim( struct draw_stage *stage,
unsigned *ptr;
unsigned i;
i915_emit_hardware_state( i915 );
if (i915->dirty)
i915_update_derived( i915 );
if (i915->hw_dirty)
i915_emit_hardware_state( i915 );
ptr = winsys->batch_start( winsys, nr * vertex_size, 0 );
if (ptr == 0) {
@@ -182,5 +182,8 @@ void i915_update_derived( struct i915_context *i915 )
I915_NEW_FRAMEBUFFER))
compute_cliprect(i915);
if (i915->dirty)
i915->hw_dirty = 1;
i915->dirty = 0;
}
@@ -250,5 +250,7 @@ i915_emit_hardware_state(struct i915_context *i915 )
for (i = 0; i < dwords; i++)
OUT_BATCH( prog[i] );
}
i915->hw_dirty = 0;
}