1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

rsx: Handle cyclic references when doing memory inheritance

This commit is contained in:
kd-11 2019-07-16 12:10:08 +03:00 committed by kd-11
parent 34b06453f9
commit 113a49e00c
2 changed files with 11 additions and 4 deletions

View File

@ -299,9 +299,13 @@ namespace rsx
// Dirty zombies are possible with unused pixel storage subslices and are valid // Dirty zombies are possible with unused pixel storage subslices and are valid
// Avoid double transfer if possible // Avoid double transfer if possible
// This is an optional optimization that can be safely disabled // This is an optional optimization that can be safely disabled
surface = dynamic_cast<decltype(surface)>(surface->old_contents[0].source); surface = static_cast<decltype(surface)>(surface->old_contents[0].source);
this_address = surface->memory_tag_samples[0].first;
verify(HERE), surface, this_address; // Ignore self-reference
if (new_surface == surface)
{
continue;
}
// If this surface has already been added via another descendant, just ignore it // If this surface has already been added via another descendant, just ignore it
bool ignore = false; bool ignore = false;
@ -315,6 +319,9 @@ namespace rsx
} }
if (ignore) continue; if (ignore) continue;
this_address = surface->memory_tag_samples[0].first;
verify(HERE), this_address;
} }
const auto parent_region = surface->get_normalized_memory_area(); const auto parent_region = surface->get_normalized_memory_area();

View File

@ -337,7 +337,7 @@ namespace rsx
void set_old_contents_region(const T& region, bool normalized) void set_old_contents_region(const T& region, bool normalized)
{ {
// NOTE: This method will not perform pitch verification! // NOTE: This method will not perform pitch verification!
verify(HERE), region.source, region.source != this; verify(HERE), region.source, region.source != static_cast<decltype(region.source)>(this);
old_contents.push_back(region.template cast<image_storage_type>()); old_contents.push_back(region.template cast<image_storage_type>());
auto &slice = old_contents.back(); auto &slice = old_contents.back();