[Piglit] [PATCH 1/7] arb_enhanced_layouts: add basic component qualifier tests

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


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

---
 .../compiler/component-layout/basic.vert           | 20 ++++++++++++++++++
 .../compiler/component-layout/block-member.frag    | 23 +++++++++++++++++++++
 .../compiler/component-layout/interleaved.vert     | 20 ++++++++++++++++++
 .../compiler/component-layout/no-location.vert     | 24 ++++++++++++++++++++++
 4 files changed, 87 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert

diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
new file mode 100644
index 0000000..74ca27b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/basic.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consume X/Y/Z components
+layout(location = 0) in vec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) in float b;
+
+void main()
+{
+  gl_Position = vec4(a, b);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
new file mode 100644
index 0000000..6dea3af
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/block-member.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: pass
+// 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:
+//
+//   "Of these, variables and block members (but not blocks) additionally
+//   allow the component layout qualifier."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+#extension GL_ARB_separate_shader_objects: require
+
+in block {
+	layout(location = 1, component = 3) float f;
+};
+
+float foo(void) {
+	return f;
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
new file mode 100644
index 0000000..f150353
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/interleaved.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location
+// [end config]
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+// consumes W component of 32 vectors
+layout(location = 0, component = 3) in float a[32];
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) in vec3 b[32];
+
+void main()
+{
+  gl_Position = vec4(a[0], b[31]);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert
new file mode 100644
index 0000000..64d75ed
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/no-location.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts 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 use component without also specifying the
+//    location qualifier (order does not matter)."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+
+layout(location = 0) in vec3 a;
+
+// no location
+layout(component = 3) in float b;
+
+void main()
+{
+  gl_Position = vec4(a, b);
+}
-- 
2.4.3



More information about the Piglit mailing list