From: Jason Ekstrand Date: Wed, 28 Nov 2018 23:27:00 +0000 (-0600) Subject: nir/deref: Skip over casts in fixup_deref_modes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78d80f7db2fab78b1af96d5acf216d71448d7972;p=mesa.git nir/deref: Skip over casts in fixup_deref_modes This pass is used when, for instance, we lazily change the mode of variables rather than replacing the variable with a new one. Since we only do this in cases where we know we have full deref chains, it's ok to just skip them in fixup_deref_modes. Reviewed-by: Alejandro PiƱeiro Reviewed-by: Caio Marcelo de Oliveira Filho --- diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index edd602a8f4a..a2d46208dd2 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -272,6 +272,8 @@ nir_fixup_deref_modes(nir_shader *shader) continue; nir_deref_instr *deref = nir_instr_as_deref(instr); + if (deref->deref_type == nir_deref_type_cast) + continue; nir_variable_mode parent_mode; if (deref->deref_type == nir_deref_type_var) {