summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-10-03 13:55:40 +0100
committerKeith Whitwell <[email protected]>2008-10-03 16:49:52 +0100
commitfa1b533012030cd67148b5bf1e018fd5e30c96f8 (patch)
tree4f22a4d0a4a8a57f0a5cccbd47a6386fd362bc71 /src/mesa/shader
parent0e008d37979e4e5ede25056221583e02c08a5df7 (diff)
mesa: add new internal state for tracking current vertex attribs
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/prog_statevars.c8
-rw-r--r--src/mesa/shader/prog_statevars.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 47c46f63ec9..9cc33fa2c11 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -395,6 +395,12 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
case STATE_INTERNAL:
switch (state[1]) {
+ case STATE_CURRENT_ATTRIB: {
+ const GLuint idx = (GLuint) state[2];
+ COPY_4V(value, ctx->Current.Attrib[idx]);
+ return;
+ }
+
case STATE_NORMAL_SCALE:
ASSIGN_4V(value,
ctx->_ModelViewInvScale,
@@ -565,6 +571,8 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
case STATE_INTERNAL:
switch (state[1]) {
+ case STATE_CURRENT_ATTRIB:
+ return _NEW_CURRENT_ATTRIB;
case STATE_NORMAL_SCALE:
return _NEW_MODELVIEW;
diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h
index 7b490e3d630..1f728c64e80 100644
--- a/src/mesa/shader/prog_statevars.h
+++ b/src/mesa/shader/prog_statevars.h
@@ -104,6 +104,7 @@ typedef enum gl_state_index_ {
STATE_LOCAL,
STATE_INTERNAL, /* Mesa additions */
+ STATE_CURRENT_ATTRIB, /* ctx->Current vertex attrib value */
STATE_NORMAL_SCALE,
STATE_TEXRECT_SCALE,
STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */