From 0552abce0ec54dbb3f8de2fb9665fd5e58451543 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 24 Jan 2007 14:13:02 -0700 Subject: only setup varying vars that will be used --- src/mesa/swrast/s_tritemp.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/mesa/swrast/s_tritemp.h') diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index c85379b4b1..6ff52b5e4a 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -144,13 +144,15 @@ #ifdef INTERP_VARYING -/* XXX need a varyingEnabled[] check */ + #define VARYING_LOOP(CODE) \ { \ GLuint iv, ic; \ for (iv = 0; iv < MAX_VARYING; iv++) { \ - for (ic = 0; ic < 4; ic++) { \ - CODE \ + if (inputsUsed & FRAG_BIT_VAR(iv)) { \ + for (ic = 0; ic < 4; ic++) { \ + CODE \ + } \ } \ } \ } @@ -216,6 +218,10 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */ #endif GLinterp vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; +#ifdef INTERP_VARYING + const GLbitfield inputsUsed = ctx->FragmentProgram._Current ? + ctx->FragmentProgram._Current->Base.InputsRead : 0x0; +#endif SWspan span; -- cgit v1.2.3