glsl: fix isinf() for doubles
authorConnor Abbott <connor.w.abbott@intel.com>
Fri, 14 Aug 2015 18:58:07 +0000 (11:58 -0700)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 19 Nov 2015 08:16:18 +0000 (09:16 +0100)
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/glsl/builtin_functions.cpp

index eb438d9fd450e592d1d7be09d4e9dbac4321f4f1..1824b831f2861f055da056a6115a542160966434 100644 (file)
@@ -3573,7 +3573,16 @@ builtin_builder::_isinf(builtin_available_predicate avail, const glsl_type *type
 
    ir_constant_data infinities;
    for (int i = 0; i < type->vector_elements; i++) {
-      infinities.f[i] = INFINITY;
+      switch (type->base_type) {
+      case GLSL_TYPE_FLOAT:
+         infinities.f[i] = INFINITY;
+         break;
+      case GLSL_TYPE_DOUBLE:
+         infinities.d[i] = INFINITY;
+         break;
+      default:
+         unreachable("unknown type");
+      }
    }
 
    body.emit(ret(equal(abs(x), imm(type, infinities))));