From 46cb05ce452e38351da8062dc74d27eedafbdfcd Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Thu, 11 Aug 2022 14:23:50 +0200 Subject: [PATCH] [d3d9+util] Always ignore D3DLOCK_DONOTWAIT We only ever stall when locking a texture that was previously used with GetRenderTargetData or GetFrontBufferData. Games are known to break if locking those textures doesn't succeed. --- src/d3d9/d3d9_device.cpp | 5 +++-- src/d3d9/d3d9_options.cpp | 1 - src/d3d9/d3d9_options.h | 3 --- src/util/config/config.cpp | 19 ------------------- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 07d68360..63c92dd6 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4200,8 +4200,9 @@ namespace dxvk { if (unlikely((Flags & (D3DLOCK_DISCARD | D3DLOCK_READONLY)) == (D3DLOCK_DISCARD | D3DLOCK_READONLY))) return D3DERR_INVALIDCALL; - if (unlikely(!m_d3d9Options.allowDoNotWait)) - Flags &= ~D3DLOCK_DONOTWAIT; + // We only ever wait for textures that were used with GetRenderTargetData or GetFrontBufferData anyway. + // Games like Beyond Good and Evil break if this doesn't succeed. + Flags &= ~D3DLOCK_DONOTWAIT; if (unlikely((Flags & (D3DLOCK_DISCARD | D3DLOCK_NOOVERWRITE)) == (D3DLOCK_DISCARD | D3DLOCK_NOOVERWRITE))) Flags &= ~D3DLOCK_DISCARD; diff --git a/src/d3d9/d3d9_options.cpp b/src/d3d9/d3d9_options.cpp index 822bc455..ce0a4320 100644 --- a/src/d3d9/d3d9_options.cpp +++ b/src/d3d9/d3d9_options.cpp @@ -63,7 +63,6 @@ namespace dxvk { this->forceSamplerTypeSpecConstants = config.getOption ("d3d9.forceSamplerTypeSpecConstants", false); this->forceSwapchainMSAA = config.getOption ("d3d9.forceSwapchainMSAA", -1); this->forceAspectRatio = config.getOption ("d3d9.forceAspectRatio", ""); - this->allowDoNotWait = config.getOption ("d3d9.allowDoNotWait", true); this->allowDiscard = config.getOption ("d3d9.allowDiscard", true); this->enumerateByDisplays = config.getOption ("d3d9.enumerateByDisplays", true); this->longMad = config.getOption ("d3d9.longMad", false); diff --git a/src/d3d9/d3d9_options.h b/src/d3d9/d3d9_options.h index 2a091fc4..51dd57fa 100644 --- a/src/d3d9/d3d9_options.h +++ b/src/d3d9/d3d9_options.h @@ -120,9 +120,6 @@ namespace dxvk { /// Forces an MSAA level on the swapchain int32_t forceSwapchainMSAA; - /// Allow D3DLOCK_DONOTWAIT - bool allowDoNotWait; - /// Allow D3DLOCK_DISCARD bool allowDiscard; diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index be6a1c04..c26474e2 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -386,15 +386,6 @@ namespace dxvk { { R"(\\TESV\.exe$)", {{ { "d3d9.customVendorId", "1002" }, }} }, - /* RTHDRIBL Demo - Uses DONOTWAIT after GetRenderTargetData - then goes into an infinite loop if it gets - D3DERR_WASSTILLDRAWING. - This is a better solution than penalizing - other apps that use this properly. */ - { R"(\\rthdribl\.exe$)", {{ - { "d3d9.allowDoNotWait", "False" }, - }} }, /* Hyperdimension Neptunia U: Action Unleashed */ { R"(\\Neptunia\.exe$)", {{ { "d3d9.forceAspectRatio", "16:9" }, @@ -562,11 +553,6 @@ namespace dxvk { { R"(\\eoa\.exe$)", {{ { "d3d9.customVendorId", "10de" }, }} }, - /* Beyond Good And Evil * - * Fixes missing sun and light shafts */ - { R"(\\BGE\.exe$)", {{ - { "d3d9.allowDoNotWait", "False" }, - }} }, /* Supreme Commander & Forged Alliance Forever */ { R"(\\(SupremeCommander|ForgedAlliance)\.exe$)", {{ { "d3d9.floatEmulation", "Strict" }, @@ -580,11 +566,6 @@ namespace dxvk { { R"(\\bionic_commando\.exe$)", {{ { "d3d9.maxFrameRate", "60" }, }} }, - /* Port Royale 3 * - * Fixes infinite loading screens */ - { R"(\\PortRoyale3\.exe$)", {{ - { "d3d9.allowDoNotWait", "False" }, - }} }, /* Need For Speed 3 modern patch */ { R"(\\nfs3\.exe$)", {{ { "d3d9.enableDialogMode", "True" },