[Piglit] [PATCH] ARB_explicit_attrib_location: fix layout-12|13.frag, add layout-14.frag

Tapani Pälli tapani.palli at intel.com
Tue Jul 22 03:59:10 PDT 2014


This is the same change as what commit fc19d53 did for 1.20 tests.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81076
---
 .../1.10/compiler/layout-12.frag                   | 27 ++++++----------------
 .../1.10/compiler/layout-13.frag                   |  4 ++--
 .../1.10/compiler/layout-14.frag                   | 21 +++++++++++++++++
 3 files changed, 30 insertions(+), 22 deletions(-)
 create mode 100644 tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-14.frag

diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-12.frag b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-12.frag
index 2b187f2..979e321 100644
--- a/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-12.frag
+++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-12.frag
@@ -1,28 +1,15 @@
 // [config]
-// expect_result: pass
+// expect_result: fail
 // glsl_version: 1.10
 // require_extensions: GL_ARB_explicit_attrib_location GL_ARB_blend_func_extended
 // [end config]
 //
-// Even though the specified locations overlap, the spec says that a *link*
-// error is generated.  The changes to section 3.9.2 say:
-//
-//     "Output binding assignments will cause LinkProgram to fail:
-//
-//           * if the number of active outputs is greater than the value of
-//             MAX_DRAW_BUFFERS;
-//
-//           * if the program has an active output assigned to a location
-//             greater than or equal to the value of
-//             MAX_DUAL_SOURCE_DRAW_BUFFERS and has an active output assigned
-//             an index greater than or equal to one;
-//
-//           * if more than one varying out variable is bound to the same
-//             number and index; or
-//
-//           * if the explicit binding assigments do not leave enough space
-//             for the linker to automatically assign a location for a varying
-//             out array, which requires multiple contiguous locations."
+// While the GL_ARB_explicit_attrib_location specification does not say
+// anything about generating errors for invalid indices, the GLSL 4.30
+// spec clarifies this: "It is also a compile-time error if a fragment shader
+// sets a layout index to less than 0 or greater than 1."  This matches the
+// behavior of the equivalent API call, glBindFragDataLocationIndexed, which
+// generates an INVALID_VALUE error if <index> is not 0 or 1.
 
 #version 110
 #extension GL_ARB_explicit_attrib_location: require
diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-13.frag b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-13.frag
index 2be0403..21853b9 100644
--- a/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-13.frag
+++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-13.frag
@@ -26,8 +26,8 @@
 
 #version 110
 #extension GL_ARB_explicit_attrib_location: require
-layout(location = 0, index = 2) out vec4 color;
-layout(location = 0, index = 2) out vec4 factor;
+layout(location = 0, index = 1) out vec4 color;
+layout(location = 0, index = 1) out vec4 factor;
 
 void main()
 {
diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-14.frag b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-14.frag
new file mode 100644
index 0000000..55d0565
--- /dev/null
+++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/layout-14.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.10
+// require_extensions: GL_ARB_explicit_attrib_location GL_ARB_blend_func_extended
+// [end config]
+//
+// While the GL_ARB_explicit_attrib_location specification does not say
+// anything about generating errors for invalid indices, the GLSL 4.30
+// spec clarifies this: "It is also a compile-time error if a fragment shader
+// sets a layout index to less than 0 or greater than 1."  This matches the
+// behavior of the equivalent API call, glBindFragDataLocationIndexed, which
+// generates an INVALID_VALUE error if <index> is not 0 or 1.
+
+#version 110
+#extension GL_ARB_explicit_attrib_location: require
+layout(location = 0, index = -5) out vec4 color;
+
+void main()
+{
+	color = vec4(1.0);
+}
-- 
1.9.3



More information about the Piglit mailing list