summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/prog_statevars.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-03-20 20:15:58 -0600
committerBrian Paul <[email protected]>2009-03-20 20:29:06 -0600
commit1f45ae0813f72fa92f52e0ebc440922362dc7cce (patch)
treef69817806df333057425a19c13c300dbbc163782 /src/mesa/shader/prog_statevars.c
parent12256fc2b2e0a54db24210a4b86f6fb5919d0fe8 (diff)
mesa: add new internal state var for window size
Actually, window width - 1, height - 1
Diffstat (limited to 'src/mesa/shader/prog_statevars.c')
-rw-r--r--src/mesa/shader/prog_statevars.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index f51d9e26512..aeb7cf6de20 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -506,6 +506,13 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
}
}
return;
+ case STATE_FB_SIZE:
+ value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
+ value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
+ value[2] = 0.0F;
+ value[3] = 0.0F;
+ return;
+
case STATE_ROT_MATRIX_0:
{
const int unit = (int) state[2];
@@ -628,6 +635,9 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
case STATE_PCM_BIAS:
return _NEW_PIXEL;
+ case STATE_FB_SIZE:
+ return _NEW_BUFFERS;
+
default:
/* unknown state indexes are silently ignored and
* no flag set, since it is handled by the driver.
@@ -828,6 +838,9 @@ append_token(char *dst, gl_state_index k)
case STATE_SHADOW_AMBIENT:
append(dst, "CompareFailValue");
break;
+ case STATE_FB_SIZE:
+ append(dst, "FbSize");
+ break;
case STATE_ROT_MATRIX_0:
append(dst, "rotMatrixRow0");
break;