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/program/arbprogparse.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/program/arbprogparse.c')
-rw-r--r-- | src/mesa/program/arbprogparse.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c index a7e21d91672..196d30f4daf 100644 --- a/src/mesa/program/arbprogparse.c +++ b/src/mesa/program/arbprogparse.c @@ -91,25 +91,25 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, * fragment_program struct. */ program->String = prog.String; - program->NumInstructions = prog.NumInstructions; - program->NumTemporaries = prog.NumTemporaries; - program->NumParameters = prog.NumParameters; - program->NumAttributes = prog.NumAttributes; - program->NumAddressRegs = prog.NumAddressRegs; - program->NumNativeInstructions = prog.NumNativeInstructions; - program->NumNativeTemporaries = prog.NumNativeTemporaries; - program->NumNativeParameters = prog.NumNativeParameters; - program->NumNativeAttributes = prog.NumNativeAttributes; - program->NumNativeAddressRegs = prog.NumNativeAddressRegs; - program->NumAluInstructions = prog.NumAluInstructions; - program->NumTexInstructions = prog.NumTexInstructions; - program->NumTexIndirections = prog.NumTexIndirections; - program->NumNativeAluInstructions = prog.NumAluInstructions; - program->NumNativeTexInstructions = prog.NumTexInstructions; - program->NumNativeTexIndirections = prog.NumTexIndirections; + program->arb.NumInstructions = prog.arb.NumInstructions; + program->arb.NumTemporaries = prog.arb.NumTemporaries; + program->arb.NumParameters = prog.arb.NumParameters; + program->arb.NumAttributes = prog.arb.NumAttributes; + program->arb.NumAddressRegs = prog.arb.NumAddressRegs; + program->arb.NumNativeInstructions = prog.arb.NumNativeInstructions; + program->arb.NumNativeTemporaries = prog.arb.NumNativeTemporaries; + program->arb.NumNativeParameters = prog.arb.NumNativeParameters; + program->arb.NumNativeAttributes = prog.arb.NumNativeAttributes; + program->arb.NumNativeAddressRegs = prog.arb.NumNativeAddressRegs; + program->arb.NumAluInstructions = prog.arb.NumAluInstructions; + program->arb.NumTexInstructions = prog.arb.NumTexInstructions; + program->arb.NumTexIndirections = prog.arb.NumTexIndirections; + program->arb.NumNativeAluInstructions = prog.arb.NumAluInstructions; + program->arb.NumNativeTexInstructions = prog.arb.NumTexInstructions; + program->arb.NumNativeTexIndirections = prog.arb.NumTexIndirections; program->info.inputs_read = prog.info.inputs_read; program->info.outputs_written = prog.info.outputs_written; - program->IndirectRegisterFiles = prog.IndirectRegisterFiles; + program->arb.IndirectRegisterFiles = prog.arb.IndirectRegisterFiles; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) { program->TexturesUsed[i] = prog.TexturesUsed[i]; if (prog.TexturesUsed[i]) @@ -121,8 +121,8 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, program->info.fs.uses_discard = state.fragment.UsesKill; - free(program->Instructions); - program->Instructions = prog.Instructions; + free(program->arb.Instructions); + program->arb.Instructions = prog.arb.Instructions; if (program->Parameters) _mesa_free_parameter_list(program->Parameters); @@ -174,7 +174,7 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &state)) { - ralloc_free(prog.Instructions); + ralloc_free(prog.arb.Instructions); ralloc_free(prog.String); _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)"); return; @@ -189,24 +189,24 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, * vertex_program struct. */ program->String = prog.String; - program->NumInstructions = prog.NumInstructions; - program->NumTemporaries = prog.NumTemporaries; - program->NumParameters = prog.NumParameters; - program->NumAttributes = prog.NumAttributes; - program->NumAddressRegs = prog.NumAddressRegs; - program->NumNativeInstructions = prog.NumNativeInstructions; - program->NumNativeTemporaries = prog.NumNativeTemporaries; - program->NumNativeParameters = prog.NumNativeParameters; - program->NumNativeAttributes = prog.NumNativeAttributes; - program->NumNativeAddressRegs = prog.NumNativeAddressRegs; + program->arb.NumInstructions = prog.arb.NumInstructions; + program->arb.NumTemporaries = prog.arb.NumTemporaries; + program->arb.NumParameters = prog.arb.NumParameters; + program->arb.NumAttributes = prog.arb.NumAttributes; + program->arb.NumAddressRegs = prog.arb.NumAddressRegs; + program->arb.NumNativeInstructions = prog.arb.NumNativeInstructions; + program->arb.NumNativeTemporaries = prog.arb.NumNativeTemporaries; + program->arb.NumNativeParameters = prog.arb.NumNativeParameters; + program->arb.NumNativeAttributes = prog.arb.NumNativeAttributes; + program->arb.NumNativeAddressRegs = prog.arb.NumNativeAddressRegs; program->info.inputs_read = prog.info.inputs_read; program->info.outputs_written = prog.info.outputs_written; - program->IndirectRegisterFiles = prog.IndirectRegisterFiles; - program->IsPositionInvariant = (state.option.PositionInvariant) + program->arb.IndirectRegisterFiles = prog.arb.IndirectRegisterFiles; + program->arb.IsPositionInvariant = (state.option.PositionInvariant) ? GL_TRUE : GL_FALSE; - ralloc_free(program->Instructions); - program->Instructions = prog.Instructions; + ralloc_free(program->arb.Instructions); + program->arb.Instructions = prog.arb.Instructions; if (program->Parameters) _mesa_free_parameter_list(program->Parameters); |