diff options
author | Brian <brian@nostromo.localnet.net> | 2007-01-24 14:13:02 -0700 |
---|---|---|
committer | Brian <brian@nostromo.localnet.net> | 2007-01-24 14:13:02 -0700 |
commit | 0552abce0ec54dbb3f8de2fb9665fd5e58451543 (patch) | |
tree | 1b016023900717d1d0105e1afa9a4e81740023b0 /src/mesa/swrast/s_tritemp.h | |
parent | 07373512c72ca0fc19cccd1d102f14f1a41fd1bd (diff) |
only setup varying vars that will be used
Diffstat (limited to 'src/mesa/swrast/s_tritemp.h')
-rw-r--r-- | src/mesa/swrast/s_tritemp.h | 12 |
1 files changed, 9 insertions, 3 deletions
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; |