From 05f36fd97b7187ae2e8336433ec02d340ef20855 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 12 Sep 2022 22:04:16 +0200 Subject: [PATCH] [dxbc] Only use workgroup scope in compute shaders Turns out that global barriers can be used in graphics shaders. --- src/dxbc/dxbc_compiler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 9d6eaa372..53afe3451 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -2593,7 +2593,11 @@ namespace dxvk { } if (flags.test(DxbcSyncFlag::UavMemoryGlobal)) { - memoryScope = m_hasGloballyCoherentUav ? spv::ScopeQueueFamily : spv::ScopeWorkgroup; + memoryScope = spv::ScopeQueueFamily; + + if (m_programInfo.type() == DxbcProgramType::ComputeShader && !m_hasGloballyCoherentUav) + memoryScope = spv::ScopeWorkgroup; + memorySemantics |= spv::MemorySemanticsImageMemoryMask | spv::MemorySemanticsUniformMemoryMask | spv::MemorySemanticsAcquireReleaseMask