Skip to content

Commit

Permalink
[d3d11] Always keep barrier control options set by app profile
Browse files Browse the repository at this point in the history
  • Loading branch information
K0bin authored and doitsujin committed Aug 26, 2024
1 parent eb8d188 commit e4fd9ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/d3d11/d3d11_context_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeviceContextExt<ContextType>::SetBarrierControl(
UINT ControlFlags) {
D3D10DeviceLock lock = m_ctx->LockContext();
DxvkBarrierControlFlags flags;

D3D11Device* parent = static_cast<D3D11Device*>(m_ctx->GetParentInterface());
DxvkBarrierControlFlags flags = parent->GetOptionsBarrierControlFlags();

if (ControlFlags & D3D11_VK_BARRIER_CONTROL_IGNORE_WRITE_AFTER_WRITE)
flags.set(DxvkBarrierControl::IgnoreWriteAfterWrite);

Expand Down
13 changes: 2 additions & 11 deletions src/d3d11/d3d11_context_imm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 12 additions & 0 deletions src/d3d11/d3d11_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,18 @@ namespace dxvk {

static DxvkDeviceFeatures GetDeviceFeatures(
const Rc<DxvkAdapter>& Adapter);

DxvkBarrierControlFlags GetOptionsBarrierControlFlags() {
DxvkBarrierControlFlags barrierControl;

if (m_d3d11Options.relaxedBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreWriteAfterWrite);

if (m_d3d11Options.ignoreGraphicsBarriers)
barrierControl.set(DxvkBarrierControl::IgnoreGraphicsBarriers);

return barrierControl;
}

private:

Expand Down

0 comments on commit e4fd9ff

Please sign in to comment.