mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
microsoft/compiler: Don't emit threadgroup barriers for graphics shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
This commit is contained in:
parent
e07e9a08cb
commit
1ef9ba9166
1 changed files with 4 additions and 2 deletions
|
|
@ -2740,14 +2740,16 @@ emit_barrier_impl(struct ntd_context *ctx, nir_variable_mode modes, nir_scope ex
|
|||
if (execution_scope == NIR_SCOPE_WORKGROUP)
|
||||
flags |= DXIL_BARRIER_MODE_SYNC_THREAD_GROUP;
|
||||
|
||||
bool is_compute = ctx->mod.shader_kind == DXIL_COMPUTE_SHADER;
|
||||
|
||||
if (modes & (nir_var_mem_ssbo | nir_var_mem_global | nir_var_image)) {
|
||||
if (mem_scope > NIR_SCOPE_WORKGROUP)
|
||||
if (mem_scope > NIR_SCOPE_WORKGROUP || !is_compute)
|
||||
flags |= DXIL_BARRIER_MODE_UAV_FENCE_GLOBAL;
|
||||
else
|
||||
flags |= DXIL_BARRIER_MODE_UAV_FENCE_THREAD_GROUP;
|
||||
}
|
||||
|
||||
if (modes & nir_var_mem_shared)
|
||||
if ((modes & nir_var_mem_shared) && is_compute)
|
||||
flags |= DXIL_BARRIER_MODE_GROUPSHARED_MEM_FENCE;
|
||||
|
||||
func = dxil_get_function(&ctx->mod, "dx.op.barrier", DXIL_NONE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue