Module: Mesa
Branch: main
Commit: 0ec352216331976763e0ce425ba9a18536f53b54
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ec352216331976763e0ce425ba9a18536f53b54

Author: Sagar Ghuge <[email protected]>
Date:   Wed Feb  1 15:44:48 2023 -0800

nir: Handle other variants of image_samples properly while lowering

while lowering image_samples to one, we need to take
nir_intrinsic_image_deref_samples and
nir_intrinsic_bindless_image_samples intrinsic into account.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8211

Fixes: ab4c2990ed4 ("intel/compiler: use lower_image_samples_to_one")
Signed-off-by: Sagar Ghuge <[email protected]>
Reviewed-by: Faith Ekstrand <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21053>

---

 src/compiler/nir/nir_lower_image.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_image.c 
b/src/compiler/nir/nir_lower_image.c
index 4b9c3554674..7b0fc17db17 100644
--- a/src/compiler/nir/nir_lower_image.c
+++ b/src/compiler/nir/nir_lower_image.c
@@ -182,7 +182,9 @@ lower_image_instr(nir_builder *b, nir_instr *instr, void 
*state)
       }
       return false;
 
-   case nir_intrinsic_image_samples: {
+   case nir_intrinsic_image_samples:
+   case nir_intrinsic_image_deref_samples:
+   case nir_intrinsic_bindless_image_samples: {
       if (options->lower_image_samples_to_one) {
          b->cursor = nir_after_instr(&intrin->instr);
          nir_ssa_def *samples = nir_imm_intN_t(b, 1, 
nir_dest_bit_size(intrin->dest));

Reply via email to