nir/deref: Skip over casts in fixup_deref_modes
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 28 Nov 2018 23:27:00 +0000 (17:27 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
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>
src/compiler/nir/nir_deref.c

index edd602a8f4a9a280c9dd923706d921dadf2a0b70..a2d46208dd218260a5cbe1435d9d6713512ebaa6 100644 (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) {