diff options
author | Samuel Pitoiset <[email protected]> | 2017-05-15 12:55:06 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-16 09:33:06 +0200 |
commit | 0ca5bdb330d6b928c1320e5829906b195bd2c4b8 (patch) | |
tree | 580b08995304abc66e8537d7aadbb8284af7acbf /src/compiler | |
parent | 8080082ad7823dc6baa43f0fb4935ae02e6f09e0 (diff) |
glsl: simplify link_assign_uniform_storage() a bit
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Elie Tournier <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/link_uniforms.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index c5db1d62cb1..b11739ce78a 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -1238,12 +1238,14 @@ link_assign_uniform_storage(struct gl_context *ctx, prog->data->UniformStorage, data); for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { - if (prog->_LinkedShaders[i] == NULL) + struct gl_linked_shader *shader = prog->_LinkedShaders[i]; + + if (!shader) continue; parcel.start_shader((gl_shader_stage)i); - foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { + foreach_in_list(ir_instruction, node, shader->ir) { ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != ir_var_uniform && @@ -1253,15 +1255,14 @@ link_assign_uniform_storage(struct gl_context *ctx, parcel.set_and_process(var); } - prog->_LinkedShaders[i]->Program->SamplersUsed = - parcel.shader_samplers_used; - prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers; + shader->Program->SamplersUsed = parcel.shader_samplers_used; + shader->shadow_samplers = parcel.shader_shadow_samplers; - STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets) == + STATIC_ASSERT(sizeof(shader->Program->sh.SamplerTargets) == sizeof(parcel.targets)); - memcpy(prog->_LinkedShaders[i]->Program->sh.SamplerTargets, + memcpy(shader->Program->sh.SamplerTargets, parcel.targets, - sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets)); + sizeof(shader->Program->sh.SamplerTargets)); } /* If this is a fallback compile for a cache miss we already have the |