[Piglit] [PATCH 1/3] arb_vertex_attrib_64bit: add simple vertex input fp64 test

Ilia Mirkin imirkin at alum.mit.edu
Mon Feb 23 17:30:04 PST 2015


On Mon, Feb 23, 2015 at 8:26 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This is just a simple 64-bit vertex attrib test.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  .../execution/vs-fp64-input-trunc.shader_test      | 42 ++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
>
> diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
> new file mode 100644
> index 0000000..9fb3e4f
> --- /dev/null
> +++ b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
> @@ -0,0 +1,42 @@
> +# test truncating a double holds precision
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +GL_ARB_vertex_attrib_64bit
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +#extension GL_ARB_vertex_attrib_64bit : require
> +in dvec4 vertex;
> +void main()
> +{
> +        gl_Position = vec4(vertex);
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +uniform double arg0;
> +uniform double tolerance;
> +uniform double expected;
> +
> +void main()
> +{
> +  double result = trunc(arg0);
> +  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);

I think you meant

gl_FragColor = vec4(0, 1, 0, 1);

and get rid of all the uniform stuff.

> +}
> +
> +[vertex data]
> +vertex/double/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
> --
> 1.9.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list