<div dir="ltr"><div>I'd probably go with u2u32 so we don't get sign-extension.  Other than that,<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 28, 2017 at 11:42 PM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently we support 32-bit indexes/offsets all over the driver, so we<br>
convert them to that bit size.<br>
<br>
Fixes dEQP-VK.spirv_assembly.<wbr>instruction.*.indexing.*<br>
<br>
Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
---<br>
 src/compiler/spirv/vtn_<wbr>variables.c | 11 ++++++++---<br>
 1 file changed, 8 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/vtn_<wbr>variables.c b/src/compiler/spirv/vtn_<wbr>variables.c<br>
index 4432e72e54..4f6acd2e07 100644<br>
--- a/src/compiler/spirv/vtn_<wbr>variables.c<br>
+++ b/src/compiler/spirv/vtn_<wbr>variables.c<br>
@@ -102,10 +102,15 @@ vtn_access_link_as_ssa(struct vtn_builder *b, struct vtn_access_link link,<br>
    if (link.mode == vtn_access_mode_literal) {<br>
       return nir_imm_int(&b->nb, <a href="http://link.id" rel="noreferrer" target="_blank">link.id</a> * stride);<br>
    } else if (stride == 1) {<br>
-      return vtn_ssa_value(b, <a href="http://link.id" rel="noreferrer" target="_blank">link.id</a>)->def;<br>
+       nir_ssa_def *ssa = vtn_ssa_value(b, <a href="http://link.id" rel="noreferrer" target="_blank">link.id</a>)->def;<br>
+       if (ssa->bit_size != 32)<br>
+          ssa = nir_i2i32(&b->nb, ssa);<br>
+      return ssa;<br>
    } else {<br>
-      return nir_imul(&b->nb, vtn_ssa_value(b, <a href="http://link.id" rel="noreferrer" target="_blank">link.id</a>)->def,<br>
-                              nir_imm_int(&b->nb, stride));<br>
+      nir_ssa_def *src0 = vtn_ssa_value(b, <a href="http://link.id" rel="noreferrer" target="_blank">link.id</a>)->def;<br>
+      if (src0->bit_size != 32)<br>
+         src0 = nir_i2i32(&b->nb, src0);<br>
+      return nir_imul(&b->nb, src0, nir_imm_int(&b->nb, stride));<br>
    }<br>
 }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.14.1<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>