From 56643096f1eb01eefa1a532ac096b32d23b6b8ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jul 2010 14:24:23 -0600 Subject: 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. --- src/mesa/program/nvvertparse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/program/nvvertparse.c') 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 -- cgit v1.2.3