[Piglit] [PATCH 3/3] arb_vertex_attrib_64bit: pass a 64-bit vertex attrib through to frag shader

Ilia Mirkin imirkin at alum.mit.edu
Mon Feb 23 17:37:53 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>
>
> Check the double value unpacks cleanly in the fragment shader.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  vs-fs-pass-vertex-attrib.shader_test | 50 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 vs-fs-pass-vertex-attrib.shader_test
>
> diff --git a/vs-fs-pass-vertex-attrib.shader_test b/vs-fs-pass-vertex-attrib.shader_test
> new file mode 100644
> index 0000000..b5dc8a8
> --- /dev/null
> +++ b/vs-fs-pass-vertex-attrib.shader_test
> @@ -0,0 +1,50 @@
> +# test sending a double vertex attrib
> +# through the pipeline unpacks correctly
> +#
> +[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 dvec2 vertex;
> +in double value;
> +flat out double val_to_fs;
> +void main()
> +{
> +        gl_Position = vec4(vertex, 0.0, 1.0);
> +       val_to_fs = value;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +flat in double val_to_fs;
> +uniform uint expected1;
> +uniform uint expected2;
> +out vec4 color;
> +
> +void main()
> +{
> +       uvec2 unpck = unpackDouble2x32(val_to_fs);
> +       if (unpck == uvec2(expected1, expected2))

I think there are enough tests of double uniforms to instead just do a
double uniform set to 1.5. If you really want to do the hex thing, at
least make the expected thing a uvec2 and write it using hex.

> +               color = vec4(0.0, 1.0, 0.0, 1.0);
> +       else
> +               color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[vertex data]
> +vertex/double/2 value/double/1
> +-1.0 -1.0 1.5
> + 1.0 -1.0 1.5
> + 1.0  1.0 1.5
> +-1.0  1.0 1.5
> +
> +[test]
> +uniform uint expected1 0
> +uniform uint expected2 1073217536
> +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