[Piglit] [PATCH 7/7] arb_enhanced_layouts: add linking tests for component layout qualifier
Timothy Arceri
t_arceri at yahoo.com.au
Wed Nov 11 14:59:29 PST 2015
From: Timothy Arceri <timothy.arceri at collabora.com>
---
.../intrastage-vs-mismatch.shader_test | 43 +++++++++++++++++++++
.../component-layout/intrastage-vs.shader_test | 43 +++++++++++++++++++++
.../component-layout/vs-to-fs-mismatch.shader_test | 45 ++++++++++++++++++++++
.../linker/component-layout/vs-to-fs.shader_test | 45 ++++++++++++++++++++++
4 files changed, 176 insertions(+)
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
new file mode 100644
index 0000000..08c1d99
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs-mismatch.shader_test
@@ -0,0 +1,43 @@
+# This test verifies that a link error is generated if intrastage
+# component qualifiers don't match.
+
+[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 of 32 vectors
+layout(location = 0, component = 1) out vec3 a[32];
+
+// consumes X component of first vector
+layout(location = 0, component = 0) out float b;
+
+void f()
+{
+ a[3] = vec3(0.0);
+ b = float(1.0);
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+ a[0] = vec3(1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
new file mode 100644
index 0000000..0f0a770
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/intrastage-vs.shader_test
@@ -0,0 +1,43 @@
+# This test verifies that a no error is generated if intrastage
+# component qualifiers match.
+
+[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 X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void f()
+{
+ a[3] = vec3(0.0);
+ b = float(1.0);
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+ a[0] = vec3(1.0);
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
new file mode 100644
index 0000000..d61c6c6
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-mismatch.shader_test
@@ -0,0 +1,45 @@
+# Test for link error between vertex and fragment shaders when
+# component qualifiers don't match.
+
+[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 X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+ a[0] = vec3(1.0);
+ b = float(0.5);
+}
+
+[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 of 32 vectors
+layout(location = 0, component = 1) in vec3 a[32];
+
+// consumes X component of first vector
+layout(location = 0, component = 0) in float b;
+
+void main()
+{
+ color = vec4(b, a[0]);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test
new file mode 100644
index 0000000..c1d71e8
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs.shader_test
@@ -0,0 +1,45 @@
+# Test for successful linking between vertex and fragment shaders when
+# component qualifiers match.
+
+[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 X/Y/Z components of 32 vectors
+layout(location = 0) out vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+ a[0] = vec3(1.0);
+ b = float(0.5);
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume X/Y/Z components of 32 vectors
+layout(location = 0) in vec3 a[32];
+
+// consumes W component of first vector
+layout(location = 0, component = 3) in float b;
+
+void main()
+{
+ color = vec4(b, a[0]);
+}
+
+[test]
+link success
--
2.4.3
More information about the Piglit
mailing list