[Piglit] [PATCH] arb_gpu_shader_fp64: make sure implicit double->float doesnt' happen
Ilia Mirkin
imirkin at alum.mit.edu
Wed May 6 08:07:15 PDT 2015
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
On Wed, May 6, 2015 at 2:16 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> Mesa is allowing this right now, so add a test to make it not happen
> again.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> .../compiler/implicit-conversion-bad.vert | 30 ++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
> create mode 100644 tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
>
> diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
> new file mode 100644
> index 0000000..95b85c8
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
> @@ -0,0 +1,30 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader_fp64
> +// [end config]
> +//
> +// Test double -> float implicit conversion doesn't happen
> +// this tests a bug in mesa
> +
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : enable
> +
> +float _float = 0.0f;
> +vec2 _vec2 = vec2(0.0f);
> +vec3 _vec3 = vec3(0.0f);
> +vec4 _vec4 = vec4(0.0f);
> +
> +double _double = 0.0lf;
> +dvec2 _dvec2 = dvec2(0.0lf);
> +dvec3 _dvec3 = dvec3(0.0lf);
> +dvec4 _dvec4 = dvec4(0.0lf);
> +
> +void test() {
> +
> + /* int can be converted to double (and for vectors of same) */
> + _float = _double;
> + _vec2 = _dvec2;
> + _vec3 = _dvec3;
> + _vec4 = _dvec4;
> +}
> --
> 2.1.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list