Module: Mesa
Branch: staging/19.2
Commit: 109137ee7bc2d6e197d03f03dfebdf9a7748a137
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=109137ee7bc2d6e197d03f03dfebdf9a7748a137

Author: Erik Faye-Lund <[email protected]>
Date:   Tue Sep 24 16:57:03 2019 +0200

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 <[email protected]>
Fixes: 85faf5082f ("glsl: Add 64-bit integer support for constant expressions")
Reviewed-by: Eric Engestrom <[email protected]>
(cherry picked from commit 88f909eb37dc3867f9d2fcd44ccee6dceaac071c)

---

 src/compiler/glsl/ir_constant_expression.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/ir_constant_expression.cpp 
b/src/compiler/glsl/ir_constant_expression.cpp
index e5893103ed2..1605e571758 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));

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to