nir: Replace the scoped_memory barrier by a scoped_barrier

SPIRV OpControlBarrier can have both a memory and a control barrier
which some hardware can handle with a single instruction. Let's
turn the scoped_memory_barrier into a scoped barrier which can embed
both barrier types. Note that control-only or memory-only barriers can
be supported through this new intrinsic by passing NIR_SCOPE_NONE to the
unused barrier type.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4900>
This commit is contained in:
Boris Brezillon
2020-05-05 09:13:20 +02:00
committed by Marge Bot
parent 94438a64bf
commit 345b5847b4
14 changed files with 61 additions and 36 deletions

View File

@@ -134,7 +134,7 @@ gather_intrinsic(struct access_state *state, nir_intrinsic_instr *instr)
state->image_barriers = true;
break;
case nir_intrinsic_scoped_memory_barrier:
case nir_intrinsic_scoped_barrier:
/* TODO: Could be more granular if we had nir_var_mem_image. */
if (nir_intrinsic_memory_modes(instr) & (nir_var_mem_ubo |
nir_var_mem_ssbo |