Module: Mesa
Branch: master
Commit: f1ba0a5ea0faf331be9fa28fd6d43a3ff061b735
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1ba0a5ea0faf331be9fa28fd6d43a3ff061b735

Author: Connor Abbott <[email protected]>
Date:   Fri Aug 14 11:58:45 2015 -0700

glsl: fix ir_constant::equals() for doubles

Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>

---

 src/glsl/ir_equals.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir_equals.cpp b/src/glsl/ir_equals.cpp
index 5f0785e..aafcd1f 100644
--- a/src/glsl/ir_equals.cpp
+++ b/src/glsl/ir_equals.cpp
@@ -58,8 +58,13 @@ ir_constant::equals(const ir_instruction *ir, enum 
ir_node_type) const
       return false;
 
    for (unsigned i = 0; i < type->components(); i++) {
-      if (value.u[i] != other->value.u[i])
-         return false;
+      if (type->base_type == GLSL_TYPE_DOUBLE) {
+         if (value.d[i] != other->value.d[i])
+            return false;
+      } else {
+         if (value.u[i] != other->value.u[i])
+            return false;
+      }
    }
 
    return true;

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

Reply via email to