Vertex/fragment program patches (Rune Petersen)
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 30 Jun 2006 17:56:50 +0000 (17:56 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 30 Jun 2006 17:56:50 +0000 (17:56 +0000)
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_state.c

index 4dd1e8b5014402a89144bccb90d4ea45a5528bb8..8ba91c9d810175aacf36aff3b080565da23d0da0 100644 (file)
@@ -308,7 +308,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        _tnl_allow_vertex_fog(ctx, GL_TRUE);
 
        /* currently bogus data */
-       ctx->Const.VertexProgram.MaxNativeInstructions=VSF_MAX_FRAGMENT_LENGTH;
+       ctx->Const.VertexProgram.MaxInstructions=VSF_MAX_FRAGMENT_LENGTH/4;
+       ctx->Const.VertexProgram.MaxNativeInstructions=VSF_MAX_FRAGMENT_LENGTH/4;
        ctx->Const.VertexProgram.MaxNativeAttribs=16; /* r420 */
        ctx->Const.VertexProgram.MaxTemps=32;
        ctx->Const.VertexProgram.MaxNativeTemps=/*VSF_MAX_FRAGMENT_TEMPS*/32;
index 1e06992394bfe52056faf66ea0dde8d4a1da9303..48e86b8d10da8abbc909c684f79d9e7234a09ede 100644 (file)
@@ -1316,8 +1316,6 @@ void r300_setup_rs_unit(GLcontext *ctx)
        R300_STATECHANGE(r300, rr);
        
        fp_reg = in_texcoords = col_interp_nr = high_rr = 0;
-       r300->hw.rr.cmd[R300_RR_ROUTE_0] = 0;
-       r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0;
 
        for (i=0;i<ctx->Const.MaxTextureUnits;i++) {
                r300->hw.ri.cmd[R300_RI_INTERP_0+i] = 0
@@ -1325,10 +1323,11 @@ void r300_setup_rs_unit(GLcontext *ctx)
                                | (in_texcoords << R300_RS_INTERP_SRC_SHIFT)
                                | interp_magic[i];
 
+               r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0;
                if (InputsRead & (FRAG_BIT_TEX0<<i)) {
                        //assert(r300->state.texture.tc_count != 0);
-                       r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0
-                                       | R300_RS_ROUTE_ENABLE
+                       r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] |=
+                                         R300_RS_ROUTE_ENABLE
                                        | i /* source INTERP */
                                        | (fp_reg << R300_RS_ROUTE_DEST_SHIFT);
                        high_rr = fp_reg;