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

Marek Olšák maraeo at gmail.com
Thu Oct 20 10:24:23 UTC 2016


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

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


More information about the Piglit mailing list