summaryrefslogtreecommitdiff
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-11-15 14:23:45 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-23 12:45:16 -0800
commita645df01340d758b79905696a7ae41e196ba57f5 (patch)
treed266e77fe16014e12f580cb0dc30e2a3379d537e /src/glsl/linker.cpp
parent3470916d6af016254fe938324d67d58307384920 (diff)
glsl: Fix interstage uniform interface block link error detection.
Previously, we checked for interstage uniform interface block link errors in validate_interstage_interface_blocks(), which is only called on pairs of adjacent shader stages. Therefore, we failed to detect uniform interface block mismatches between non-adjacent shader stages. Before the introduction of geometry shaders, this wasn't a problem, because the only supported shader stages were vertex and fragment shaders, therefore they were always adjacent. However, now that we allow a program to contain vertex, geometry, and fragment shaders, that is no longer the case. Fixes piglit test "skip-stage-uniform-block-array-size-mismatch". Cc: "10.0" <mesa-stable@lists.freedesktop.org> v2: Rename validate_interstage_interface_blocks() to validate_interstage_inout_blocks() to reflect the fact that it no longer validates uniform blocks. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> v3: Make validate_interstage_inout_blocks() skip uniform blocks. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 544e3129c5addeb6c9539339782dd54616ef0499)
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 1d53b659955..fac186a6379 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2154,8 +2154,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (prog->_LinkedShaders[i] == NULL)
continue;
- validate_interstage_interface_blocks(prog, prog->_LinkedShaders[prev],
- prog->_LinkedShaders[i]);
+ validate_interstage_inout_blocks(prog, prog->_LinkedShaders[prev],
+ prog->_LinkedShaders[i]);
if (!prog->LinkStatus)
goto done;
@@ -2168,6 +2168,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
prev = i;
}
+ /* Cross-validate uniform blocks between shader stages */
+ validate_interstage_uniform_blocks(prog, prog->_LinkedShaders,
+ MESA_SHADER_TYPES);
+ if (!prog->LinkStatus)
+ goto done;
for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
if (prog->_LinkedShaders[i] != NULL)