From 08ad6583ea223b70aa02498fbb7c9e44bbbab572 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Thu, 28 Jul 2022 15:40:36 +0200 Subject: [PATCH] [d3d9] Only set upload bit for managed textures Otherwise D3DPOOL_DEFAULT can hit the draw time late upload path. --- src/d3d9/d3d9_texture.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/d3d9/d3d9_texture.cpp b/src/d3d9/d3d9_texture.cpp index 4b2371eaf..811a6cd3a 100644 --- a/src/d3d9/d3d9_texture.cpp +++ b/src/d3d9/d3d9_texture.cpp @@ -87,7 +87,9 @@ namespace dxvk { // Some games keep using the pointer returned in LockRect() after calling Unlock() // and purely rely on AddDirtyRect to notify D3D9 that contents have changed. // We have no way of knowing which mip levels were actually changed. - m_texture.SetAllNeedUpload(); + if (m_texture.IsManaged()) + m_texture.SetAllNeedUpload(); + return D3D_OK; } @@ -169,7 +171,9 @@ namespace dxvk { // Some games keep using the pointer returned in LockBox() after calling Unlock() // and purely rely on AddDirtyBox to notify D3D9 that contents have changed. // We have no way of knowing which mip levels were actually changed. - m_texture.SetAllNeedUpload(); + if (m_texture.IsManaged()) + m_texture.SetAllNeedUpload(); + return D3D_OK; } @@ -257,9 +261,12 @@ namespace dxvk { // Some games keep using the pointer returned in LockRect() after calling Unlock() // and purely rely on AddDirtyRect to notify D3D9 that contents have changed. // We have no way of knowing which mip levels were actually changed. - for (uint32_t m = 0; m < m_texture.Desc()->MipLevels; m++) { - m_texture.SetNeedsUpload(m_texture.CalcSubresource(Face, m), true); + if (m_texture.IsManaged()) { + for (uint32_t m = 0; m < m_texture.Desc()->MipLevels; m++) { + m_texture.SetNeedsUpload(m_texture.CalcSubresource(Face, m), true); + } } + return D3D_OK; }