From 60d136f63c5a5a18b12952ec8e8532cbce086a4d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:45:44 -0600 Subject: [PATCH] changes to get DDX/DDY working again --- src/mesa/swrast/s_fragprog.c | 4 ++++ src/mesa/swrast/s_span.c | 4 ++++ src/mesa/tnl/t_vb_program.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 09493873aa2..b1501221cad 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -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; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0b17791567a..097d2c7b51c 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -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 */ diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 81e166bde50..9961af70ce7 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -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; -- 2.30.2