[Piglit] [PATCH] arb_enhanced_layouts: more fs output tests
Timothy Arceri
timothy.arceri at collabora.com
Tue Jan 12 23:25:26 PST 2016
---
.../component-layout/fs-out-array.shader_test | 36 ++++++++++++++++++++++
.../fs-out-overlap-array.shader_test | 36 ++++++++++++++++++++++
.../component-layout/fs-out-overlap4.shader_test | 35 +++++++++++++++++++++
.../fs-out-type-mismatch-array.shader_test | 36 ++++++++++++++++++++++
4 files changed, 143 insertions(+)
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
new file mode 100644
index 0000000..df96f89
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+// "Additionally, for fragment shader outputs, if two variables are placed
+// within the same location, they must have the same underlying type
+// (floating-point or integer). No component aliasing of output variables or
+// members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0) out vec2 a[2];
+
+// consumes Z/W components
+layout(location = 1, component = 2) out vec2 b;
+
+void main()
+{
+ a[0] = vec2(0.0);
+ a[1] = vec2(0.5);
+ b = vec2(1.0);
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
new file mode 100644
index 0000000..2bdabf4
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+// "Additionally, for fragment shader outputs, if two variables are placed
+// within the same location, they must have the same underlying type
+// (floating-point or integer). No component aliasing of output variables or
+// members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0) out vec2 a[2];
+
+// consumes Z/W components
+layout(location = 1, component = 1) out vec2 b;
+
+void main()
+{
+ a[0] = vec2(0.0);
+ a[1] = vec2(0.5);
+ b = vec2(1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
new file mode 100644
index 0000000..43ac056
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test
@@ -0,0 +1,35 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+// "Additionally, for fragment shader outputs, if two variables are placed
+// within the same location, they must have the same underlying type
+// (floating-point or integer). No component aliasing of output variables or
+// members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0, component = 1) out vec2 a;
+
+// consumes Z/W components
+layout(location = 0) out vec2 b;
+
+void main()
+{
+ a = vec2(0.0);
+ b = vec2(1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
new file mode 100644
index 0000000..7ca5543
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test
@@ -0,0 +1,36 @@
+// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec:
+//
+// "Additionally, for fragment shader outputs, if two variables are placed
+// within the same location, they must have the same underlying type
+// (floating-point or integer). No component aliasing of output variables or
+// members is allowed."
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+GL_ARB_explicit_attrib_location
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y components
+layout(location = 0) out ivec2 a[2];
+
+// consumes Z/W components
+layout(location = 1, component = 2) out vec2 b;
+
+void main()
+{
+ a[0] = ivec2(0);
+ a[1] = ivec2(2);
+ b = vec2(1.0);
+}
+
+[test]
+link error
--
2.4.3
More information about the Piglit
mailing list