r300-gallium: Ensure that no dirty state goes unemitted.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 9 Jun 2009 06:52:43 +0000 (23:52 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 27 Jun 2009 04:25:40 +0000 (21:25 -0700)
src/gallium/drivers/r300/r300_emit.c

index 1d297e859304fbac00bfc4a776f1af04536d94b2..1cf6ec2262b7d70be06e08a578702621ee5f0f17 100644 (file)
@@ -597,10 +597,10 @@ validate:
         for (i = 0; i < r300->sampler_count; i++) {
             if (r300->dirty_state & (R300_NEW_SAMPLER << i)) {
                 r300_emit_sampler(r300, r300->sampler_states[i], i);
-                r300->dirty_state &= ~(R300_NEW_SAMPLER << i);
                 dirty_tex++;
             }
         }
+        r300->dirty_state &= ~R300_ANY_NEW_SAMPLERS;
     }
 
     if (r300->dirty_state & R300_NEW_SCISSOR) {
@@ -612,10 +612,10 @@ validate:
         for (i = 0; i < r300->texture_count; i++) {
             if (r300->dirty_state & (R300_NEW_TEXTURE << i)) {
                 r300_emit_texture(r300, r300->textures[i], i);
-                r300->dirty_state &= ~(R300_NEW_TEXTURE << i);
                 dirty_tex++;
             }
         }
+        r300->dirty_state &= ~R300_ANY_NEW_TEXTURES;
     }
 
     if (r300->dirty_state & R300_NEW_VIEWPORT) {
@@ -637,6 +637,8 @@ validate:
         r300->dirty_state &= ~R300_NEW_VERTEX_SHADER;
     }
 
+    assert(r300->dirty_state == 0);
+
     /* Finally, emit the VBO. */
     r300_emit_vertex_buffer(r300);