summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_execute.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-17 10:52:28 +1100
committerTimothy Arceri <[email protected]>2016-11-17 12:53:12 +1100
commitc3df65c123c6392b0b116900395a89fd3dbb9b85 (patch)
tree2b7c4a89aff0ccbbfb7f9fec4e0b0459858b58bb /src/mesa/program/prog_execute.c
parentd6bdb3a86293da2164e9355f0262ef83afeece7f (diff)
st/mesa/r200/i915/i965: move ARB program fields into a union
It's common for games to compile 2000 programs or more so at 32bits x 2000 programs x 22 fields x 2 (at least) stages This should give us something like 352 kilobytes in savings once we add some more glsl only fields. Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_execute.c')
-rw-r--r--src/mesa/program/prog_execute.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index cb06e625451..12684762794 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -374,7 +374,7 @@ _mesa_execute_program(struct gl_context * ctx,
const struct gl_program *program,
struct gl_program_machine *machine)
{
- const GLuint numInst = program->NumInstructions;
+ const GLuint numInst = program->arb.NumInstructions;
const GLuint maxExec = 65536;
GLuint pc, numExec = 0;
@@ -392,7 +392,7 @@ _mesa_execute_program(struct gl_context * ctx,
}
for (pc = 0; pc < numInst; pc++) {
- const struct prog_instruction *inst = program->Instructions + pc;
+ const struct prog_instruction *inst = program->arb.Instructions + pc;
if (DEBUG_PROG) {
_mesa_print_instruction(inst);
@@ -439,12 +439,12 @@ _mesa_execute_program(struct gl_context * ctx,
break;
case OPCODE_BGNLOOP:
/* no-op */
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
break;
case OPCODE_ENDLOOP:
/* subtract 1 here since pc is incremented by for(pc) loop */
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_BGNLOOP);
pc = inst->BranchTarget - 1; /* go to matching BNGLOOP */
break;
@@ -453,14 +453,14 @@ _mesa_execute_program(struct gl_context * ctx,
case OPCODE_ENDSUB: /* end subroutine */
break;
case OPCODE_BRK: /* break out of loop (conditional) */
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
/* break out of loop */
/* pc++ at end of for-loop will put us after the ENDLOOP inst */
pc = inst->BranchTarget;
break;
case OPCODE_CONT: /* continue loop (conditional) */
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
/* continue at ENDLOOP */
/* Subtract 1 here since we'll do pc++ at end of for-loop */
@@ -645,9 +645,9 @@ _mesa_execute_program(struct gl_context * ctx,
case OPCODE_IF:
{
GLboolean cond;
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ELSE ||
- program->Instructions[inst->BranchTarget].Opcode
+ program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDIF);
/* eval condition */
GLfloat a[4];
@@ -669,7 +669,7 @@ _mesa_execute_program(struct gl_context * ctx,
break;
case OPCODE_ELSE:
/* goto ENDIF */
- assert(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->arb.Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDIF);
assert(inst->BranchTarget >= 0);
pc = inst->BranchTarget;