diff options
author | Józef Kucia <joseph.kucia@gmail.com> | 2017-05-30 16:23:28 +0200 |
---|---|---|
committer | Timothy Arceri <tarceri@itsqueeze.com> | 2017-07-19 09:50:53 +1000 |
commit | 56e7e5583cd4a3ca15a8cda154d46d168959dd25 (patch) | |
tree | 8101556c9ffe8f39ba68e48e6d8b103ccbf1482e | |
parent | 9558ce874ba7d09fc27ce7ded01c98173ff2b957 (diff) |
glsl-1.50: add linker test for unused in out blocks
This test exposes a Mesa GLSL linker bug. The test fails with the
following error message:
error: Input block `blk' is not an output of the previous stage
Section 4.3.4 (Inputs) of the GLSL 1.50 spec says:
"Only the input variables that are actually read need to be written
by the previous stage; it is allowed to have superfluous
declarations of input variables."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101247
-rw-r--r-- | tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test new file mode 100644 index 000000000..66a46d5bf --- /dev/null +++ b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test @@ -0,0 +1,38 @@ +# Exercises a Mesa GLSL linker bug. +# +# Note that the output block is not used and it is not declared in the main +# shader object. + +[require] +GLSL >= 1.50 + +[vertex shader] +out blk { + vec4 foo; +} inst; + +void set_output(vec4 v) +{ + gl_Position = v; +} + +[vertex shader] +void set_output(vec4 v); + +void main() +{ + set_output(vec4(1.0)); +} + +[fragment shader] +in blk { + vec4 foo; +} inst; + +void main() +{ + gl_FragColor = vec4(1.0); +} + +[test] +link success |