nir/lower_array_deref_of_vec: Use nir_deref_mode_must_be

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
diff --git a/src/compiler/nir/nir_lower_array_deref_of_vec.c b/src/compiler/nir/nir_lower_array_deref_of_vec.c
index 99ed9ea..12a376d 100644
--- a/src/compiler/nir/nir_lower_array_deref_of_vec.c
+++ b/src/compiler/nir/nir_lower_array_deref_of_vec.c
@@ -85,7 +85,11 @@
             continue;
 
          nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
-         if (!(deref->mode & modes))
+
+         /* We choose to be conservative here.  If the deref contains any
+          * modes which weren't specified, we bail and don't bother lowering.
+          */
+         if (!nir_deref_mode_must_be(deref, modes))
             continue;
 
          /* We only care about array derefs that act on vectors */