[Piglit] [PATCH 2/2] arb_enhanced_layouts: add test for filling the gaps in a dvec3 array
Nicolai Hähnle
nhaehnle at gmail.com
Fri Oct 7 19:56:55 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
.../component-layout/vs-fs-array-dvec3.shader_test | 69 ++++++++++++++++++++++
1 file changed, 69 insertions(+)
create mode 100644 tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
new file mode 100644
index 0000000..c2bb768
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
@@ -0,0 +1,69 @@
+# Test filling in the gaps of a dvec3 array.
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_gpu_shader_fp64: require
+
+// XYZW components of 0 & 2, XY components of 1 & 3
+layout(location = 0, component = 0) flat out dvec3 a[2];
+
+// ZW component of 1
+layout(location = 1, component = 2) flat out double b;
+
+in vec4 piglit_vertex;
+
+void main()
+{
+ a[0] = dvec3(0.0, 1.0, 2.0);
+ a[1] = dvec3(3.0, 4.0, 5.0);
+ b = 6.0;
+
+ gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+#extension GL_ARB_gpu_shader_fp64: require
+
+out vec4 color;
+
+// XYZW components of 0 & 2, XY components of 1 & 3
+layout(location = 0, component = 0) flat in dvec3 a[2];
+
+// ZW component of 1
+layout(location = 1, component = 2) flat in double b;
+
+void main()
+{
+ for (int i = 0; i < 2; ++i) {
+ if (a[i].x != 3.0 * i) {
+ color = vec4(1, 0, i * 0.1, a[i].x * 0.1);
+ return;
+ }
+ if (a[i].y != 3.0 * i + 1.0) {
+ color = vec4(1, 0.25, i * 0.1, a[i].y * 0.1);
+ return;
+ }
+ if (a[i].z != 3.0 * i + 2.0) {
+ color = vec4(1, 0.5, i * 0.1, a[i].z * 0.1);
+ return;
+ }
+ }
+ if (b != 6.0) {
+ color = vec4(1, 0.75, 0, b * 0.1);
+ return;
+ }
+ color = vec4(0, 1, 0, 1);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
--
2.7.4
More information about the Piglit
mailing list