i965: Set dirty state for brw_draw_upload.c when num_instances changes.
authorEric Anholt <eric@anholt.net>
Wed, 31 Oct 2012 20:36:16 +0000 (13:36 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 4 Nov 2012 19:15:44 +0000 (11:15 -0800)
Otherwise, if we had a set of prims passed in with a num_instances varying
between them, we wouldn't upload enough (or too much!) from user vertex
arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_draw.c

index 1cfba29d90a31b766435ffa45f795f9cb961d8fa..22d18f91705c25a2d475779d591e3395c15fd050 100644 (file)
@@ -474,7 +474,10 @@ static bool brw_try_draw_prims( struct gl_context *ctx,
       intel_batchbuffer_require_space(intel, estimated_max_prim_size, false);
       intel_batchbuffer_save_state(intel);
 
-      brw->num_instances = prim->num_instances;
+      if (brw->num_instances != prim->num_instances) {
+         brw->num_instances = prim->num_instances;
+         brw->state.dirty.brw |= BRW_NEW_VERTICES;
+      }
       if (intel->gen < 6)
         brw_set_prim(brw, &prim[i]);
       else