diff options
Diffstat (limited to 'src/mesa/program/program_parse.y')
-rw-r--r-- | src/mesa/program/program_parse.y | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index e861340a023..f3adea6677c 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -348,7 +348,7 @@ statement: instruction ';' state->inst_tail = $1; $1->next = NULL; - state->prog->NumInstructions++; + state->prog->arb.NumInstructions++; } } | namingStatement ';' @@ -357,12 +357,12 @@ statement: instruction ';' instruction: ALU_instruction { $$ = $1; - state->prog->NumAluInstructions++; + state->prog->arb.NumAluInstructions++; } | TexInstruction { $$ = $1; - state->prog->NumTexInstructions++; + state->prog->arb.NumTexInstructions++; } ; @@ -785,7 +785,7 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ $$.Base.File = $1->param_binding_type; if ($3.Base.RelAddr) { - state->prog->IndirectRegisterFiles |= (1 << $$.Base.File); + state->prog->arb.IndirectRegisterFiles |= (1 << $$.Base.File); $1->param_accessed_indirectly = 1; $$.Base.RelAddr = 1; @@ -2247,18 +2247,19 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, switch (t) { case at_temp: - if (state->prog->NumTemporaries >= state->limits->MaxTemps) { + if (state->prog->arb.NumTemporaries >= state->limits->MaxTemps) { yyerror(locp, state, "too many temporaries declared"); free(s); return NULL; } - s->temp_binding = state->prog->NumTemporaries; - state->prog->NumTemporaries++; + s->temp_binding = state->prog->arb.NumTemporaries; + state->prog->arb.NumTemporaries++; break; case at_address: - if (state->prog->NumAddressRegs >= state->limits->MaxAddressRegs) { + if (state->prog->arb.NumAddressRegs >= + state->limits->MaxAddressRegs) { yyerror(locp, state, "too many address registers declared"); free(s); return NULL; @@ -2266,7 +2267,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, /* FINISHME: Add support for multiple address registers. */ - state->prog->NumAddressRegs++; + state->prog->arb.NumAddressRegs++; break; default: @@ -2564,43 +2565,43 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st /* Add one instruction to store the "END" instruction. */ - state->prog->Instructions = + state->prog->arb.Instructions = rzalloc_array(state->mem_ctx, struct prog_instruction, - state->prog->NumInstructions + 1); + state->prog->arb.NumInstructions + 1); - if (state->prog->Instructions == NULL) { + if (state->prog->arb.Instructions == NULL) { goto error; } inst = state->inst_head; - for (i = 0; i < state->prog->NumInstructions; i++) { + for (i = 0; i < state->prog->arb.NumInstructions; i++) { struct asm_instruction *const temp = inst->next; - state->prog->Instructions[i] = inst->Base; + state->prog->arb.Instructions[i] = inst->Base; inst = temp; } /* Finally, tag on an OPCODE_END instruction */ { - const GLuint numInst = state->prog->NumInstructions; - _mesa_init_instructions(state->prog->Instructions + numInst, 1); - state->prog->Instructions[numInst].Opcode = OPCODE_END; + const GLuint numInst = state->prog->arb.NumInstructions; + _mesa_init_instructions(state->prog->arb.Instructions + numInst, 1); + state->prog->arb.Instructions[numInst].Opcode = OPCODE_END; } - state->prog->NumInstructions++; + state->prog->arb.NumInstructions++; - state->prog->NumParameters = state->prog->Parameters->NumParameters; - state->prog->NumAttributes = + state->prog->arb.NumParameters = state->prog->Parameters->NumParameters; + state->prog->arb.NumAttributes = _mesa_bitcount_64(state->prog->info.inputs_read); /* * Initialize native counts to logical counts. The device driver may * change them if program is translated into a hardware program. */ - state->prog->NumNativeInstructions = state->prog->NumInstructions; - state->prog->NumNativeTemporaries = state->prog->NumTemporaries; - state->prog->NumNativeParameters = state->prog->NumParameters; - state->prog->NumNativeAttributes = state->prog->NumAttributes; - state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs; + state->prog->arb.NumNativeInstructions = state->prog->arb.NumInstructions; + state->prog->arb.NumNativeTemporaries = state->prog->arb.NumTemporaries; + state->prog->arb.NumNativeParameters = state->prog->arb.NumParameters; + state->prog->arb.NumNativeAttributes = state->prog->arb.NumAttributes; + state->prog->arb.NumNativeAddressRegs = state->prog->arb.NumAddressRegs; result = GL_TRUE; |