r300g: disable emitting the HWTCL-related state when SWTCL is in use
authorMarek Olšák <maraeo@gmail.com>
Sun, 7 Mar 2010 02:17:58 +0000 (03:17 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 7 Mar 2010 02:41:00 +0000 (03:41 +0100)
Now SWTCL renders at least "something", we're close...

src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_state.c

index 86b98a4ba526e1c6eef53fb9d0c082ad9dc65d8d..ec1c5865220167451f4a28c6e90f76e3170f9a20 100644 (file)
@@ -212,7 +212,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->invariant_state.dirty = TRUE;
 
     r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300);
-    r300->dirty_state = R300_NEW_KITCHEN_SINK;
     r300->dirty_hw++;
 
     r300->blitter = util_blitter_create(&r300->context);
index 03da4754b727c66c86c738d3dd3ae9e1b486f285..a1d31d57b83d93ac36eb52a6dc47803372fa086f 100644 (file)
@@ -892,7 +892,7 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state)
     CS_LOCALS(r300);
 
     if (!r300screen->caps->has_tcl) {
-        debug_printf("r300: Implementation error: emit_vertex_shader called,"
+        debug_printf("r300: Implementation error: emit_vs_state called,"
                 " but has_tcl is FALSE!\n");
         return;
     }
@@ -931,7 +931,7 @@ void r300_emit_vs_constant_buffer(struct r300_context* r300,
     CS_LOCALS(r300);
 
     if (!r300screen->caps->has_tcl) {
-        debug_printf("r300: Implementation error: emit_vertex_shader called,"
+        debug_printf("r300: Implementation error: emit_vs_constant_buffer called,"
         " but has_tcl is FALSE!\n");
         return;
     }
index e37d3092703383a647d14fefb2e1b328c438c342..70de152713d8b267bdfa606d47ff4da89a5fb3e3 100644 (file)
@@ -61,6 +61,12 @@ static void r300_flush(struct pipe_context* pipe,
                 atom->dirty = TRUE;
             }
         }
+
+        /* Unmark HWTCL state for SWTCL. */
+        if (!r300_screen(pipe->screen)->caps->has_tcl) {
+            r300->vs_state.dirty = FALSE;
+            r300->dirty_state &= ~R300_NEW_VERTEX_SHADER_CONSTANTS;
+        }
     }
 
     /* reset flushed query */
index 381676e09a6090e64ed5e5e16ad27b47d7854faf..de3ee0eefb90aaad72962c1964444f762e2ce62b 100644 (file)
@@ -1203,8 +1203,10 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
     pipe_buffer_unmap(pipe->screen, buf);
 
     if (shader == PIPE_SHADER_VERTEX) {
-        r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS;
-        r300->pvs_flush.dirty = TRUE;
+        if (r300screen->caps->has_tcl) {
+            r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS;
+            r300->pvs_flush.dirty = TRUE;
+        }
     }
     else if (shader == PIPE_SHADER_FRAGMENT)
         r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS;