<div dir="ltr">LGTM<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 3, 2018 at 4:10 PM, Bas Nieuwenhuizen <span dir="ltr"><<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/compiler/nir/nir_opt_<wbr>undef.c | 8 ++++++--<br>
 1 file changed, 6 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_opt_<wbr>undef.c b/src/compiler/nir/nir_opt_<wbr>undef.c<br>
index 1439ca9c165..e42a9af2bdf 100644<br>
--- a/src/compiler/nir/nir_opt_<wbr>undef.c<br>
+++ b/src/compiler/nir/nir_opt_<wbr>undef.c<br>
@@ -107,20 +107,24 @@ opt_undef_vecN(nir_builder *b, nir_alu_instr *alu)<br>
 static bool<br>
 opt_undef_store(nir_intrinsic_<wbr>instr *intrin)<br>
 {<br>
+   int arg_index;<br>
    switch (intrin->intrinsic) {<br>
    case nir_intrinsic_store_deref:<br>
+      arg_index = 1;<br>
+      break;<br>
    case nir_intrinsic_store_var:<br>
    case nir_intrinsic_store_output:<br>
    case nir_intrinsic_store_per_<wbr>vertex_output:<br>
    case nir_intrinsic_store_ssbo:<br>
    case nir_intrinsic_store_shared:<br>
+      arg_index =  0;<br>
       break;<br>
    default:<br>
       return false;<br>
    }<br>
<br>
-   if (!intrin->src[0].is_ssa ||<br>
-       intrin->src[0].ssa->parent_<wbr>instr->type != nir_instr_type_ssa_undef)<br>
+   if (!intrin->src[arg_index].is_<wbr>ssa ||<br>
+       intrin->src[arg_index].ssa-><wbr>parent_instr->type != nir_instr_type_ssa_undef)<br>
       return false;<br>
<br>
    nir_instr_remove(&intrin-><wbr>instr);<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<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>