mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
aco: Assert that workgroup barriers are not used inappropriately.
Example: It is possible for some NGG GS waves to have 0 ES and/or GS invocations, and in that case having an s_barrier inside divergent control flow can very possibly hang the GPU. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>
This commit is contained in:
parent
915f2919f6
commit
9757c3cb6b
1 changed files with 5 additions and 0 deletions
|
|
@ -6559,6 +6559,11 @@ void emit_scoped_barrier(isel_context *ctx, nir_intrinsic_instr *instr) {
|
|||
|
||||
assert(!(nir_semantics & (NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_MAKE_VISIBLE)));
|
||||
|
||||
/* Workgroup barriers can hang merged shaders that can potentially have 0 threads in either half. */
|
||||
assert(exec_scope != scope_workgroup ||
|
||||
ctx->shader->info.stage == MESA_SHADER_COMPUTE ||
|
||||
ctx->shader->info.stage == MESA_SHADER_TESS_CTRL);
|
||||
|
||||
bld.barrier(aco_opcode::p_barrier,
|
||||
memory_sync_info((storage_class)storage, (memory_semantics)semantics, mem_scope),
|
||||
exec_scope);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue