<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 16, 2016 at 6:48 AM, Juan A. Suarez Romero <span dir="ltr"><<a href="mailto:jasuarez@igalia.com" target="_blank">jasuarez@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
<br>
Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
---<br>
 src/compiler/spirv/spirv_to_<wbr>nir.c | 12 +++++++++---<br>
 1 file changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 3fa1d8e..5303a94 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -1032,6 +1032,8 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
       case GLSL_TYPE_INT:<br>
       case GLSL_TYPE_FLOAT:<br>
       case GLSL_TYPE_BOOL:<br>
+      case GLSL_TYPE_DOUBLE: {<br>
+         int bit_size = glsl_get_bit_size(val->const_<wbr>type);<br>
          if (glsl_type_is_matrix(val-><wbr>const_type)) {<br>
             assert(glsl_get_matrix_<wbr>columns(val->const_type) == elem_count);<br>
             for (unsigned i = 0; i < elem_count; i++)<br>
@@ -1039,12 +1041,16 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp opcode,<br>
          } else {<br>
             assert(glsl_type_is_vector(<wbr>val->const_type));<br>
             assert(glsl_get_vector_<wbr>elements(val->const_type) == elem_count);<br>
-            for (unsigned i = 0; i < elem_count; i++)<br>
-               val->constant->values[0].u32[<wbr>i] = elems[i]->values[0].u32[0];<br>
+            for (unsigned i = 0; i < elem_count; i++) {<br>
+               if (bit_size == 64)<br>
+                   val->constant->values[0].u64[<wbr>i] = elems[i]->values[0].u64[0];<br>
+               else<br></blockquote><div><br></div><div>Please add braces and assert(bit_size == 32)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                  val->constant->values[0].u32[<wbr>i] = elems[i]->values[0].u32[0];<br>
+            }<br>
          }<br>
          ralloc_free(elems);<br>
          break;<br>
-<br>
+      }<br>
       case GLSL_TYPE_STRUCT:<br>
       case GLSL_TYPE_ARRAY:<br>
          ralloc_steal(val->constant, elems);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>