pan/compiler: Fix handling of nir_intrinsic_scoped_barrier

Only emit anything if this is a control barrier, i.e. contains an
execution scope.  Also change the assertion to look at that scope
instead of the memory scope.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
This commit is contained in:
Caio Oliveira 2023-02-26 21:40:16 -08:00 committed by Marge Bot
parent c80268a20d
commit 64a0266260

View file

@ -1655,11 +1655,15 @@ bi_emit_intrinsic(bi_builder *b, nir_intrinsic_instr *instr)
break;
case nir_intrinsic_scoped_barrier:
assert(b->shader->stage != MESA_SHADER_FRAGMENT);
assert(nir_intrinsic_memory_scope(instr) > NIR_SCOPE_SUBGROUP &&
"todo: subgroup barriers (different divergence rules)");
bi_barrier(b);
if (nir_intrinsic_execution_scope(instr) != NIR_SCOPE_NONE) {
assert(b->shader->stage != MESA_SHADER_FRAGMENT);
assert(nir_intrinsic_execution_scope(instr) > NIR_SCOPE_SUBGROUP &&
"todo: subgroup barriers (different divergence rules)");
bi_barrier(b);
}
/* Blob doesn't seem to do anything for memory barriers, so no need to
* check nir_intrinsic_memory_scope().
*/
break;
case nir_intrinsic_shared_atomic_add: