r300g: Two dirty state optimizations.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 13 Jan 2010 09:07:49 +0000 (01:07 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 13 Jan 2010 09:07:49 +0000 (01:07 -0800)
src/gallium/drivers/r300/r300_emit.c

index f1acdfc84d82d47afcfd6cb4884a83fd06d9bec5..ba04bd07cc810638e747fd9f6ac4274d9cce66a6 100644 (file)
@@ -1003,10 +1003,6 @@ void r300_emit_dirty_state(struct r300_context* r300)
         r300->context.flush(&r300->context, 0, NULL);
     }
 
-    if (!(r300->dirty_state)) {
-        return;
-    }
-
     /* Clean out BOs. */
     r300->winsys->reset_bos(r300->winsys);
 
@@ -1043,10 +1039,12 @@ validate:
         }
     }
     /* ...occlusion query buffer... */
-    if (!r300->winsys->add_buffer(r300->winsys, r300->oqbo,
-                0, RADEON_GEM_DOMAIN_GTT)) {
-        r300->context.flush(&r300->context, 0, NULL);
-        goto validate;
+    if (r300->dirty_state & R300_NEW_QUERY) {
+        if (!r300->winsys->add_buffer(r300->winsys, r300->oqbo,
+                    0, RADEON_GEM_DOMAIN_GTT)) {
+            r300->context.flush(&r300->context, 0, NULL);
+            goto validate;
+        }
     }
     /* ...and vertex buffer. */
     if (r300->vbo) {