[Piglit] [PATCH] glsl-1.30/sampler-bug: test an existing GLSL or st/mesa compiler bug

Marek Olšák maraeo at gmail.com
Sat Oct 10 05:19:39 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

---
 .../spec/glsl-1.30/linker/sampler-bug.shader_test  | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/linker/sampler-bug.shader_test

diff --git a/tests/spec/glsl-1.30/linker/sampler-bug.shader_test b/tests/spec/glsl-1.30/linker/sampler-bug.shader_test
new file mode 100644
index 0000000..8a88343
--- /dev/null
+++ b/tests/spec/glsl-1.30/linker/sampler-bug.shader_test
@@ -0,0 +1,37 @@
+# This reproduces a bug in the GLSL compiler or st/mesa.
+# The shaders can't be simplified more.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+
+in vec4 pos;
+
+void main()
+{
+	gl_Position = pos;
+}
+
+[fragment shader]
+#version 130
+
+struct light
+{
+	vec3 diffuse;
+};
+
+uniform light u_DynamicLights[8];
+uniform sampler2D tex1;
+uniform sampler2D tex2;
+uniform sampler2D tex3;
+
+void main()
+{
+	int i = 0;
+	gl_FragColor = u_DynamicLights[i].diffuse.xyzz +
+		       texture(tex1, gl_FragCoord.xy) +
+		       texture(tex2, gl_FragCoord.xy) +
+		       texture(tex3, gl_FragCoord.xy);
+}
-- 
2.1.4



More information about the Piglit mailing list