[Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add some inout function argument tests
Nicolai Hähnle
nhaehnle at gmail.com
Mon Oct 17 17:21:53 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
This exposes a bug in st_glsl_to_tgsi.
---
.../execution/fs-function-inout-array.shader_test | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/fs-function-inout-array.shader_test
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-function-inout-array.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-function-inout-array.shader_test
new file mode 100644
index 0000000..5ba2004
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-function-inout-array.shader_test
@@ -0,0 +1,43 @@
+# Test inout double arrays passed to functions.
+
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+out vec4 ocolor;
+
+void multiply(inout double array[4])
+{
+ for (int i = 0; i < 4; ++i) {
+ array[i] *= i;
+ }
+}
+
+void main()
+{
+ double array[4];
+
+ for (int i = 0; i < 4; ++i)
+ array[i] = 1.0;
+
+ multiply(array);
+
+ for (int i = 0; i < 4; ++i) {
+ if (array[i] != double(i)) {
+ ocolor = vec4(1.0, float(i) / 255.0, array[i] / 255.0, 1.0);
+ return;
+ }
+ }
+
+ ocolor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
--
2.7.4
More information about the Piglit
mailing list