ac/nir: fix CDNA image lowering for array textures
authorGanesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Mon, 27 Feb 2023 10:30:33 +0000 (04:30 -0600)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 15:00:53 +0000 (15:00 +0000)
The x,y coordinates were not added.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>

src/amd/common/ac_nir_lower_image_opcodes_cdna.c

index b29b3e8..4428636 100644 (file)
@@ -94,7 +94,7 @@ static nir_ssa_def *lower_image_coords(nir_builder *b, nir_ssa_def *desc, nir_ss
    }
    if (z) {
       nir_ssa_def *slice_elements = nir_channel(b, desc, 7);
-      index = nir_imul(b, slice_elements, z);
+      index = nir_iadd(b, index, nir_imul(b, slice_elements, z));
    }
 
    /* Determine whether the coordinates are out of bounds. */