From 86e831541672c6ed2b5c7aabef0cdb117790c85d Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 5 Jun 2020 23:15:10 +0100 Subject: [PATCH] [d3d9] Revert Nekopara hacks --- src/d3d9/d3d9_common_texture.h | 7 ------- src/d3d9/d3d9_device.cpp | 10 ++-------- src/d3d9/d3d9_options.cpp | 1 - src/d3d9/d3d9_options.h | 4 ---- src/util/config/config.cpp | 4 ---- 5 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/d3d9/d3d9_common_texture.h b/src/d3d9/d3d9_common_texture.h index 50cbc8a24..fcca8924d 100644 --- a/src/d3d9/d3d9_common_texture.h +++ b/src/d3d9/d3d9_common_texture.h @@ -355,13 +355,6 @@ namespace dxvk { bool GetUploading(UINT Subresource) const { return m_uploading.get(Subresource); } void SetNeedsUpload(UINT Subresource, bool upload) { m_needsUpload.set(Subresource, upload); } - void MarkAllForUpload() { - uint32_t subresourceDwords = CountSubresources() / 32; - for (uint32_t i = 0; i < subresourceDwords; i++) - m_needsUpload.dword(i) = std::numeric_limits::max(); - - m_needsUpload.dword(subresourceDwords) = CountSubresources() % 32; - } bool NeedsAnyUpload() { return m_needsUpload.any(); } void ClearNeedsUpload() { return m_needsUpload.clearAll(); } diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index ad47f3c1d..8c613c784 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4120,7 +4120,7 @@ namespace dxvk { UINT Subresource = pResource->CalcSubresource(Face, MipLevel); // We weren't locked anyway! - if (unlikely(!pResource->GetLocked(Subresource) && !m_d3d9Options.uploadAllManagedSubresources)) + if (unlikely(!pResource->GetLocked(Subresource))) return D3DERR_INVALIDCALL; pResource->SetLocked(Subresource, false); @@ -4129,10 +4129,7 @@ namespace dxvk { if (!pResource->GetReadOnlyLocked(Subresource)) { // Only flush buffer -> image if we actually have an image if (pResource->IsManaged() && !m_d3d9Options.evictManagedOnUnlock) { - if (unlikely(m_d3d9Options.uploadAllManagedSubresources)) - pResource->MarkAllForUpload(); - else - pResource->SetNeedsUpload(Subresource, true); + pResource->SetNeedsUpload(Subresource, true); for (uint32_t tex = m_activeTextures; tex; tex &= tex - 1) { // Guaranteed to not be nullptr... @@ -4170,9 +4167,6 @@ namespace dxvk { // we need to copy its contents into the image const Rc copyBuffer = pResource->GetBuffer(Subresource); - if (unlikely(copyBuffer == nullptr)) - return D3D_OK; - auto formatInfo = imageFormatInfo(image->info().format); auto subresource = pResource->GetSubresourceFromIndex( formatInfo->aspectMask, Subresource); diff --git a/src/d3d9/d3d9_options.cpp b/src/d3d9/d3d9_options.cpp index 1dc814e51..4da9f9364 100644 --- a/src/d3d9/d3d9_options.cpp +++ b/src/d3d9/d3d9_options.cpp @@ -71,7 +71,6 @@ namespace dxvk { this->enumerateByDisplays = config.getOption ("d3d9.enumerateByDisplays", true); this->longMad = config.getOption ("d3d9.longMad", false); this->tearFree = config.getOption ("d3d9.tearFree", Tristate::Auto); - this->uploadAllManagedSubresources = config.getOption("d3d9.uploadAllManagedSubresources", false); // If we are not Nvidia, enable general hazards. this->generalHazards = adapter == nullptr || !adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0); diff --git a/src/d3d9/d3d9_options.h b/src/d3d9/d3d9_options.h index 00e1f1882..5f36a9a48 100644 --- a/src/d3d9/d3d9_options.h +++ b/src/d3d9/d3d9_options.h @@ -147,10 +147,6 @@ namespace dxvk { /// Tear-free mode if vsync is disabled /// Tearing mode if vsync is enabled Tristate tearFree; - - /// Upload all subresources of managed resources when unlocked. - /// Workaround for a game bug in Nekopara. - bool uploadAllManagedSubresources; }; } \ No newline at end of file diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index ff4670125..008376065 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -352,10 +352,6 @@ namespace dxvk { { R"(\\SpellForce2.*\.exe$)", {{ { "d3d9.forceSamplerTypeSpecConstants", "True" }, }} }, - /* Nekopara */ - { R"(\\nekopara.*\.exe$)", {{ - { "d3d9.uploadAllManagedSubresources", "True" }, - }} }, }};