[Piglit] [PATCH] arb_gpu_shader_fp64: verify function parameter overloads
Ilia Mirkin
imirkin at alum.mit.edu
Mon Jun 22 09:25:58 PDT 2015
On Mon, Jun 22, 2015 at 12:22 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 06/17/2015 12:43 PM, Ilia Mirkin wrote:
>> fp64 adds variants of all sorts of functions. make sure that we're still
>> able to resolve otherwise-ambiguous calls in the presence of gs5.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>> .../compiler/implicit-conversions-func.vert | 22 ++++++++++++++++++++++
>> 1 file changed, 22 insertions(+)
>> create mode 100644 tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversions-func.vert
>>
>> diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversions-func.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversions-func.vert
>> new file mode 100644
>> index 0000000..224aecb
>> --- /dev/null
>> +++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversions-func.vert
>> @@ -0,0 +1,22 @@
>> +// [config]
>> +// expect_result: pass
>> +// glsl_version: 1.50
>> +// require_extensions: GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5
>> +// [end config]
>> +
>> +// Test that overloaded function selection still works in the presence
>> +// of new double variants. ARB_gpu_shader5 provides the overload
>> +// selection rules that allow the implementatino to pick one of the
> implementation
>
>> +// candidates.
>> +
>> +#version 150
>> +#extension GL_ARB_gpu_shader_fp64: enable
>> +#extension GL_ARB_gpu_shader5: enable
>> +
>> +void foo(double a);
>> +void foo(float a);
>> +
>> +void test() {
>> + mod(5, 6);
>> + foo(5);
>> +}
>>
>
> Which overload does the spec say is supposed to be used for foo(5)? We
> should provide an implementation for that overload, and make this a
> linker test.
The float one, I think. From ARB_gpu_shader5, see point #3:
To determine whether the conversion for a single argument in one match is
better than that for another match, the following rules are applied, in
order:
1. An exact match is better than a match involving any implicit
conversion.
2. A match involving an implicit conversion from float to double is
better than a match involving any other implicit conversion.
3. A match involving an implicit conversion from either int or uint to
float is better than a match involving an implicit conversion from
either int or uint to double.
More information about the Piglit
mailing list