Fix for EvictManagedOnUnlock & SWTOR performance #2126
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2125
Borderlands 2 locks textures like this:
which leads to us clearing the dirty box too soon and not copying the smaller mip maps over.
Fixes #2130
SWTOR locks a 1024x1024 D3DPOOL_DEFAULT, D3DFORMAT_A8, USAGE_DYNAMIC texture very often. (Probably cached font glyphs?). It properly sets the dirty rect whenever it makes a change.
On current master we never clear the dirty so it stays at the initial 1024x1024 rect. That means we keep repacking (from 4 aligned pitch managed buffer into tightly packed staging buffer) the entire image a bunch of times per frame. That's really slow.
If we just clear the dirty box like we do for managed textures, all we have to repack and copy are <30x30 parts of the texture.