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

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

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

Reply via email to