diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2019-09-24 16:57:03 +0200 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2019-10-02 09:41:27 -0400 |
commit | 3a0b77e3f7837ba3e0dd9876ab9bb4edb95c0ce6 (patch) | |
tree | cf1e76720bcc4de0341606105f10cbe68d93e380 | |
parent | ef35babd339bff94937cc6fbee433e005fde34e3 (diff) | |
download | mesa-3a0b77e3f7837ba3e0dd9876ab9bb4edb95c0ce6.tar.gz |
glsl: correct bitcast-helpers
Without this, we'll incorrectly round off huge values to the nearest
representable double instead of keeping it at the exact value as
we're supposed to.
Found by inspecting compiler-warnings.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 85faf5082f ("glsl: Add 64-bit integer support for constant expressions")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 88f909eb37dc3867f9d2fcd44ccee6dceaac071c)
-rw-r--r-- | src/compiler/glsl/ir_constant_expression.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp index cb8558eb00d..c1439737ece 100644 --- a/src/compiler/glsl/ir_constant_expression.cpp +++ b/src/compiler/glsl/ir_constant_expression.cpp @@ -106,7 +106,7 @@ bitcast_i642d(int64_t i) return d; } -static double +static uint64_t bitcast_d2u64(double d) { assert(sizeof(double) == sizeof(uint64_t)); @@ -115,7 +115,7 @@ bitcast_d2u64(double d) return u; } -static double +static int64_t bitcast_d2i64(double d) { assert(sizeof(double) == sizeof(int64_t)); |