[Piglit] [PATCH] glsl-1.20: test 'invariant' propagation influence on globals matching

Danylo Piliaiev danylo.piliaiev at gmail.com
Tue Sep 4 15:57:46 UTC 2018


Global variable defined in several shaders of one stage should not cause
"mismatched qualifiers" linking error when invariance is being propagated
on it in one shader.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
---
 .../invariant-propagation-globals.shader_test | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 tests/spec/glsl-1.20/linker/invariant-propagation-globals.shader_test

diff --git a/tests/spec/glsl-1.20/linker/invariant-propagation-globals.shader_test b/tests/spec/glsl-1.20/linker/invariant-propagation-globals.shader_test
new file mode 100644
index 000000000..d49fa3c3e
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/invariant-propagation-globals.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+# This test exercises a Mesa GLSL bug where 'invariant' qualifier
+# propagates on one definition of the global variable defined in several
+# shaders of one stage, causing linking error due to qualifier mismatch.
+
+[vertex shader]
+#version 120
+float x;
+
+[vertex shader]
+#version 120
+float x;
+invariant gl_Position;
+
+void main()
+{
+  gl_Position = vec4(x);
+}
+
+[fragment shader]
+#version 120
+void main()
+{
+}
+
+[test]
+link success
-- 
2.18.0



More information about the Piglit mailing list