glsl: fix ir_constant::equals() for doubles
authorConnor Abbott <connor.w.abbott@intel.com>
Fri, 14 Aug 2015 18:58:45 +0000 (11:58 -0700)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 19 Nov 2015 08:16:18 +0000 (09:16 +0100)
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/glsl/ir_equals.cpp

index 5f0785e0eceff5e7c1d02b28179b210b9500833c..aafcd1f0dae8e721a745f3f7f225c8458ae085d5 100644 (file)
@@ -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;