diff options
author | Ian Romanick <[email protected]> | 2014-02-11 16:37:56 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-03-12 11:16:50 -0700 |
commit | 6bdc1d96c3f47440ac8da4ade19a637e5ca521bb (patch) | |
tree | f7540afb4103d5007150777275de40161b8ca4a6 /src/glsl/linker.cpp | |
parent | 7b8acb90261f73af86ccd1a851e7ec74ccb4d50e (diff) |
glsl: Rewrite unrolled link_invalidate_variable_locations calls as a loop
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index f6b26618552..3bf27896523 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2303,17 +2303,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) } /* Mark all generic shader inputs and outputs as unpaired. */ - if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir); - } - if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir); - } - if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir); + for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) { + if (prog->_LinkedShaders[i] != NULL) { + link_invalidate_variable_locations(prog->_LinkedShaders[i]->ir); + } } /* FINISHME: The value of the max_attribute_index parameter is |