[Piglit] [PATCH 2/2] arb_gpu_shader5: Add tests for new overload resolution rules
Ilia Mirkin
imirkin at alum.mit.edu
Fri May 16 06:50:10 PDT 2014
On Fri, May 16, 2014 at 4:20 AM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> diff --git a/tests/spec/arb_gpu_shader5/compiler/overloads-05.vert b/tests/spec/arb_gpu_shader5/compiler/overloads-05.vert
> new file mode 100644
> index 0000000..1486bf9
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader5/compiler/overloads-05.vert
> @@ -0,0 +1,24 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5
> +// [end config]
> +
> +// Test overload resolution where all candidates require implicit
> +// conversions. Under unextended GLSL 1.50, resolution is ambiguous,
> +// since both functions require implicit conversions.
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +void foo(float x, int y, float z) {}
> +void foo(float x, int y, int z) {} /* better for `z` */
> +
> +void bar()
> +{
> + int a = 0;
> + int b = 1;
> + int c = 2;
> +
> + foo(a, b, c);
> +}
While this is a fine test, I would also highly recommend having an
execution test to make sure it actually did pick the "better" one. All
this proves is that it decided that one was better than the other.
Cheers,
-ilia
More information about the Piglit
mailing list