nir/lower_tex: copy missing fields when creating copy of tex instruction
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Jun 2023 08:27:57 +0000 (10:27 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 19 Jun 2023 08:13:06 +0000 (08:13 +0000)
This is missing both texture and sampler indices.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23616>

src/compiler/nir/nir_lower_tex.c

index efe530f..8c523ba 100644 (file)
@@ -1127,6 +1127,8 @@ lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex)
       tex_copy->is_gather_implicit_lod = tex->is_gather_implicit_lod;
       tex_copy->component = tex->component;
       tex_copy->dest_type = tex->dest_type;
+      tex_copy->texture_index = tex->texture_index;
+      tex_copy->sampler_index = tex->sampler_index;
 
       for (unsigned j = 0; j < tex->num_srcs; ++j) {
          nir_src_copy(&tex_copy->src[j].src, &tex->src[j].src, &tex_copy->instr);