[Piglit] [PATCH] glsl-1.50: add linker test for unused in out blocks

Józef Kucia joseph.kucia at gmail.com
Tue May 30 14:23:28 UTC 2017


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."
---
 .../interstage-multiple-shader-objects.shader_test | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test

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 0000000..66a46d5
--- /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
-- 
2.10.2



More information about the Piglit mailing list