[d3d9] Only set upload bit for managed textures

Otherwise D3DPOOL_DEFAULT can hit the draw time late
upload path.
This commit is contained in:
Robin Kertels 2022-07-28 15:40:36 +02:00 committed by Joshie
parent ba4d95c5fc
commit 08ad6583ea
1 changed files with 11 additions and 4 deletions

View File

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