mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
nir/dead_write_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 clear_unused_for_modes for derefs that don't have an accessible variable. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
fa40a58fd9
commit
5dad1abfdc
1 changed files with 1 additions and 2 deletions
|
|
@ -56,8 +56,7 @@ static void
|
|||
clear_unused_for_modes(struct util_dynarray *unused_writes, nir_variable_mode modes)
|
||||
{
|
||||
util_dynarray_foreach_reverse(unused_writes, struct write_entry, entry) {
|
||||
nir_variable *var = nir_deref_instr_get_variable(entry->dst);
|
||||
if (var->data.mode & modes)
|
||||
if (entry->dst->mode & modes)
|
||||
*entry = util_dynarray_pop(unused_writes, struct write_entry);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue