add state vars for color matrix, pixel transfer scale&bias
authorBrian <brian.paul@tungstengraphics.com>
Tue, 30 Oct 2007 18:39:58 +0000 (12:39 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 30 Oct 2007 18:39:58 +0000 (12:39 -0600)
src/mesa/shader/prog_statevars.c
src/mesa/shader/prog_statevars.h

index 1bb7142..68eaf0b 100644 (file)
@@ -278,6 +278,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
    case STATE_MVP_MATRIX:
    case STATE_TEXTURE_MATRIX:
    case STATE_PROGRAM_MATRIX:
+   case STATE_COLOR_MATRIX:
       {
          /* state[0] = modelview, projection, texture, etc. */
          /* state[1] = which texture matrix or program matrix */
@@ -311,6 +312,9 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
          else if (mat == STATE_PROGRAM_MATRIX) {
             matrix = ctx->ProgramMatrixStack[index].Top;
          }
+         else if (mat == STATE_COLOR_MATRIX) {
+            matrix = ctx->ColorMatrixStack.Top;
+         }
          else {
             _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()");
             return;
@@ -434,6 +438,18 @@ _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;
       default:
          /* unknown state indexes are silently ignored
           *  should be handled by the driver.
index 3281a4a..9fedcfa 100644 (file)
@@ -67,6 +67,7 @@ typedef enum gl_state_index_ {
    STATE_MVP_MATRIX,
    STATE_TEXTURE_MATRIX,
    STATE_PROGRAM_MATRIX,
+   STATE_COLOR_MATRIX,
    STATE_MATRIX_INVERSE,
    STATE_MATRIX_TRANSPOSE,
    STATE_MATRIX_INVTRANS,
@@ -108,6 +109,8 @@ 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_INTERNAL_DRIVER       /* first available state index for drivers (must be last) */
 } gl_state_index;