glsl: handle conversions to double when comparing param matches
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 17 Jun 2015 19:07:14 +0000 (15:07 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 18 Jun 2015 17:21:44 +0000 (13:21 -0400)
This allows mod(int, int) to become selected as float mod when doubles
are supported.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
src/glsl/ir_function.cpp

index 2b2643c64a2c0b4718c13cebb4669b14b0c96a90..13194439003153f9441a845578a76bd821fb528c 100644 (file)
@@ -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;