diff options
author | Timothy Arceri <[email protected]> | 2016-12-29 08:56:43 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-12-30 10:57:16 +1100 |
commit | 41dd6c35396434be53581b59c4b477dd95e8b774 (patch) | |
tree | 2138552dfb7787641b3318ad907ce3b4784baaef /src/compiler/glsl/link_uniforms.cpp | |
parent | 0de6f6223ab917ec532e3fe3afd14f8f5cd3b87b (diff) |
mesa/glsl: move subroutine metadata to gl_program
This will allow us to store gl_program rather than gl_shader_program
as the current program perstage which allows us to simplify code
that makes use of the CurrentProgram list.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r-- | src/compiler/glsl/link_uniforms.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 396b44580f9..256afa32fb6 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -624,7 +624,7 @@ private: uniform->opaque[shader_type].index = this->next_subroutine; uniform->opaque[shader_type].active = true; - prog->_LinkedShaders[shader_type]->NumSubroutineUniforms++; + prog->_LinkedShaders[shader_type]->Program->sh.NumSubroutineUniforms++; /* Increment the subroutine index by 1 for non-arrays and by the * number of array elements for arrays. @@ -1148,7 +1148,7 @@ link_setup_uniform_remap_tables(struct gl_context *ctx, unsigned mask = prog->data->linked_stages; while (mask) { const int j = u_bit_scan(&mask); - struct gl_linked_shader *sh = prog->_LinkedShaders[j]; + struct gl_program *p = prog->_LinkedShaders[j]->Program; if (!prog->data->UniformStorage[i].opaque[j].active) continue; @@ -1157,9 +1157,9 @@ link_setup_uniform_remap_tables(struct gl_context *ctx, for (unsigned k = 0; k < entries; k++) { unsigned element_loc = prog->data->UniformStorage[i].remap_location + k; - assert(sh->SubroutineUniformRemapTable[element_loc] == + assert(p->sh.SubroutineUniformRemapTable[element_loc] == INACTIVE_UNIFORM_EXPLICIT_LOCATION); - sh->SubroutineUniformRemapTable[element_loc] = + p->sh.SubroutineUniformRemapTable[element_loc] = &prog->data->UniformStorage[i]; } } @@ -1180,24 +1180,24 @@ link_setup_uniform_remap_tables(struct gl_context *ctx, unsigned mask = prog->data->linked_stages; while (mask) { const int j = u_bit_scan(&mask); - struct gl_linked_shader *sh = prog->_LinkedShaders[j]; + struct gl_program *p = prog->_LinkedShaders[j]->Program; if (!prog->data->UniformStorage[i].opaque[j].active) continue; - sh->SubroutineUniformRemapTable = - reralloc(sh, - sh->SubroutineUniformRemapTable, + p->sh.SubroutineUniformRemapTable = + reralloc(p, + p->sh.SubroutineUniformRemapTable, gl_uniform_storage *, - sh->NumSubroutineUniformRemapTable + entries); + p->sh.NumSubroutineUniformRemapTable + entries); for (unsigned k = 0; k < entries; k++) { - sh->SubroutineUniformRemapTable[sh->NumSubroutineUniformRemapTable + k] = + p->sh.SubroutineUniformRemapTable[p->sh.NumSubroutineUniformRemapTable + k] = &prog->data->UniformStorage[i]; } prog->data->UniformStorage[i].remap_location = - sh->NumSubroutineUniformRemapTable; - sh->NumSubroutineUniformRemapTable += entries; + p->sh.NumSubroutineUniformRemapTable; + p->sh.NumSubroutineUniformRemapTable += entries; } } } |