From: Connor Abbott Date: Fri, 14 Aug 2015 18:58:07 +0000 (-0700) Subject: glsl: fix isinf() for doubles X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84ed3819a42042757a32cae4260c26c4fb3b673c;p=mesa.git glsl: fix isinf() for doubles Reviewed-by: Timothy Arceri Reviewed-by: Edward O'Callaghan --- diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index eb438d9fd45..1824b831f28 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cpp @@ -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))));