Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>

--- 8< ---

BTW these most likely won't pass on AMD since I've noticed that if you use SSO and builtin gl_Position, you'll you will need to redeclare built-in interface blocks like this:

out gl_PerVertex { vec4 gl_Position; };

I believe this is a bug in AMD drivers since this redeclaration rule should only apply on glsl version 140, not for 150 and above.



On 11/30/2015 08:22 AM, Timothy Arceri wrote:
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

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to