changes to get DDX/DDY working again
authorBrian <brian@yutani.localnet.net>
Thu, 3 May 2007 00:45:44 +0000 (18:45 -0600)
committerBrian <brian@yutani.localnet.net>
Thu, 3 May 2007 00:45:44 +0000 (18:45 -0600)
src/mesa/swrast/s_fragprog.c
src/mesa/swrast/s_span.c
src/mesa/tnl/t_vb_program.c

index 09493873aa23a9d9347aa216279674e50f723a65..b1501221cadfa4ee7ee1b4c8d21ac1e611c62d21 100644 (file)
@@ -113,6 +113,10 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
    /* Setup pointer to input attributes */
    machine->Attribs = span->array->attribs;
 
+   machine->DerivX = (GLfloat (*)[4]) span->attrStepX;
+   machine->DerivY = (GLfloat (*)[4]) span->attrStepY;
+   machine->NumDeriv = FRAG_ATTRIB_MAX;
+
    if (ctx->Shader.CurrentProgram) {
       /* Store front/back facing value in register FOGC.Y */
       machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
index 0b17791567aed28acb0ad8069e9be51eac6774c1..097d2c7b51c35bfbd4461fbad07f4dc2e6cb5aa6 100644 (file)
@@ -1357,7 +1357,11 @@ shade_texture_span(GLcontext *ctx, SWspan *span)
       if ((inputsRead >= FRAG_BIT_VAR0) && (span->interpMask & SPAN_VARYING))
          interpolate_varying(ctx, span);
 
+#if 0
       if (inputsRead & FRAG_BIT_WPOS)
+#else
+      /* XXX always interpolate wpos so that DDX/DDY work */
+#endif
          interpolate_wpos(ctx, span);
 
       /* Run fragment program/shader now */
index 81e166bde50ed3092b9980dad171a58adcb313c0..9961af70ce7e1ce534e956b0af4fed6a141f7aae 100644 (file)
@@ -126,6 +126,8 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine)
       }
    }
 
+   machine->NumDeriv = 0;
+
    /* init condition codes */
    machine->CondCodes[0] = COND_EQ;
    machine->CondCodes[1] = COND_EQ;