Re: [Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add some inout function argument tests

2016-10-20 Thread Marek Olšák
For the series:

Reviewed-by: Marek Olšák 

Marek

On Mon, Oct 17, 2016 at 7:21 PM, Nicolai Hähnle  wrote:
> From: Nicolai Hähnle 
>
> 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 000..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
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add some inout function argument tests

2016-10-17 Thread Nicolai Hähnle
From: Nicolai Hähnle 

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 000..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

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit