nir: Use nir_builder in nir_lower_io's get_io_offset().
[mesa.git] / src / glsl / nir / nir_lower_tex_projector.c
index 6e2cc803fb8a0f46585439615211a939e3be1674..357131cd7280c609229a3a4280b40aeeb187966f 100644 (file)
@@ -111,9 +111,10 @@ nir_lower_tex_projector_block(nir_block *block, void *void_state)
        */
       nir_instr_rewrite_src(&tex->instr, &tex->src[proj_index].src,
                             NIR_SRC_INIT);
-      memmove(&tex->src[proj_index],
-              &tex->src[proj_index + 1],
-              (tex->num_srcs - proj_index) * sizeof(*tex->src));
+      for (int i = proj_index + 1; i < tex->num_srcs; i++) {
+         tex->src[i-1].src_type = tex->src[i].src_type;
+         nir_instr_move_src(&tex->instr, &tex->src[i-1].src, &tex->src[i].src);
+      }
       tex->num_srcs--;
    }