<div dir="ltr">Do we need to do something similar for specialization constants?<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 16, 2018 at 7:28 AM Karol Herbst <<a href="mailto:kherbst@redhat.com">kherbst@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Karol Herbst <<a href="mailto:kherbst@redhat.com" target="_blank">kherbst@redhat.com</a>><br>
---<br>
 src/compiler/spirv/vtn_alu.c | 10 ++++++++++<br>
 1 file changed, 10 insertions(+)<br>
<br>
diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c<br>
index 5db6c7f0a87..d6f149d12e9 100644<br>
--- a/src/compiler/spirv/vtn_alu.c<br>
+++ b/src/compiler/spirv/vtn_alu.c<br>
@@ -743,6 +743,16 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,<br>
          src[1] = tmp;<br>
       }<br>
<br>
+      switch (op) {<br>
+      case nir_op_ishl:<br>
+      case nir_op_ishr:<br>
+      case nir_op_ushr:<br>
+         src[1] = nir_u2u32(&b->nb, src[1]);<br>
+         break;<br>
+      default:<br>
+         break;<br>
+      }<br>
+<br>
       val->ssa->def = nir_build_alu(&b->nb, op, src[0], src[1], src[2], src[3]);<br>
       break;<br>
    } /* default */<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>