mesa: added internal post color matrix scale/bias vars
authorBrian Paul <brian.paul@tungstengraphics.com>
Sun, 18 May 2008 21:50:20 +0000 (15:50 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sun, 18 May 2008 21:50:20 +0000 (15:50 -0600)
cherry-picked from gallium-0.1 (302daeb2ec62c59bd28d0c53cdc0fb07dc9d0f58)

src/mesa/shader/prog_statevars.c
src/mesa/shader/prog_statevars.h

index 72bdad7..dd3c3a1 100644 (file)
@@ -435,6 +435,24 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
          value[3] = ctx->Light.Light[ln]._CosCutoff;
          return;
       }
+      case STATE_PT_SCALE:
+         value[0] = ctx->Pixel.RedScale;
+         value[1] = ctx->Pixel.GreenScale;
+         value[2] = ctx->Pixel.BlueScale;
+         value[3] = ctx->Pixel.AlphaScale;
+         break;
+      case STATE_PT_BIAS:
+         value[0] = ctx->Pixel.RedBias;
+         value[1] = ctx->Pixel.GreenBias;
+         value[2] = ctx->Pixel.BlueBias;
+         value[3] = ctx->Pixel.AlphaBias;
+         break;
+      case STATE_PCM_SCALE:
+         COPY_4V(value, ctx->Pixel.PostColorMatrixScale);
+         break;
+      case STATE_PCM_BIAS:
+         COPY_4V(value, ctx->Pixel.PostColorMatrixBias);
+         break;
       default:
          /* unknown state indexes are silently ignored
           *  should be handled by the driver.
@@ -671,6 +689,18 @@ append_token(char *dst, gl_state_index k)
    case STATE_POSITION_NORMALIZED:
       append(dst, "(internal)");
       break;
+   case STATE_PT_SCALE:
+      append(dst, "PTscale");
+      break;
+   case STATE_PT_BIAS:
+      append(dst, "PTbias");
+      break;
+   case STATE_PCM_SCALE:
+      append(dst, "PCMscale");
+      break;
+   case STATE_PCM_BIAS:
+      append(dst, "PCMbias");
+      break;
    default:
       ;
    }
index 22bb8e0..53529ab 100644 (file)
@@ -108,6 +108,10 @@ typedef enum gl_state_index_ {
    STATE_POSITION_NORMALIZED,   /* normalized light position */
    STATE_FOG_PARAMS_OPTIMIZED,  /* for faster fog calc */
    STATE_SPOT_DIR_NORMALIZED,   /* pre-normalized spot dir */
+   STATE_PT_SCALE,              /**< Pixel transfer RGBA scale */
+   STATE_PT_BIAS,               /**< Pixel transfer RGBA bias */
+   STATE_PCM_SCALE,             /**< Post color matrix RGBA scale */
+   STATE_PCM_BIAS,              /**< Post color matrix RGBA bias */
    STATE_INTERNAL_DRIVER       /* first available state index for drivers (must be last) */
 } gl_state_index;