[Piglit] [PATCH 3/7] arb_enhanced_layouts: test invalid types to use component qualifier with

Timothy Arceri t_arceri at yahoo.com.au
Wed Nov 11 14:59:25 PST 2015


From: Timothy Arceri <timothy.arceri at collabora.com>

---
 .../compiler/component-layout/block-array.frag     | 22 +++++++++++++++++++
 .../compiler/component-layout/block.frag           | 23 ++++++++++++++++++++
 .../compiler/component-layout/matrix-array.vert    | 20 +++++++++++++++++
 .../compiler/component-layout/matrix.vert          | 20 +++++++++++++++++
 .../compiler/component-layout/struct-array.frag    | 25 ++++++++++++++++++++++
 .../compiler/component-layout/struct.frag          | 25 ++++++++++++++++++++++
 6 files changed, 135 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/struct.frag

diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
new file mode 100644
index 0000000..423089b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-array.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1, component = 0) in block {
+	float f;
+} name[2];
+
+float foo(void) {
+	return name[0].f;
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
new file mode 100644
index 0000000..3802009
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location GL_ARB_separate_shader_objects
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1, component = 0) in block {
+	float f;
+};
+
+float foo(void) {
+	return f;
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
new file mode 100644
index 0000000..2ef8aa2
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix-array.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// 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:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out mat3 a[32];
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
new file mode 100644
index 0000000..6569a02
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/matrix.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// 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:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 0, component = 1) out mat3 a;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag b/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag
new file mode 100644
index 0000000..5df0b90
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct-array.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_uniform_location GL_ARB_explicit_attrib_location
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_uniform_location: require
+#extension GL_ARB_explicit_attrib_location: require
+
+struct S {
+  vec4 x;
+};
+
+layout(location = 1, component = 0) uniform S s[2];
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct.frag b/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct.frag
new file mode 100644
index 0000000..9d22448
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/struct.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_uniform_location GL_ARB_explicit_attrib_location
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "It is a compile-time error to apply the component qualifier to a matrix,
+//   a structure, a block, or an array containing any of these."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_uniform_location: require
+#extension GL_ARB_explicit_attrib_location: require
+
+struct S {
+  vec4 x;
+};
+
+layout(location = 1, component = 0) uniform S s;
+
+void main()
+{
+}
-- 
2.4.3



More information about the Piglit mailing list