diff --git a/src/d3d9/d3d9_common_texture.h b/src/d3d9/d3d9_common_texture.h index 32e47a19e..6640e12b8 100644 --- a/src/d3d9/d3d9_common_texture.h +++ b/src/d3d9/d3d9_common_texture.h @@ -337,10 +337,6 @@ namespace dxvk { void MarkAllNeedReadback() { m_needsReadback.setAll(); } - void SetReadOnlyLocked(UINT Subresource, bool readOnly) { return m_readOnly.set(Subresource, readOnly); } - - bool GetReadOnlyLocked(UINT Subresource) const { return m_readOnly.get(Subresource); } - const Rc& GetSampleView(bool srgb) const { return m_sampleView.Pick(srgb && IsSrgbCompatible()); } @@ -522,8 +518,6 @@ namespace dxvk { D3D9SubresourceBitset m_locked = { }; - D3D9SubresourceBitset m_readOnly = { }; - D3D9SubresourceBitset m_needsReadback = { }; D3D9SubresourceBitset m_needsUpload = { }; diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index d6d142401..ee60c338c 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4714,15 +4714,11 @@ namespace dxvk { if (desc.Usage & D3DUSAGE_WRITEONLY) Flags &= ~D3DLOCK_READONLY; - const bool readOnly = Flags & D3DLOCK_READONLY; - pResource->SetReadOnlyLocked(Subresource, readOnly); - - bool renderable = desc.Usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL); - // If we recently wrote to the texture on the gpu, // then we need to copy -> buffer // We are also always dirty if we are a render target, // a depth stencil, or auto generate mipmaps. + bool renderable = desc.Usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL); bool needsReadback = pResource->NeedsReadback(Subresource) || renderable; // Skip readback if we discard is specified. We can only do this for textures that have an associated Vulkan image. @@ -4838,6 +4834,7 @@ namespace dxvk { UnmapTextures(); + const bool readOnly = Flags & D3DLOCK_READONLY; const bool noDirtyUpdate = Flags & D3DLOCK_NO_DIRTY_UPDATE; if ((desc.Pool == D3DPOOL_DEFAULT || !noDirtyUpdate) && !readOnly) { if (pBox && MipLevel != 0) {