r300g: update derived state before uploading vertex buffers
authorMarek Olšák <maraeo@gmail.com>
Mon, 28 Feb 2011 23:12:23 +0000 (00:12 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 28 Feb 2011 23:46:58 +0000 (00:46 +0100)
The function may invoke blitter, which invalidates vertex buffers.

src/gallium/drivers/r300/r300_render.c

index 2ead8667bda276e5613a84f0d8919512d1e0e815..73ed44cc5a2fd1a1e4db2add95d140999edd9431 100644 (file)
@@ -748,6 +748,8 @@ static void r300_draw_vbo(struct pipe_context* pipe,
         return;
     }
 
+    r300_update_derived_state(r300);
+
     /* Start the vbuf manager and update buffers if needed. */
     u_vbuf_mgr_draw_begin(r300->vbuf_mgr, info,
                           &buffers_updated, &uploader_flushed);
@@ -756,8 +758,6 @@ static void r300_draw_vbo(struct pipe_context* pipe,
     }
 
     /* Draw. */
-    r300_update_derived_state(r300);
-
     if (indexed) {
         if (count <= 8 &&
             r300_resource(r300->index_buffer.buffer)->b.user_ptr) {