Mesa (main): nir/lower_image: Handle index and bindless image_size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 22 19:56:49 UTC 2021


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Jul 22 00:17:33 2021 -0500

nir/lower_image: Handle index and bindless image_size

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12005>

---

 src/compiler/nir/nir_lower_image.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/compiler/nir/nir_lower_image.c b/src/compiler/nir/nir_lower_image.c
index 529804d8e61..2a53c1972b5 100644
--- a/src/compiler/nir/nir_lower_image.c
+++ b/src/compiler/nir/nir_lower_image.c
@@ -70,14 +70,20 @@ lower_image_instr(nir_builder *b, nir_instr *instr, void *state)
    const nir_lower_image_options *options = state;
    nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
 
-   if (options->lower_cube_size &&
-       intrin->intrinsic == nir_intrinsic_image_deref_size &&
-       nir_intrinsic_image_dim(intrin) == GLSL_SAMPLER_DIM_CUBE) {
-      lower_cube_size(b, intrin);
-      return true;
-   }
+   switch (intrin->intrinsic) {
+   case nir_intrinsic_image_size:
+   case nir_intrinsic_image_deref_size:
+   case nir_intrinsic_bindless_image_size:
+      if (options->lower_cube_size &&
+          nir_intrinsic_image_dim(intrin) == GLSL_SAMPLER_DIM_CUBE) {
+         lower_cube_size(b, intrin);
+         return true;
+      }
+      return false;
 
-   return false;
+   default:
+      return false;
+   }
 }
 
 bool



More information about the mesa-commit mailing list