Merge pull request #3184 from mimimi085181/check-hash-on-partial-texture-updates

Check the hash before applying efb copies as partial texture updates
This commit is contained in:
Markus Wick 2015-10-19 09:44:24 +02:00
commit dddc834c14

View file

@ -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->frameCount == FRAMECOUNT_INVALID
&& entry->memory_stride == numBlocksX * block_size)
{
if (entry->hash == entry->CalculateHash())
{
u32 block_offset = (entry->addr - entry_to_update->addr) / block_size;
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
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;
}
return entry_to_update;