summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-06-10 14:01:45 -0700
committerPaul Berry <stereotype441@gmail.com>2013-07-27 16:01:36 -0700
commit4cdeda98040914be015a6ab77cd57de5a7150092 (patch)
treefffe69873dcb43a9012617e3cf96d296774c5687
parent2f50f1ad56b81c1835d6679177a9f5faa5949901 (diff)
glsl/linker: Make update_array_sizes apply to just uniforms.
Commit 586b4b5 (glsl: Also update implicit sizes of varyings at link time) extended update_array_sizes() to apply to both uniforms and shader ins/outs. However, doing creates problems for geometry shaders, because update_array_sizes() assumes that variables with matching names in different parts of the pipeline should have the same sizes. With the addition of geometry shaders, this is no longer true (e.g. both vertex and geometry shaders have a gl_ClipDistance output variable, but there's no reason these variables should have the same sizes). The original reason for commit 586b4b5 (avoid problems with gl_TexCoord being 0 length) has since been addressed by commit 6f53921 (linker: Ensure that unsized arrays have a size after linking). So go ahead and switch update_array_sizes() back to only acting on uniforms.
-rw-r--r--src/glsl/linker.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 942f906159..7192567bbb 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1129,9 +1129,7 @@ update_array_sizes(struct gl_shader_program *prog)
foreach_list(node, prog->_LinkedShaders[i]->ir) {
ir_variable *const var = ((ir_instruction *) node)->as_variable();
- if ((var == NULL) || (var->mode != ir_var_uniform &&
- var->mode != ir_var_shader_in &&
- var->mode != ir_var_shader_out) ||
+ if ((var == NULL) || (var->mode != ir_var_uniform) ||
!var->type->is_array())
continue;