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>
This commit is contained in:
Jason Ekstrand 2020-11-01 16:55:25 -06:00 committed by Marge Bot
parent 3cc58e6470
commit 9ae87a6c31

View file

@ -85,7 +85,11 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
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 */