diff --git a/src/d3d11/d3d11_context_ext.cpp b/src/d3d11/d3d11_context_ext.cpp index e8c81e1dc..aac32b887 100644 --- a/src/d3d11/d3d11_context_ext.cpp +++ b/src/d3d11/d3d11_context_ext.cpp @@ -147,10 +147,7 @@ namespace dxvk { DxvkBarrierControlFlags flags = parent->GetOptionsBarrierControlFlags(); if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE) - flags.set(DxvkBarrierControl::IgnoreWriteAfterWrite); - - if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV) - flags.set(DxvkBarrierControl::IgnoreGraphicsBarriers); + flags.set(DxvkBarrierControl::IgnoreComputeWriteAfterWrite, DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite); m_ctx->EmitCs([cFlags = flags] (DxvkContext* ctx) { ctx->setBarrierControl(cFlags); diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index 48356f8b4..27d1900a4 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -475,10 +475,10 @@ namespace dxvk { DxvkBarrierControlFlags barrierControl; if (m_d3d11Options.relaxedBarriers) - barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite); + barrierControl.set(DxvkBarrierControl::IgnoreComputeWriteAfterWrite); - if (m_d3d11Options.ignoreGraphicsBarriers) - barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers); + if (m_d3d11Options.relaxedBarriers || m_d3d11Options.relaxedGraphicsBarriers) + barrierControl.set(DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite); return barrierControl; } diff --git a/src/d3d11/d3d11_interfaces.h b/src/d3d11/d3d11_interfaces.h index c2288bd04..7c6b3a479 100644 --- a/src/d3d11/d3d11_interfaces.h +++ b/src/d3d11/d3d11_interfaces.h @@ -24,7 +24,9 @@ enum D3D11_VK_EXTENSION : uint32_t { */ enum D3D11_VK_BARRIER_CONTROL : uint32_t { D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE = 1 << 0, - D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 1 << 1, + + // Removed: + // D3D11_VK_BARRIER_CONTROL_IGNORE_GRAPHICS_UAV = 1 << 1, }; diff --git a/src/d3d11/d3d11_options.cpp b/src/d3d11/d3d11_options.cpp index da8e2ca55..6b0705c14 100644 --- a/src/d3d11/d3d11_options.cpp +++ b/src/d3d11/d3d11_options.cpp @@ -17,7 +17,7 @@ namespace dxvk { this->zeroInitWorkgroupMemory = config.getOption("d3d11.zeroInitWorkgroupMemory", false); this->forceVolatileTgsmAccess = config.getOption("d3d11.forceVolatileTgsmAccess", false); this->relaxedBarriers = config.getOption("d3d11.relaxedBarriers", false); - this->ignoreGraphicsBarriers = config.getOption("d3d11.ignoreGraphicsBarriers", false); + this->relaxedGraphicsBarriers = config.getOption("d3d11.relaxedGraphicsBarriers", false); this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); this->samplerLodBias = config.getOption("d3d11.samplerLodBias", 0.0f); @@ -61,4 +61,4 @@ namespace dxvk { this->shaderDumpPath = env::getEnvVar("DXVK_SHADER_DUMP_PATH"); } -} \ No newline at end of file +} diff --git a/src/d3d11/d3d11_options.h b/src/d3d11/d3d11_options.h index f41979d56..b1fe1e7af 100644 --- a/src/d3d11/d3d11_options.h +++ b/src/d3d11/d3d11_options.h @@ -43,7 +43,7 @@ namespace dxvk { /// /// May improve performance in some games, /// but might also cause rendering issues. - bool ignoreGraphicsBarriers = false; + bool relaxedGraphicsBarriers = false; /// Maximum tessellation factor. /// @@ -114,4 +114,4 @@ namespace dxvk { std::string shaderDumpPath; }; -} \ No newline at end of file +} diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index ae353c996..f2d1d6e3c 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -6817,9 +6817,6 @@ namespace dxvk { template bool DxvkContext::checkGraphicsHazards() { - if (m_barrierControl.test(DxvkBarrierControl::IgnoreGraphicsBarriers)) - return false; - // Check shader resources on every draw to handle WAW hazards, and to make // sure that writes are handled properly. If the pipeline does not have any // storage descriptors, we only need to check dirty resources. diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 5e5dc5a2b..ace683ebf 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -1786,7 +1786,11 @@ namespace dxvk { template bool canIgnoreWawHazards() { - if (!m_barrierControl.test(DxvkBarrierControl::IgnoreWriteAfterWrite)) + constexpr auto controlFlag = BindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS + ? DxvkBarrierControl::IgnoreGraphicsWriteAfterWrite + : DxvkBarrierControl::IgnoreComputeWriteAfterWrite; + + if (!m_barrierControl.test(controlFlag)) return false; if (BindPoint == VK_PIPELINE_BIND_POINT_COMPUTE) { diff --git a/src/dxvk/dxvk_context_state.h b/src/dxvk/dxvk_context_state.h index 6e565e6a1..ba39e14fa 100644 --- a/src/dxvk/dxvk_context_state.h +++ b/src/dxvk/dxvk_context_state.h @@ -86,8 +86,8 @@ namespace dxvk { * synchronize implicitly. */ enum class DxvkBarrierControl : uint32_t { - IgnoreWriteAfterWrite = 1, - IgnoreGraphicsBarriers = 2, + IgnoreComputeWriteAfterWrite = 0, + IgnoreGraphicsWriteAfterWrite = 1, }; using DxvkBarrierControlFlags = Flags; diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index 45e3f8c8d..9a65d478c 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -291,12 +291,11 @@ namespace dxvk { /* Final Fantasy XV: VXAO does thousands of * * draw calls with the same UAV bound */ { R"(\\ffxv_s\.exe$)", {{ - { "d3d11.ignoreGraphicsBarriers", "True" }, + { "d3d11.relaxedGraphicsBarriers", "True" }, }} }, /* God of War - relies on NVAPI/AMDAGS for * * barrier stuff, needs nvapi for DLSS */ { R"(\\GoW\.exe$)", {{ - { "d3d11.ignoreGraphicsBarriers", "True" }, { "d3d11.relaxedBarriers", "True" }, { "dxgi.hideNvidiaGpu", "False" }, { "dxgi.maxFrameLatency", "1" }, @@ -334,7 +333,7 @@ namespace dxvk { * presumably for culling, which doesn't play * * nicely with D3D11 without vendor libraries */ { R"(\\Stray-Win64-Shipping\.exe$)", {{ - { "d3d11.ignoreGraphicsBarriers", "True" }, + { "d3d11.relaxedGraphicsBarriers", "True" }, }} }, /* Metal Gear Solid V: Ground Zeroes * * Texture quality can break at high vram */ @@ -433,7 +432,7 @@ namespace dxvk { * and assumes that AMD GPUs do not expose * * native command lists for AGS usage */ { R"(\\granblue_fantasy_relink\.exe$)", {{ - { "d3d11.ignoreGraphicsBarriers", "True" }, + { "d3d11.relaxedGraphicsBarriers", "True" }, { "d3d11.exposeDriverCommandLists", "False" }, { "dxgi.hideNvidiaGpu", "False" }, }} },