rsx: Improve aliased data preservation

- Carve out inherited region if any
- Perform pitch compatibility test before assigning old_surface
This commit is contained in:
kd-11 2019-07-20 19:18:11 +03:00 committed by kd-11
parent 738cfccbba
commit 1de90bdb1f

View file

@ -468,8 +468,12 @@ namespace rsx
// Remove and preserve if possible any overlapping/replaced surface from the other pool // Remove and preserve if possible any overlapping/replaced surface from the other pool
auto aliased_surface = secondary_storage->find(address); auto aliased_surface = secondary_storage->find(address);
if (aliased_surface != secondary_storage->end()) if (aliased_surface != secondary_storage->end())
{
if (Traits::surface_is_pitch_compatible(aliased_surface->second, pitch))
{ {
old_surface = Traits::get(aliased_surface->second); old_surface = Traits::get(aliased_surface->second);
split_surface_region<!depth>(command_list, address, old_surface, (u16)width, (u16)height, bpp, antialias);
}
Traits::notify_surface_invalidated(aliased_surface->second); Traits::notify_surface_invalidated(aliased_surface->second);
invalidated_resources.push_back(std::move(aliased_surface->second)); invalidated_resources.push_back(std::move(aliased_surface->second));