diff options
author | Ian Romanick <[email protected]> | 2016-11-07 15:54:46 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-11-09 12:47:51 -0800 |
commit | 392fabcfee489c294dad5bed0bb57a2c61322e4d (patch) | |
tree | 262226ff93f46280ccd9239b7846d0603649644a | |
parent | a529acfb2bc7e4d4317e0cce0209b6f78761471c (diff) |
linker: Slight code rearrange to prevent duplication in the next commit
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/compiler/glsl/link_uniforms.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 8e8d689dab1..d3a77d58c3b 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -928,13 +928,12 @@ link_update_uniform_buffer_variables(struct gl_linked_shader *shader) if ((ptrdiff_t) l != (end - begin)) continue; - if (strncmp(var->name, begin, l) == 0) { - found = true; - var->data.location = j; - break; - } - } else if (!strcmp(var->name, blks[i]->Uniforms[j].Name)) { - found = true; + found = strncmp(var->name, begin, l) == 0; + } else { + found = strcmp(var->name, blks[i]->Uniforms[j].Name) == 0; + } + + if (found) { var->data.location = j; break; } |