mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-27 11:00:37 +02:00
nir/lower_memory_model: remove empty lowered barriers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36080>
This commit is contained in:
parent
0512ba8743
commit
d4b329219e
1 changed files with 7 additions and 2 deletions
|
|
@ -112,6 +112,11 @@ visit_instr(nir_instr *instr, uint32_t *cur_modes, unsigned vis_avail_sem)
|
|||
unsigned semantics = nir_intrinsic_memory_semantics(intrin);
|
||||
nir_intrinsic_set_memory_semantics(
|
||||
intrin, semantics & ~vis_avail_sem);
|
||||
|
||||
if (nir_intrinsic_memory_semantics(intrin) == 0 &&
|
||||
nir_intrinsic_execution_scope(intrin) <= SCOPE_INVOCATION)
|
||||
nir_instr_remove(instr);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +156,7 @@ lower_make_visible(nir_cf_node *cf_node, uint32_t *cur_modes)
|
|||
switch (cf_node->type) {
|
||||
case nir_cf_node_block: {
|
||||
nir_block *block = nir_cf_node_as_block(cf_node);
|
||||
nir_foreach_instr(instr, block)
|
||||
nir_foreach_instr_safe(instr, block)
|
||||
progress |= visit_instr(instr, cur_modes, NIR_MEMORY_MAKE_VISIBLE);
|
||||
break;
|
||||
}
|
||||
|
|
@ -191,7 +196,7 @@ lower_make_available(nir_cf_node *cf_node, uint32_t *cur_modes)
|
|||
switch (cf_node->type) {
|
||||
case nir_cf_node_block: {
|
||||
nir_block *block = nir_cf_node_as_block(cf_node);
|
||||
nir_foreach_instr_reverse(instr, block)
|
||||
nir_foreach_instr_reverse_safe(instr, block)
|
||||
progress |= visit_instr(instr, cur_modes, NIR_MEMORY_MAKE_AVAILABLE);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue