[Piglit] [PATCH 1/3] arb_gpu_shader_fp64: add glsl algebraic tests

Tapani Pälli tapani.palli at intel.com
Wed Aug 20 05:36:18 PDT 2014


add tests for add, csel, div, mul, neg operations

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../glsl-algebraic-add-double.shader_test          | 22 ++++++++++++++++++++++
 .../glsl-algebraic-csel-double.shader_test         | 20 ++++++++++++++++++++
 .../glsl-algebraic-div-double.shader_test          | 20 ++++++++++++++++++++
 .../glsl-algebraic-mul-double.shader_test          | 20 ++++++++++++++++++++
 .../glsl-algebraic-neg-double.shader_test          | 20 ++++++++++++++++++++
 5 files changed, 102 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test
new file mode 100644
index 0000000..feef315
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+uniform vec4 color;
+void main()
+{
+	dvec4 dcolor = color;
+	dvec4 a = dvec4(0.5lf, 0.0lf, 0.0lf, 0.0lf);
+	dvec4 b = dvec4(-1.0lf, 0.0lf, 0.0lf, 0.0lf);
+	gl_FragColor = vec4((a + dcolor) + b);
+}
+
+[test]
+uniform vec4 color 0.5 1.0 0.0 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test
new file mode 100644
index 0000000..e8bf9f8
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+void main()
+{
+	const double small = 1.0lf;
+	const double big = 2.0lf;
+	double val = (big > small) ? 1.0lf : 0.0lf;
+	gl_FragColor = vec4(val, 0.0, val, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgb 1.0 0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test
new file mode 100644
index 0000000..3dc5dc5
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+uniform vec4 color;
+void main()
+{
+	dvec4 dcolor = color;
+	gl_FragColor = vec4(dvec4(1.0lf, 0.6lf, 1.0lf, 1.0lf) / dcolor);
+}
+
+[test]
+uniform vec4 color 2.0 3.0 4.0 1.0
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.2 0.25 0.0
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test
new file mode 100644
index 0000000..227bd93
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+uniform vec4 color;
+void main()
+{
+	dvec4 dcolor = color;
+	gl_FragColor = vec4(dvec4(0.5lf, 0.5lf, 0.5lf, 1.0lf) * dcolor);
+}
+
+[test]
+uniform vec4 color 1.0 1.0 1.0 0.0
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.5 0.5 0.0
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test
new file mode 100644
index 0000000..3dc6c13
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+uniform vec4 color;
+void main()
+{
+	dvec4 dcolor = color;
+	gl_FragColor = vec4(-dcolor);
+}
+
+[test]
+uniform vec4 color 1.0 -1.0 0.0 0.0
+draw rect -1 -1 2 2
+probe rgb 1 1 0.0 1.0 0.0
-- 
1.9.3



More information about the Piglit mailing list