diff options
author | Connor Abbott <[email protected]> | 2015-08-14 11:58:07 -0700 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-11-19 09:16:18 +0100 |
commit | 84ed3819a42042757a32cae4260c26c4fb3b673c (patch) | |
tree | abfbc9957e5e7c7f8bf603936ff6bc4a12517e4b /src/glsl/builtin_functions.cpp | |
parent | 7820b2c071ec974d824c9b6dc3a0dd0ad1b77444 (diff) |
glsl: fix isinf() for doubles
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r-- | src/glsl/builtin_functions.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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)))); |