[Piglit] [PATCH] arb_separate_shader_objects: test for explicit varying location overlap struct and block

Timothy Arceri timothy.arceri at collabora.com
Tue Dec 15 21:59:24 PST 2015


Test results:
Nvidia GeForce 840M - NVIDIA 352.41: pass
Mesa 11.2 (dev): fail
---
 ...-fs-explicit-location-overlap-block.shader_test | 54 ++++++++++++++++++++++
 ...fs-explicit-location-overlap-struct.shader_test | 54 ++++++++++++++++++++++
 2 files changed, 108 insertions(+)
 create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-block.shader_test
 create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-struct.shader_test

diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-block.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-block.shader_test
new file mode 100644
index 0000000..228adc4
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-block.shader_test
@@ -0,0 +1,54 @@
+// Test for explicit varying location overlap by interface blocks
+
+[require]
+GLSL >= 1.50
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 150
+#extension GL_ARB_separate_shader_objects : require
+
+in vec4 piglit_vertex;
+
+layout(location = 0) out Block {
+	vec4 out1;
+	vec4 out2;
+} b;
+
+layout(location = 1) out vec4 out3;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	b.out1 = vec4(1.0, 0.0, 0.0, 1.0);
+	b.out2 = vec4(1.0, 1.0, 0.0, 1.0);
+	out3 = vec4(0.0);
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_separate_shader_objects : require
+
+uniform int i;
+
+layout(location = 0) in Block {
+	vec4 out1;
+	vec4 out2;
+} b;
+
+layout(location = 1) in vec4 out3;
+
+out vec4 color;
+
+void main()
+{
+	if (i == 0)
+		color = b.out1;
+	else if (i == 1)
+		color = b.out2;
+	else
+		color = out3;
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-struct.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-struct.shader_test
new file mode 100644
index 0000000..d32cceb
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-struct.shader_test
@@ -0,0 +1,54 @@
+// Test for explicit varying location overlap by structs
+
+[require]
+GLSL >= 1.50
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 150
+#extension GL_ARB_separate_shader_objects : require
+
+in vec4 piglit_vertex;
+
+layout(location = 0) out struct S {
+	vec4 out1;
+	vec4 out2;
+} s;
+
+layout(location = 1) out vec4 out3;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	s.out1 = vec4(1.0, 0.0, 0.0, 1.0);
+	s.out2 = vec4(1.0, 1.0, 0.0, 1.0);
+	out3 = vec4(0.0);
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_separate_shader_objects : require
+
+uniform int i;
+
+layout(location = 0) in struct S {
+	vec4 out1;
+	vec4 out2;
+} s;
+
+layout(location = 1) in vec4 out3;
+
+out vec4 color;
+
+void main()
+{
+	if (i == 0)
+		color = s.out1;
+	else if (i == 1)
+		color = s.out2;
+	else
+		color = out3;
+}
+
+[test]
+link error
-- 
2.4.3



More information about the Piglit mailing list