r300g: Cleanup a few old warnings.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 22 Mar 2010 10:10:19 +0000 (03:10 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 23 Mar 2010 01:42:42 +0000 (18:42 -0700)
Those paths aren't important anymore, and a debugging warning won't stop
a hardlock anyway.

src/gallium/drivers/r300/r300_emit.c

index c897df628d2ea3cc31f4b641e2171b3c80c23ca8..796e3eca5bf898b0b97b4434ec981eeb8d069a1b 100644 (file)
@@ -146,10 +146,8 @@ static const float * get_shader_constant(
     struct rc_constant * constant,
     struct r300_constant_buffer * externals)
 {
-    struct r300_viewport_state* viewport =
-        (struct r300_viewport_state*)r300->viewport_state.state;
-    struct r300_textures_state* texstate =
-        (struct r300_textures_state*)r300->textures_state.state;
+    struct r300_viewport_state* viewport = r300->viewport_state.state;
+    struct r300_textures_state* texstate = r300->textures_state.state;
     static float vec[4] = { 0.0, 0.0, 0.0, 1.0 };
     struct pipe_texture *tex;
 
@@ -900,12 +898,6 @@ 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_vs_state called,"
-                " but has_tcl is FALSE!\n");
-        return;
-    }
-
     BEGIN_CS(size);
     /* R300_VAP_PVS_CODE_CNTL_0
      * R300_VAP_PVS_CONST_CNTL
@@ -935,28 +927,19 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state)
 void r300_emit_vs_constant_buffer(struct r300_context* r300,
                                   struct rc_constant_list* constants)
 {
-    int i;
     struct r300_screen* r300screen = r300_screen(r300->context.screen);
+    unsigned i;
     CS_LOCALS(r300);
 
-    if (!r300screen->caps->has_tcl) {
-        debug_printf("r300: Implementation error: emit_vs_constant_buffer called,"
-        " but has_tcl is FALSE!\n");
-        return;
-    }
-
-    if (constants->Count == 0)
-        return;
-
     BEGIN_CS(constants->Count * 4 + 3);
     OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG,
                (r300screen->caps->is_r500 ?
                R500_PVS_CONST_START : R300_PVS_CONST_START));
     OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, constants->Count * 4);
     for (i = 0; i < constants->Count; i++) {
-        const float * data = get_shader_constant(r300,
-                                                 &constants->Constants[i],
-                                                 &r300->shader_constants[PIPE_SHADER_VERTEX]);
+        const float *data = get_shader_constant(r300,
+                                                &constants->Constants[i],
+                                                &r300->shader_constants[PIPE_SHADER_VERTEX]);
         OUT_CS_32F(data[0]);
         OUT_CS_32F(data[1]);
         OUT_CS_32F(data[2]);
@@ -1167,7 +1150,9 @@ void r300_emit_dirty_state(struct r300_context* r300)
 
     if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) {
         struct r300_vertex_shader* vs = r300->vs_state.state;
-        r300_emit_vs_constant_buffer(r300, &vs->code.constants);
+        if (vs->code.constants.Count) {
+            r300_emit_vs_constant_buffer(r300, &vs->code.constants);
+        }
         r300->dirty_state &= ~R300_NEW_VERTEX_SHADER_CONSTANTS;
     }