mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
pan/bi: handle barriers with SUBGROUP scope
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32710>
This commit is contained in:
parent
f77a50e45e
commit
d2838f3ceb
1 changed files with 28 additions and 7 deletions
|
|
@ -1853,15 +1853,36 @@ bi_emit_intrinsic(bi_builder *b, nir_intrinsic_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_intrinsic_barrier:
|
||||
if (nir_intrinsic_execution_scope(instr) != SCOPE_NONE) {
|
||||
assert(b->shader->stage != MESA_SHADER_FRAGMENT);
|
||||
assert(nir_intrinsic_execution_scope(instr) > SCOPE_SUBGROUP &&
|
||||
"todo: subgroup barriers (different divergence rules)");
|
||||
switch (nir_intrinsic_execution_scope(instr)) {
|
||||
case SCOPE_NONE:
|
||||
/*
|
||||
* No execution barrier, and we don't have to do anything for memory
|
||||
* barriers (see SCOPE_WORKGROUP case.)
|
||||
*/
|
||||
break;
|
||||
|
||||
case SCOPE_SUBGROUP:
|
||||
/*
|
||||
* To implement a subgroup barrier, we only need to prevent the
|
||||
* scheduler from reordering memory operations around the barrier.
|
||||
* Avail and vis are trivially established.
|
||||
*/
|
||||
bi_memory_barrier(b);
|
||||
break;
|
||||
|
||||
case SCOPE_WORKGROUP:
|
||||
assert(b->shader->stage == MESA_SHADER_COMPUTE);
|
||||
bi_barrier(b);
|
||||
/*
|
||||
* Blob doesn't seem to do anything for memory barriers, so no need to
|
||||
* check nir_intrinsic_memory_scope().
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
unreachable("Unsupported barrier scope");
|
||||
}
|
||||
/* 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: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue