1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[d3d11] Add option to disable deferred context mapping speed hack

Fixes a regression in The Evil Within.

We should probably find a proper solution, but for now this is the best
thing we can do for games which reuse command lists.
This commit is contained in:
Philip Rebohle 2018-10-09 16:29:50 +02:00
parent 6dd5cdbc3e
commit 08b241b3ea
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 23 additions and 5 deletions

View File

@ -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");
}
}

View File

@ -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

View File

@ -6,6 +6,7 @@ namespace dxvk {
D3D11Options::D3D11Options(const Config& config) {
this->allowMapFlagNoWait = config.getOption<bool>("d3d11.allowMapFlagNoWait", false);
this->dcMapSpeedHack = config.getOption<bool>("d3d11.dcMapSpeedHack", true);
this->fakeStreamOutSupport = config.getOption<bool>("d3d11.fakeStreamOutSupport", false);
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);

View File

@ -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

View File

@ -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" },