mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-23 22:36:21 +00:00
TextureCache::Invalidate()/InvalidateAll() small corrections and optimizations.
I think the ranges are [start_addr, end_addr).
This commit is contained in:
parent
9b85da657a
commit
a1b7da413a
@ -123,10 +123,7 @@ void TextureCache::Invalidate(u32 addr, int size, GPUInvalidationType type) {
|
||||
u32 texAddr = iter->second.addr;
|
||||
u32 texEnd = iter->second.addr + iter->second.sizeInRAM;
|
||||
|
||||
bool invalidate = (texAddr >= addr && texAddr < addr_end) || (texEnd >= addr && texEnd < addr_end);
|
||||
invalidate = invalidate || (addr >= texAddr && addr < texEnd) || (addr_end >= texAddr && addr_end < texEnd);
|
||||
|
||||
if (invalidate) {
|
||||
if (texAddr < addr_end && addr < texEnd) {
|
||||
if ((iter->second.status & TexCacheEntry::STATUS_MASK) == TexCacheEntry::STATUS_RELIABLE) {
|
||||
// Clear status -> STATUS_HASHING.
|
||||
iter->second.status &= ~TexCacheEntry::STATUS_MASK;
|
||||
@ -143,8 +140,14 @@ void TextureCache::Invalidate(u32 addr, int size, GPUInvalidationType type) {
|
||||
}
|
||||
}
|
||||
|
||||
void TextureCache::InvalidateAll(GPUInvalidationType type) {
|
||||
Invalidate(0, 0xFFFFFFFF, type);
|
||||
void TextureCache::InvalidateAll(GPUInvalidationType /*unused*/) {
|
||||
for (TexCache::iterator iter = cache.begin(), end = cache.end(); iter != end; ++iter) {
|
||||
if ((iter->second.status & TexCacheEntry::STATUS_MASK) == TexCacheEntry::STATUS_RELIABLE) {
|
||||
// Clear status -> STATUS_HASHING.
|
||||
iter->second.status &= ~TexCacheEntry::STATUS_MASK;
|
||||
}
|
||||
iter->second.invalidHint++;
|
||||
}
|
||||
}
|
||||
|
||||
void TextureCache::ClearNextFrame() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user