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

vk: Fix double-spill for invalidated resources

This commit is contained in:
kd-11 2021-07-17 00:36:30 +03:00 committed by kd-11
parent 2d4df57d87
commit 0d87d909c6
2 changed files with 9 additions and 1 deletions

View File

@ -501,6 +501,7 @@ namespace rsx
ensure(store);
new_surface_storage = Traits::create_new_surface(address, format, width, height, pitch, antialias, std::forward<Args>(extra_params)...);
new_surface = Traits::get(new_surface_storage);
Traits::prepare_surface_for_drawing(command_list, new_surface);
allocate_rsx_memory(new_surface);
}

View File

@ -125,6 +125,12 @@ namespace vk
// 1. Spill an strip any 'invalidated resources'. At this point it doesn't matter and we donate to the resolve cache which is a plus.
for (auto& surface : invalidated_resources)
{
if (!surface->value)
{
ensure(!surface->resolve_surface);
continue;
}
// Only spill anything with references. Other surfaces already marked for removal should be inevitably deleted when it is time to free_invalidated
if (surface->has_refs() && (surface->resolve_surface || surface->samples() == 1))
{
@ -251,7 +257,8 @@ namespace vk
{
for (auto& surface : list)
{
if (surface.second->value && !surface.second->is_bound)
// NOTE: Check if memory is available instead of value in case we ran out of memory during unspill
if (surface.second->memory && !surface.second->is_bound)
{
sorted_list.push_back(surface.second.get());
}