[Piglit] [PATCH] arb_enhanced_layouts: test for component aliasing of doubles

Timothy Arceri timothy.arceri at collabora.com
Thu Jan 7 15:08:25 PST 2016


---
 .../vs-to-fs-double-overlap.shader_test            | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-double-overlap.shader_test

diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-double-overlap.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-double-overlap.shader_test
new file mode 100644
index 0000000..f692dd8
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-double-overlap.shader_test
@@ -0,0 +1,55 @@
+// 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_gpu_shader_fp64
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consumes X/Y/Z/W components
+layout(location = 0) flat out dvec2 a;
+
+// consumes Z/W components
+layout(location = 0, component = 2) flat out double b;
+
+void main()
+{
+  a = dvec2(1.0);
+  b = 0.0;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consumes X/Y/Z/W components
+layout(location = 0) flat in dvec2 a;
+
+// consumes Z/W components
+layout(location = 0, component = 2) flat in double b;
+
+void main()
+{
+  color = vec4(vec2(b), float(a), 1.0);
+}
+
+[test]
+link error
-- 
2.4.3



More information about the Piglit mailing list