diff options
author | Ilia Mirkin <[email protected]> | 2015-06-17 15:07:14 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-06-18 13:21:44 -0400 |
commit | c40e7ee7c47cb24264fd77ef37fab99dea4c299a (patch) | |
tree | e8cb50d3eedb2b010bd42eb3565e674131e19e83 /src/glsl | |
parent | 6b0378e483ba53359545ac8b774dbdd81c2fab3f (diff) |
glsl: handle conversions to double when comparing param matches
This allows mod(int, int) to become selected as float mod when doubles
are supported.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Cc: "10.6" <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ir_function.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsl/ir_function.cpp b/src/glsl/ir_function.cpp index 2b2643c64a2..13194439003 100644 --- a/src/glsl/ir_function.cpp +++ b/src/glsl/ir_function.cpp @@ -148,9 +148,11 @@ get_parameter_match_type(const ir_variable *param, if (from_type == to_type) return PARAMETER_EXACT_MATCH; - /* XXX: When ARB_gpu_shader_fp64 support is added, check for float->double, - * and int/uint->double conversions - */ + if (to_type->base_type == GLSL_TYPE_DOUBLE) { + if (from_type->base_type == GLSL_TYPE_FLOAT) + return PARAMETER_FLOAT_TO_DOUBLE; + return PARAMETER_INT_TO_DOUBLE; + } if (to_type->base_type == GLSL_TYPE_FLOAT) return PARAMETER_INT_TO_FLOAT; |