Merge commit mesa-public/master into vulkan
[mesa.git] / src / compiler / nir / nir_algebraic.py
index a30652f2afdb8d16309614c7437fe8514c7e07be..14c0e822ad819eb3d173209eecaf0457afa3c3d3 100644 (file)
@@ -108,7 +108,7 @@ class Constant(Value):
       if isinstance(self.value, (bool)):
          return 'NIR_TRUE' if self.value else 'NIR_FALSE'
       if isinstance(self.value, (int, long)):
-         return hex(struct.unpack('I', struct.pack('i', self.value))[0])
+         return hex(struct.unpack('I', struct.pack('i' if self.value < 0 else 'I', self.value))[0])
       elif isinstance(self.value, float):
          return hex(struct.unpack('I', struct.pack('f', self.value))[0])
       else: