OSDN Git Service

glsl: Add support for comparing function parameter conversions
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 4 May 2014 08:24:00 +0000 (20:24 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 4 Jun 2014 08:03:08 +0000 (20:03 +1200)
commitc1ceadfc32eb2b40364995fc6c558b9c53850b1c
tree28040398f7c8ddfebfcef5c0ea825346e3542010
parent59dd444cacffbee73a4e7ff9ccc5a6d25280dc0e
glsl: Add support for comparing function parameter conversions

The ARB_gpu_shader5 spec says:

"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.

If none of the rules above apply to a particular pair of conversions,
neither conversion is considered better than the other."

V3: Add spec citation, including oddball difference between gs5 and GLSL
4.0; comment a bit better as per Jordan's suggestions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/ir_function.cpp