Handle fatal case.
authorAapo Tahkola <aet@rasterburn.org>
Sun, 18 Dec 2005 21:40:13 +0000 (21:40 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Sun, 18 Dec 2005 21:40:13 +0000 (21:40 +0000)
src/mesa/drivers/dri/r300/r300_state.c

index ae22510091c9b7b3877fc18c77721bfc4c8526e2..52a3a4479dc514325653002264ab213bfb1464ad 100644 (file)
@@ -1093,10 +1093,6 @@ void r300_setup_textures(GLcontext *ctx)
        struct r300_tex_obj *t;
        r300ContextPtr r300 = R300_CONTEXT(ctx);
        int max_texture_unit=-1; /* -1 translates into no setup costs for fields */
-       GLuint OutputsWritten;
-       
-       if(hw_tcl_on)
-               OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->Base.OutputsWritten;
 
        R300_STATECHANGE(r300, txe);
        R300_STATECHANGE(r300, tex.filter);
@@ -1272,6 +1268,14 @@ void r300_setup_rs_unit(GLcontext *ctx)
                col_interp_nr++;
        }
        
+       /* Need at least one. This might still lock as the values are undefined... */
+       if (in_texcoords == 0 && col_interp_nr == 0) {
+               r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
+                               | R300_RS_ROUTE_0_COLOR
+                               | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+               col_interp_nr++;
+       }
+       
        r300->hw.rc.cmd[1] = 0
                        | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT)
                        | (col_interp_nr << R300_RS_CNTL_CI_CNT_SHIFT)