r300g: fix flushing harder.
authorDave Airlie <airlied@redhat.com>
Sun, 24 Jan 2010 04:58:45 +0000 (14:58 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 24 Jan 2010 05:00:06 +0000 (15:00 +1000)
I swear ipers runs here after this commit.

After we flush we need to redo the space check

src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_render.c

index cc40abf168ba495b06780053bf184a8f13f04a50..e08e6c229213214cbf53c14a672bcd8af884e4b9 100644 (file)
@@ -1105,9 +1105,10 @@ void r300_emit_dirty_state(struct r300_context* r300)
     /* Make sure we have at least 2*1024 spare dwords. */
     /* XXX It would be nice to know the number of dwords we really need to
      * XXX emit. */
+again:
     if (!r300->winsys->check_cs(r300->winsys, dwords)) {
         r300->context.flush(&r300->context, 0, NULL);
-       r300_emit_buffer_validate(r300);
+       goto again;
     }
 
     if (r300->dirty_state & R300_NEW_QUERY) {
index cb2d8d45371eb5d93c4a53ba3d8eb8b76f5d5c35..677031ef04ebc46b43072bce346d55037a1def59 100644 (file)
@@ -302,6 +302,8 @@ void r300_draw_range_elements(struct pipe_context* pipe,
 
     r300_update_derived_state(r300);
 
+    r300_emit_buffer_validate(r300);
+
     if (!r300_setup_vertex_buffers(r300)) {
         return;
     }
@@ -311,8 +313,6 @@ void r300_draw_range_elements(struct pipe_context* pipe,
         indexSize = 2;
     }
 
-    r300_emit_buffer_validate(r300);
-
     if (!r300->winsys->add_buffer(r300->winsys, indexBuffer,
                                   RADEON_GEM_DOMAIN_GTT, 0)) {
         goto cleanup;