[Piglit] [PATCH] fp64: test passing a double from vs->fs

Ilia Mirkin imirkin at alum.mit.edu
Thu Feb 19 18:52:01 PST 2015


On Thu, Feb 19, 2015 at 9:40 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> We have a test passing a dvec4 from vs->fs that passes, this test
> passing a single double, it currently falls over an assert
> in varying packing.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  .../execution/vs-out-fs-in-double-2.shader_test    | 45 ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/vs-out-fs-in-double-2.shader_test
>
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/vs-out-fs-in-double-2.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/vs-out-fs-in-double-2.shader_test
> new file mode 100644
> index 0000000..2efae15
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/vs-out-fs-in-double-2.shader_test
> @@ -0,0 +1,45 @@
> +# test emitting a single double from vs->fs works
> +# when originally written this failed in varying lowering
> +#
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +uniform double arg0;
> +in vec4 vertex;
> +flat out double dout1;
> +void main()
> +{
> +        gl_Position = vertex;
> +       dout1 = arg0;

indent is funny... tabs vs spaces?

> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +#

Remove # (should this even compile??)

> +flat in double dout1;
> +uniform double tolerance;
> +uniform double expected;
> +void main()
> +{
> +  double result = trunc(dout1);
> +  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);

Consistent indent please (i.e. if tabs above, tabs here)

> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +uniform double arg0 1.7976931348623157E+308
> +uniform double expected 1.7976931348623157E+308
> +uniform double tolerance 2.0000000000000002e-05
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe rgba 0 0 0.0 1.0 0.0 1.0

Should also add a version where it's an double[] array, and also a
(lone?) double in a struct)

  -ilia


More information about the Piglit mailing list