mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-22 07:54:15 +01:00
[d3d9] Fix texture dirty box clearing
- Fix interleaved locks with evictManagedOnUnlock We need to make sure there are no other subresources of a texture locked before clearing the dirty box. Otherwise the data for those other subresources won't get copied into VRAM. - Clear dirty box regardless of texture pool Otherwise we keep repacking and copying the whole texture for every single lock. This causes performance problems in Star Wars: The Old Republic.
This commit is contained in:
parent
2ff8b42fff
commit
c43618d19f
@ -308,6 +308,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
bool GetLocked(UINT Subresource) const { return m_locked.get(Subresource); }
|
bool GetLocked(UINT Subresource) const { return m_locked.get(Subresource); }
|
||||||
|
|
||||||
|
bool IsAnySubresourceLocked() const { return m_locked.any(); }
|
||||||
|
|
||||||
void SetWrittenByGPU(UINT Subresource, bool value) { m_wasWrittenByGPU.set(Subresource, value); }
|
void SetWrittenByGPU(UINT Subresource, bool value) { m_wasWrittenByGPU.set(Subresource, value); }
|
||||||
|
|
||||||
bool WasWrittenByGPU(UINT Subresource) const { return m_wasWrittenByGPU.get(Subresource); }
|
bool WasWrittenByGPU(UINT Subresource) const { return m_wasWrittenByGPU.get(Subresource); }
|
||||||
|
@ -4224,7 +4224,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pResource->IsManaged() && !m_d3d9Options.evictManagedOnUnlock && !readOnly) {
|
if (managed && !m_d3d9Options.evictManagedOnUnlock && !readOnly) {
|
||||||
pResource->SetNeedsUpload(Subresource, true);
|
pResource->SetNeedsUpload(Subresource, true);
|
||||||
|
|
||||||
for (uint32_t tex = m_activeTextures; tex; tex &= tex - 1) {
|
for (uint32_t tex = m_activeTextures; tex; tex &= tex - 1) {
|
||||||
@ -4276,7 +4276,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (shouldFlush) {
|
if (shouldFlush) {
|
||||||
this->FlushImage(pResource, Subresource);
|
this->FlushImage(pResource, Subresource);
|
||||||
if (pResource->IsManaged())
|
if (!pResource->IsAnySubresourceLocked())
|
||||||
pResource->ClearDirtyBoxes();
|
pResource->ClearDirtyBoxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ namespace dxvk::bit {
|
|||||||
m_dwords[i] = 0;
|
m_dwords[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool any() {
|
constexpr bool any() const {
|
||||||
for (size_t i = 0; i < Dwords; i++) {
|
for (size_t i = 0; i < Dwords; i++) {
|
||||||
if (m_dwords[i] != 0)
|
if (m_dwords[i] != 0)
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user