[Piglit] [PATCH 2/8] arb_enhanced_layouts: test for component overlap in linker rather than compiler

Timothy Arceri timothy.arceri at collabora.com
Sun Nov 29 14:19:51 PST 2015


---
 .../compiler/component-layout/overlap-illegal.vert | 32 -------------
 .../component-layout/vs-to-fs-overlap.shader_test  | 52 ++++++++++++++++++++++
 2 files changed, 52 insertions(+), 32 deletions(-)
 delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-overlap.shader_test

diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
deleted file mode 100644
index d7d15e6..0000000
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-illegal.vert
+++ /dev/null
@@ -1,32 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.40
-// check_link: true
-// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
-// [end config]
-//
-// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
-//
-//   "Location aliasing is causing two variables or block members to have the
-//   same location number. Component aliasing is assigning the same (or
-//   overlapping) component numbers for two location aliases. (Recall if
-//   component is not used, components are assigned starting with 0.) With one
-//   exception, location aliasing is allowed only if it does not cause
-//   component aliasing; it is a compile-time or link-time error to cause
-//   component aliasing."
-
-#version 140
-#extension GL_ARB_enhanced_layouts: require
-#extension GL_ARB_separate_shader_objects: require
-
-// consume Y/Z/W components
-layout(location = 0, component = 1) out vec3 a;
-
-// consumes W component
-layout(location = 0, component = 3) out float b;
-
-void main()
-{
-  a = vec3(1.0);
-  b = 0.0;
-}
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-overlap.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-overlap.shader_test
new file mode 100644
index 0000000..e0e88e1
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-overlap.shader_test
@@ -0,0 +1,52 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Location aliasing is causing two variables or block members to have the
+//   same location number. Component aliasing is assigning the same (or
+//   overlapping) component numbers for two location aliases. (Recall if
+//   component is not used, components are assigned starting with 0.) With one
+//   exception, location aliasing is allowed only if it does not cause
+//   component aliasing; it is a compile-time or link-time error to cause
+//   component aliasing."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume Y/Z/W components
+layout(location = 0, component = 1) out vec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+  a = vec3(1.0);
+  b = 0.0;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume Y/Z/W components
+layout(location = 0, component = 1) in vec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) in float b;
+
+void main()
+{
+  color = vec4(b, a);
+}
+
+[test]
+link error
-- 
2.4.3



More information about the Piglit mailing list