Check the hashes of efb copies before applying them as partial texture updates
This commit is contained in:
parent
018a05b77e
commit
ff709247e2
|
@ -245,6 +245,8 @@ TextureCache::TCacheEntryBase* TextureCache::DoPartialTextureUpdates(TexCache::i
|
||||||
&& entry->addr + entry->size_in_bytes <= entry_to_update->addr + entry_to_update->size_in_bytes
|
&& entry->addr + entry->size_in_bytes <= entry_to_update->addr + entry_to_update->size_in_bytes
|
||||||
&& entry->frameCount == FRAMECOUNT_INVALID
|
&& entry->frameCount == FRAMECOUNT_INVALID
|
||||||
&& entry->memory_stride == numBlocksX * block_size)
|
&& entry->memory_stride == numBlocksX * block_size)
|
||||||
|
{
|
||||||
|
if (entry->hash == entry->CalculateHash())
|
||||||
{
|
{
|
||||||
u32 block_offset = (entry->addr - entry_to_update->addr) / block_size;
|
u32 block_offset = (entry->addr - entry_to_update->addr) / block_size;
|
||||||
u32 block_x = block_offset % numBlocksX;
|
u32 block_x = block_offset % numBlocksX;
|
||||||
|
@ -301,6 +303,13 @@ TextureCache::TCacheEntryBase* TextureCache::DoPartialTextureUpdates(TexCache::i
|
||||||
// Mark the texture update as used, so it isn't applied more than once
|
// Mark the texture update as used, so it isn't applied more than once
|
||||||
entry->frameCount = frameCount;
|
entry->frameCount = frameCount;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the hash does not match, this EFB copy will not be used for anything, so remove it
|
||||||
|
iter = FreeTexture(iter);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
return entry_to_update;
|
return entry_to_update;
|
||||||
|
|
Loading…
Reference in New Issue