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/main/ffvertex_prog.c | |
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/main/ffvertex_prog.c')
-rw-r--r-- | src/mesa/main/ffvertex_prog.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 5bc64f18c74..c917b41e9dc 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -383,8 +383,8 @@ static struct ureg get_temp( struct tnl_program *p ) exit(1); } - if ((GLuint) bit > p->program->NumTemporaries) - p->program->NumTemporaries = bit; + if ((GLuint) bit > p->program->arb.NumTemporaries) + p->program->arb.NumTemporaries = bit; p->temp_in_use |= 1<<(bit-1); return make_ureg(PROGRAM_TEMPORARY, bit-1); @@ -577,9 +577,9 @@ static void emit_op3fn(struct tnl_program *p, GLuint nr; struct prog_instruction *inst; - assert(p->program->NumInstructions <= p->max_inst); + assert(p->program->arb.NumInstructions <= p->max_inst); - if (p->program->NumInstructions == p->max_inst) { + if (p->program->arb.NumInstructions == p->max_inst) { /* need to extend the program's instruction array */ struct prog_instruction *newInst; @@ -593,17 +593,17 @@ static void emit_op3fn(struct tnl_program *p, return; } - _mesa_copy_instructions(newInst, p->program->Instructions, - p->program->NumInstructions); + _mesa_copy_instructions(newInst, p->program->arb.Instructions, + p->program->arb.NumInstructions); - ralloc_free(p->program->Instructions); + ralloc_free(p->program->arb.Instructions); - p->program->Instructions = newInst; + p->program->arb.Instructions = newInst; } - nr = p->program->NumInstructions++; + nr = p->program->arb.NumInstructions++; - inst = &p->program->Instructions[nr]; + inst = &p->program->arb.Instructions[nr]; inst->Opcode = (enum prog_opcode) op; emit_arg( &inst->SrcReg[0], src0 ); @@ -1632,13 +1632,13 @@ create_new_program( const struct state_key *key, * If we need more, we'll grow the instruction array as needed. */ p.max_inst = 32; - p.program->Instructions = rzalloc_array(program, struct prog_instruction, - p.max_inst); + p.program->arb.Instructions = + rzalloc_array(program, struct prog_instruction, p.max_inst); p.program->String = NULL; - p.program->NumInstructions = - p.program->NumTemporaries = - p.program->NumParameters = - p.program->NumAttributes = p.program->NumAddressRegs = 0; + p.program->arb.NumInstructions = + p.program->arb.NumTemporaries = + p.program->arb.NumParameters = + p.program->arb.NumAttributes = p.program->arb.NumAddressRegs = 0; p.program->Parameters = _mesa_new_parameter_list(); p.program->info.inputs_read = 0; p.program->info.outputs_written = 0; |