[Piglit] [PATCH] arb_separate_shader_objects: test explicit location with a struct

Timothy Arceri timothy.arceri at collabora.com
Sun Nov 29 23:42:17 PST 2015


Test results:
Nvidia GeForce 840M - NVIDIA 352.41: pass
i965 - Mesa 11.2-dev: fail
---
 .../execution/layout-location-struct.shader_test   | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test

diff --git a/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test b/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test
new file mode 100644
index 0000000..b6b3d1c
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test
@@ -0,0 +1,51 @@
+// Test that inputs and outputs are assigned the correct location when using
+// a struct and explicit locations.
+
+[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 a;
+} s;
+
+layout(location = 2) out struct S2 {
+	vec4 a;
+} s2;
+
+void main()
+{
+	s.a = vec4(1.0, 0.0, 0.0, 1.0);
+	s2.a = vec4(0.0, 1.0, 1.0, 1.0);
+
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 2) in struct S {
+	vec4 a;
+} s;
+
+layout(location = 0) in struct S1 {
+	vec4 a;
+} s2;
+
+out vec4 color;
+
+void main()
+{
+	color = s2.a;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgb 1 0 0
-- 
2.4.3



More information about the Piglit mailing list