[Piglit] [PATCH 2/8] arb_gpu_shader_fp64: Adds uniform buffers VS tests
Andres Gomez
agomez at igalia.com
Tue Mar 15 15:50:43 UTC 2016
* Test for structs with doubles.
* Test for indirect access of uniform array.
* Test for indirect access of uniform dvec4 array.
* Test for uniform boolean between two doubles.
* Test for uniform mixing doubles with floats.
* Test for uniform doubles.
* Test for uniform dmat4 in row major layout.
* Test for uniform dmat4.
* Tests for uniform of array of doubles.
* Test to copy uniform dvec4 array.
Signed-off-by: Andres Gomez <agomez at igalia.com>
---
.../uniform_buffers/vs-array-copy.shader_test | 51 ++++++++++++++++
.../uniform_buffers/vs-dmat4-row-major.shader_test | 44 ++++++++++++++
.../uniform_buffers/vs-dmat4.shader_test | 44 ++++++++++++++
.../vs-double-array-const-index.shader_test | 47 +++++++++++++++
.../vs-double-array-variable-index.shader_test | 54 +++++++++++++++++
.../vs-double-bool-double.shader_test | 47 +++++++++++++++
...ouble-uniform-array-direct-indirect.shader_test | 48 ++++++++++++++++
.../vs-doubles-float-mixed.shader_test | 50 ++++++++++++++++
.../uniform_buffers/vs-doubles.shader_test | 49 ++++++++++++++++
...dvec4-uniform-array-direct-indirect.shader_test | 48 ++++++++++++++++
.../uniform_buffers/vs-nested-struct.shader_test | 67 ++++++++++++++++++++++
11 files changed, 549 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-array-copy.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4-row-major.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-const-index.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-variable-index.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-bool-double.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles-float-mixed.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dvec4-uniform-array-direct-indirect.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-nested-struct.shader_test
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-array-copy.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-array-copy.shader_test
new file mode 100644
index 0000000..cfa8b2d
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-array-copy.shader_test
@@ -0,0 +1,51 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform int i;
+uniform ubo1 {
+ dvec4 colors[4];
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 temp[4] = colors;
+ temp[0] = dvec4(arg0, 0.0, 0.0, 0.0);
+ dvec4 result = dvec4(temp[i]);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.0 1.0 0.0 0.0
+uniform int i 1
+uniform dvec4 colors[0] 0.0 0.0 0.0 0.0
+uniform dvec4 colors[1] 0.0 1.0 0.0 0.0
+uniform dvec4 colors[2] 0.0 1.0 1.0 0.0
+uniform dvec4 colors[3] 1.0 0.0 1.0 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4-row-major.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4-row-major.shader_test
new file mode 100644
index 0000000..3769c28
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4-row-major.shader_test
@@ -0,0 +1,44 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform ubo1 {
+ layout(row_major) dmat4 m;
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(m[0] + m[1] + m[2] + m[3] + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.5 0.75 1.0 1.25
+uniform dmat4 m 0.25 0.0 0.0 0.0 0.0 0.0 0.75 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 1.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4.shader_test
new file mode 100644
index 0000000..40afc04
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dmat4.shader_test
@@ -0,0 +1,44 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform ubo1 {
+ dmat4 m;
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(m[0] + m[1] + m[2] + m[3] + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.5 0.75 1.0 1.25
+uniform dmat4 m 0.25 0.0 0.0 0.0 0.0 0.0 0.75 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 1.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-const-index.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-const-index.shader_test
new file mode 100644
index 0000000..c0db97a
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-const-index.shader_test
@@ -0,0 +1,47 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform ubo1 {
+ double d[4];
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(d[0] + arg0, d[1] + arg0, d[2] + arg0, d[3] + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.25 1.25 0.25 0.25
+uniform double d[0] 0.0
+uniform double d[1] 1.0
+uniform double d[2] 0.0
+uniform double d[3] 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-variable-index.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-variable-index.shader_test
new file mode 100644
index 0000000..262e2ba
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-array-variable-index.shader_test
@@ -0,0 +1,54 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform int ri, gi, bi, ai;
+
+uniform ubo1 {
+ double d[4];
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(d[ri] + arg0, d[gi] + arg0, d[bi] + arg0, d[ai] + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.25 1.25 0.25 0.25
+uniform int ri 0
+uniform int gi 1
+uniform int bi 2
+uniform int ai 3
+
+uniform double d[0] 0.0
+uniform double d[1] 1.0
+uniform double d[2] 0.0
+uniform double d[3] 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-bool-double.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-bool-double.shader_test
new file mode 100644
index 0000000..a84dd1e
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-bool-double.shader_test
@@ -0,0 +1,47 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform bool arg1;
+uniform double arg2;
+uniform double tolerance;
+uniform dvec4 expected;
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result;
+ if (arg1)
+ result = dvec4(arg0, arg2, 0.0, 0.0);
+ else
+ result = dvec4(arg0, arg2, 1.0, 0.0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 1.0
+uniform int arg1 1
+uniform double arg2 1.0
+uniform double tolerance 0.0
+uniform dvec4 expected 1.0 1.0 0.0 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
new file mode 100644
index 0000000..3f24db2
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform double arg[7];
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(arg[int(arg[6] + arg0)]);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.4 0.4 0.4 0.4
+uniform double arg[0] 0.1
+uniform double arg[1] 0.2
+uniform double arg[2] 0.3
+uniform double arg[3] 0.4
+uniform double arg[4] 0.5
+uniform double arg[5] 0.6
+uniform double arg[6] 3.0
+draw rect -1 -1 2 2
+probe rgba 1 1 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles-float-mixed.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles-float-mixed.shader_test
new file mode 100644
index 0000000..a0dbb43
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles-float-mixed.shader_test
@@ -0,0 +1,50 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform ubo1 {
+ double r;
+ float g;
+ double b;
+ double a;
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(r + arg0, g + arg0, b + arg0, a + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.25 1.25 1.25 0.25
+uniform double r 0.0
+uniform float g 1.0
+uniform double b 1.0
+uniform double a 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles.shader_test
new file mode 100644
index 0000000..5762b3b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-doubles.shader_test
@@ -0,0 +1,49 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform ubo1 {
+ double r;
+ double g;
+ double b;
+ double a;
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(r + arg0, g + arg0, b + arg0, a + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.25 1.25 0.25 0.25
+uniform double r 0.0
+uniform double g 1.0
+uniform double b 0.0
+uniform double a 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dvec4-uniform-array-direct-indirect.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dvec4-uniform-array-direct-indirect.shader_test
new file mode 100644
index 0000000..f380fbe
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-dvec4-uniform-array-direct-indirect.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform dvec4 arg[7];
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(arg[int(arg[6].w + arg0)]);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.40 0.41 0.42 0.43
+uniform dvec4 arg[0] 0.10 0.11 0.12 0.13
+uniform dvec4 arg[1] 0.20 0.21 0.22 0.23
+uniform dvec4 arg[2] 0.30 0.31 0.32 0.33
+uniform dvec4 arg[3] 0.40 0.41 0.42 0.43
+uniform dvec4 arg[4] 0.50 0.51 0.52 0.53
+uniform dvec4 arg[5] 0.60 0.61 0.62 0.63
+uniform dvec4 arg[6] 0.70 0.71 0.72 3.00
+draw rect -1 -1 2 2
+probe rgba 1 1 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-nested-struct.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-nested-struct.shader_test
new file mode 100644
index 0000000..e275897
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-nested-struct.shader_test
@@ -0,0 +1,67 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+struct S1 {
+ double r;
+};
+
+struct S2 {
+ float p1;
+ double r;
+ double g;
+ double b;
+ float p2;
+ double a;
+};
+
+struct S {
+ S1 s1;
+ S2 s2;
+};
+
+uniform ubo1 {
+ S s;
+};
+
+in vec4 piglit_vertex;
+out vec4 v;
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ dvec4 result = dvec4(s.s1.r + arg0, s.s2.g + arg0, s.s2.b + arg0, s.s2.a + arg0);
+ v = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+out vec4 color;
+
+void main()
+{
+ color = v;
+}
+
+[test]
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.25 1.25 0.25 0.25
+uniform double s.s1.r 0.0
+uniform float s.s2.p1 1.0
+uniform double s.s2.g 1.0
+uniform double s.s2.b 0.0
+uniform float s.s2.p2 1.0
+uniform double s.s2.a 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
--
2.1.0
More information about the Piglit
mailing list