[Piglit] [PATCH] arb_separate_shader_objects: test explicit location on interface blocks

Timothy Arceri timothy.arceri at collabora.com
Sun Nov 29 22:22:04 PST 2015


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

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



More information about the Piglit mailing list