r300g/swtcl: call update_derived_state only once per draw-call
authorMarek Olšák <maraeo@gmail.com>
Sun, 16 May 2010 01:36:50 +0000 (03:36 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 16 May 2010 02:10:00 +0000 (04:10 +0200)
src/gallium/drivers/r300/r300_render.c

index 079cf26..667f813 100644 (file)
@@ -735,6 +735,8 @@ void r300_swtcl_draw_arrays(struct pipe_context* pipe,
         return;
     }
 
+    r300_update_derived_state(r300);
+
     for (i = 0; i < r300->vertex_buffer_count; i++) {
         void* buf = pipe_buffer_map(pipe,
                                     r300->vertex_buffer[i].buffer,
@@ -779,6 +781,8 @@ void r300_swtcl_draw_range_elements(struct pipe_context* pipe,
         return;
     }
 
+    r300_update_derived_state(r300);
+
     for (i = 0; i < r300->vertex_buffer_count; i++) {
         void* buf = pipe_buffer_map(pipe,
                                     r300->vertex_buffer[i].buffer,
@@ -827,7 +831,7 @@ struct r300_render {
     size_t vbo_max_used;
     void * vbo_ptr;
 
-   struct pipe_transfer *vbo_transfer;
+    struct pipe_transfer *vbo_transfer;
 };
 
 static INLINE struct r300_render*
@@ -842,8 +846,6 @@ r300_render_get_vertex_info(struct vbuf_render* render)
     struct r300_render* r300render = r300_render(render);
     struct r300_context* r300 = r300render->r300;
 
-    r300_update_derived_state(r300);
-
     return &r300->vertex_info;
 }