r300g: fix updating a vertex format
authorMarek Olšák <maraeo@gmail.com>
Sun, 15 Nov 2009 15:41:25 +0000 (16:41 +0100)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 21 Nov 2009 02:04:06 +0000 (18:04 -0800)
We must update PSC when we change the vertex format, e.g. vertex colors
from RGBA to BGRA.

src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_state_derived.c

index f2867675f0f045352cd78bb5ce5d1756f04932c8..997d59ff6ffba54605a1caf23115603e561315f6 100644 (file)
@@ -687,6 +687,8 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
         draw_flush(r300->draw);
         draw_set_vertex_buffers(r300->draw, count, buffers);
     }
+
+    r300->state |= R300_NEW_VERTEX_FORMAT;
 }
 
 static void r300_set_vertex_elements(struct pipe_context* pipe,
index 5aa4166d9396814be6d04a027247447d61a09c63..82f2be3101efa3eb7be1ac0e6c0353d4262a89e8 100644 (file)
@@ -512,7 +512,7 @@ static void r300_update_derived_shader_state(struct r300_context* r300)
 
     r300->vertex_info = vformat;
     r300->rs_block = rs_block;
-    r300->dirty_state |= (R300_NEW_VERTEX_FORMAT | R300_NEW_RS_BLOCK);
+    r300->dirty_state |= R300_NEW_RS_BLOCK;
 }
 
 static void r300_update_ztop(struct r300_context* r300)
@@ -551,7 +551,8 @@ static void r300_update_ztop(struct r300_context* r300)
 void r300_update_derived_state(struct r300_context* r300)
 {
     if (r300->dirty_state &
-        (R300_NEW_FRAGMENT_SHADER | R300_NEW_VERTEX_SHADER)) {
+        (R300_NEW_FRAGMENT_SHADER | R300_NEW_VERTEX_SHADER |
+         R300_NEW_VERTEX_FORMAT)) {
         r300_update_derived_shader_state(r300);
     }