From e4fd9ff16b803daa1d45d50db3c28430e330055d Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Mon, 26 Aug 2024 23:11:52 +0200 Subject: [PATCH] [d3d11] Always keep barrier control options set by app profile --- src/d3d11/d3d11_context_ext.cpp | 5 +++-- src/d3d11/d3d11_context_imm.cpp | 13 ++----------- src/d3d11/d3d11_device.h | 12 ++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/d3d11/d3d11_context_ext.cpp b/src/d3d11/d3d11_context_ext.cpp index c89e0bc066a..e8c81e1dccc 100644 --- a/src/d3d11/d3d11_context_ext.cpp +++ b/src/d3d11/d3d11_context_ext.cpp @@ -143,8 +143,9 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11DeviceContextExt::SetBarrierControl( UINT ControlFlags) { D3D10DeviceLock lock = m_ctx->LockContext(); - DxvkBarrierControlFlags flags; - + D3D11Device* parent = static_cast(m_ctx->GetParentInterface()); + DxvkBarrierControlFlags flags = parent->GetOptionsBarrierControlFlags(); + if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE) flags.set(DxvkBarrierControl::IgnoreWriteAfterWrite); diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index aa379d41d0c..fafdcf5823f 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -24,20 +24,11 @@ namespace dxvk { m_videoContext(this, Device) { EmitCs([ cDevice = m_device, - cRelaxedBarriers = pParent->GetOptions()->relaxedBarriers, - cIgnoreGraphicsBarriers = pParent->GetOptions()->ignoreGraphicsBarriers + cBarrierControlFlags = pParent->GetOptionsBarrierControlFlags() ] (DxvkContext* ctx) { ctx->beginRecording(cDevice->createCommandList()); - DxvkBarrierControlFlags barrierControl; - - if (cRelaxedBarriers) - barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite); - - if (cIgnoreGraphicsBarriers) - barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers); - - ctx->setBarrierControl(barrierControl); + ctx->setBarrierControl(cBarrierControlFlags); }); ClearState(); diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index 7a44b5ad99c..662f6267cbd 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -434,6 +434,18 @@ namespace dxvk { static DxvkDeviceFeatures GetDeviceFeatures( const Rc& Adapter); + + DxvkBarrierControlFlags GetOptionsBarrierControlFlags() { + DxvkBarrierControlFlags barrierControl; + + if (m_d3d11Options.relaxedBarriers) + barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite); + + if (m_d3d11Options.ignoreGraphicsBarriers) + barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers); + + return barrierControl; + } private: