diff --git a/src/d3d11/d3d11_cmdlist.cpp b/src/d3d11/d3d11_cmdlist.cpp index e11b3f89..714ba27f 100644 --- a/src/d3d11/d3d11_cmdlist.cpp +++ b/src/d3d11/d3d11_cmdlist.cpp @@ -65,10 +65,11 @@ namespace dxvk { void D3D11CommandList::MarkSubmitted() { - if (m_submitted.exchange(true) && !m_warned.exchange(true)) { + if (m_submitted.exchange(true) && !m_warned.exchange(true) + && m_device->GetOptions()->dcMapSpeedHack) { Logger::warn( - "D3D11: Command list submitted multiple times.\n" - " This is currently not supported."); + "D3D11: Command list submitted multiple times,\n" + " but d3d11.dcMapSpeedHack is enabled"); } } diff --git a/src/d3d11/d3d11_context_def.cpp b/src/d3d11/d3d11_context_def.cpp index af3028c1..e47a7c0d 100644 --- a/src/d3d11/d3d11_context_def.cpp +++ b/src/d3d11/d3d11_context_def.cpp @@ -1,4 +1,5 @@ #include "d3d11_context_def.h" +#include "d3d11_device.h" namespace dxvk { @@ -172,7 +173,7 @@ namespace dxvk { pMapEntry->RowPitch = pBuffer->GetSize(); pMapEntry->DepthPitch = pBuffer->GetSize(); - if (bufferDesc.Usage == D3D11_USAGE_DYNAMIC) { + if (bufferDesc.Usage == D3D11_USAGE_DYNAMIC && m_parent->GetOptions()->dcMapSpeedHack) { // For resources that cannot be written by the GPU, // we may write to the buffer resource directly and // just swap in the physical buffer slice as needed. @@ -242,7 +243,7 @@ namespace dxvk { D3D11_BUFFER_DESC bufferDesc; pBuffer->GetDesc(&bufferDesc); - if (bufferDesc.Usage == D3D11_USAGE_DYNAMIC) { + if (bufferDesc.Usage == D3D11_USAGE_DYNAMIC && m_parent->GetOptions()->dcMapSpeedHack) { EmitCs([ cDstBuffer = pBuffer->GetBuffer(), cPhysSlice = pMapEntry->BufferSlice diff --git a/src/d3d11/d3d11_options.cpp b/src/d3d11/d3d11_options.cpp index fcf6ba8b..98da2f5f 100644 --- a/src/d3d11/d3d11_options.cpp +++ b/src/d3d11/d3d11_options.cpp @@ -6,6 +6,7 @@ namespace dxvk { D3D11Options::D3D11Options(const Config& config) { this->allowMapFlagNoWait = config.getOption("d3d11.allowMapFlagNoWait", false); + this->dcMapSpeedHack = config.getOption("d3d11.dcMapSpeedHack", true); this->fakeStreamOutSupport = config.getOption("d3d11.fakeStreamOutSupport", false); this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); diff --git a/src/d3d11/d3d11_options.h b/src/d3d11/d3d11_options.h index dcbe73cd..d66e60e2 100644 --- a/src/d3d11/d3d11_options.h +++ b/src/d3d11/d3d11_options.h @@ -16,6 +16,13 @@ namespace dxvk { /// operation succeeds when that flag is set. bool allowMapFlagNoWait; + /// Enables speed hack for mapping on deferred contexts + /// + /// This can substantially speed up some games, but may + /// cause issues if the game submits command lists more + /// than once. + bool dcMapSpeedHack; + /// Fakes stream output support. /// /// Temporary hack that fixes issues in some games diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index a0eb87a6..6edd5f71 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -28,6 +28,14 @@ namespace dxvk { { "dxgi.customVendorId", "1002" }, { "dxgi.customDeviceId", "e366" }, }} }, + /* The Evil Within */ + { "EvilWithin.exe", {{ + { "d3d11.dcMapSpeedHack", "False" }, + }} }, + /* The Evil Within Demo */ + { "EvilWithinDemo.exe", {{ + { "d3d11.dcMapSpeedHack", "False" }, + }} }, /* F1 2015 */ { "F1_2015.exe", {{ { "d3d11.fakeStreamOutSupport", "True" },