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 <apinheiro@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Jason Ekstrand
2018-11-28 17:27:00 -06:00
committed by Jason Ekstrand
parent d8e3edb784
commit 78d80f7db2

View File

@@ -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) {