diff options
author | Timothy Arceri <[email protected]> | 2016-11-17 10:52:28 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-11-17 12:53:12 +1100 |
commit | c3df65c123c6392b0b116900395a89fd3dbb9b85 (patch) | |
tree | 2b7c4a89aff0ccbbfb7f9fec4e0b0459858b58bb /src/mesa/drivers/dri/i915 | |
parent | d6bdb3a86293da2164e9355f0262ef83afeece7f (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/drivers/dri/i915')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_fragprog.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_program.c | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 2ad9eb23e75..c5a8ac5532d 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -318,8 +318,8 @@ static bool calc_live_regs( struct i915_fragment_program *p ) uint8_t live_components[I915_MAX_TEMPORARY] = { 0, }; GLint i; - for (i = program->NumInstructions - 1; i >= 0; i--) { - struct prog_instruction *inst = &program->Instructions[i]; + for (i = program->arb.NumInstructions - 1; i >= 0; i--) { + struct prog_instruction *inst = &program->arb.Instructions[i]; int opArgs = _mesa_num_inst_src_regs(inst->Opcode); int a; @@ -362,7 +362,7 @@ static GLuint get_live_regs( struct i915_fragment_program *p, const struct prog_instruction *inst ) { const struct gl_program *program = &p->FragProg; - GLuint nr = inst - program->Instructions; + GLuint nr = inst - program->arb.Instructions; return p->usedRegs[nr]; } @@ -383,7 +383,7 @@ static void upload_program(struct i915_fragment_program *p) { const struct gl_program *program = &p->FragProg; - const struct prog_instruction *inst = program->Instructions; + const struct prog_instruction *inst = program->arb.Instructions; if (INTEL_DEBUG & DEBUG_WM) _mesa_print_program(program); @@ -402,9 +402,9 @@ upload_program(struct i915_fragment_program *p) return; } - if (program->NumInstructions > I915_MAX_INSN) { + if (program->arb.NumInstructions > I915_MAX_INSN) { i915_program_error(p, "Exceeded max instructions (%d out of %d)", - program->NumInstructions, I915_MAX_INSN); + program->arb.NumInstructions, I915_MAX_INSN); return; } diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index 0abc7e208db..a8f693f71af 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -517,18 +517,18 @@ i915_fini_program(struct i915_fragment_program *p) } if (p->error) { - p->FragProg.NumNativeInstructions = 0; - p->FragProg.NumNativeAluInstructions = 0; - p->FragProg.NumNativeTexInstructions = 0; - p->FragProg.NumNativeTexIndirections = 0; + p->FragProg.arb.NumNativeInstructions = 0; + p->FragProg.arb.NumNativeAluInstructions = 0; + p->FragProg.arb.NumNativeTexInstructions = 0; + p->FragProg.arb.NumNativeTexIndirections = 0; } else { - p->FragProg.NumNativeInstructions = (p->nr_alu_insn + + p->FragProg.arb.NumNativeInstructions = (p->nr_alu_insn + p->nr_tex_insn + p->nr_decl_insn); - p->FragProg.NumNativeAluInstructions = p->nr_alu_insn; - p->FragProg.NumNativeTexInstructions = p->nr_tex_insn; - p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect; + p->FragProg.arb.NumNativeAluInstructions = p->nr_alu_insn; + p->FragProg.arb.NumNativeTexInstructions = p->nr_tex_insn; + p->FragProg.arb.NumNativeTexIndirections = p->nr_tex_indirect; } p->declarations[0] |= program_size + decl_size - 2; |