summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2015-11-30 17:13:22 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2015-12-02 09:07:43 +1100
commitf1e416b8e65ad95c6ce9e04a80d83e7f9e1e9239 (patch)
treee9c18e4a14eb6c5929813e391bbb4f4844776308
parent5dcfa3604a8733a98eb4f4ea8b04d6d52aecbe3d (diff)
arb_separate_shader_objects: test explicit location on interface blocks
Test results: Nvidia GeForce 840M - NVIDIA 352.41: pass i965 - Mesa 11.2-dev: fail Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
-rw-r--r--tests/spec/arb_separate_shader_objects/execution/layout-location-block.shader_test51
-rw-r--r--tests/spec/arb_separate_shader_objects/execution/layout-location-named-block.shader_test51
2 files changed, 102 insertions, 0 deletions
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 000000000..76b4cd179
--- /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 000000000..51bf7c5b3
--- /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