summaryrefslogtreecommitdiff
path: root/src/mesa/program/nvvertparse.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-07-30 14:24:23 -0600
committerBrian Paul <brianp@vmware.com>2010-07-30 14:29:19 -0600
commit56643096f1eb01eefa1a532ac096b32d23b6b8ba (patch)
tree0ba325dd7148936ca0e6bce0b2f3fae3bd6e68be /src/mesa/program/nvvertparse.c
parent79ab5b9798c911e7612e26616df82e98372549bf (diff)
mesa: added gl_program::IndirectRegisterFiles field
Now drivers, etc. can know which register files are accessed with indirect addressing. Before we just checked gl_program::NumAddressRegs but didn't know if that was the constant buffer, temp regs, or what. The only user of this new field so far will be the gallium state tracker.
Diffstat (limited to 'src/mesa/program/nvvertparse.c')
-rw-r--r--src/mesa/program/nvvertparse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/program/nvvertparse.c b/src/mesa/program/nvvertparse.c
index e2afcfd4ce..1ac83d0e59 100644
--- a/src/mesa/program/nvvertparse.c
+++ b/src/mesa/program/nvvertparse.c
@@ -64,6 +64,7 @@ struct parse_state {
GLbitfield inputsRead;
GLbitfield outputsWritten;
GLboolean anyProgRegsWritten;
+ GLboolean indirectRegisterFiles;
GLuint numInst; /* number of instructions parsed */
};
@@ -410,6 +411,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg)
srcReg->RelAddr = GL_TRUE;
srcReg->File = PROGRAM_ENV_PARAM;
+ parseState->indirectRegisterFiles |= (1 << srcReg->File);
/* Look for +/-N offset */
if (!Peek_Token(parseState, token))
RETURN_ERROR;
@@ -1308,6 +1310,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
parseState.inputsRead = 0;
parseState.outputsWritten = 0;
parseState.anyProgRegsWritten = GL_FALSE;
+ parseState.indirectRegisterFiles = 0x0;
/* Reset error state */
_mesa_set_program_error(ctx, -1, NULL);
@@ -1408,6 +1411,8 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
program->Base.Parameters = _mesa_new_parameter_list ();
program->Base.NumParameters = 0;
+ program->Base.IndirectRegisterFiles = parseState.indirectRegisterFiles;
+
state_tokens[0] = STATE_VERTEX_PROGRAM;
state_tokens[1] = STATE_ENV;
/* Add refs to all of the potential params, in order. If we want to not