mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 02:40:11 +01:00
nir/copy_prop_vars: Get modes directly from derefs
Instead of going all the way back to the variable, just look at the deref. The modes are guaranteed to be the same by nir_validate whenever the variable can be found. This fixes apply_barrier_for_modes for derefs that don't have an accessible variable. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
cf7fb39805
commit
fa40a58fd9
1 changed files with 2 additions and 6 deletions
|
|
@ -337,12 +337,8 @@ apply_barrier_for_modes(struct util_dynarray *copies,
|
||||||
nir_variable_mode modes)
|
nir_variable_mode modes)
|
||||||
{
|
{
|
||||||
util_dynarray_foreach_reverse(copies, struct copy_entry, iter) {
|
util_dynarray_foreach_reverse(copies, struct copy_entry, iter) {
|
||||||
nir_variable *dst_var = nir_deref_instr_get_variable(iter->dst);
|
if ((iter->dst->mode & modes) ||
|
||||||
nir_variable *src_var = iter->src.is_ssa ? NULL :
|
(!iter->src.is_ssa && (iter->src.deref->mode & modes)))
|
||||||
nir_deref_instr_get_variable(iter->src.deref);
|
|
||||||
|
|
||||||
if ((dst_var->data.mode & modes) ||
|
|
||||||
(src_var && (src_var->data.mode & modes)))
|
|
||||||
copy_entry_remove(copies, iter);
|
copy_entry_remove(copies, iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue