Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vk: Improved OOM handling #13967

Merged
merged 3 commits into from Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions rpcs3/Emu/RSX/VK/VKRenderTargets.cpp
Expand Up @@ -190,18 +190,24 @@ namespace vk
return false;
}

if (rtt->resolve_surface && memory_pressure >= rsx::problem_severity::moderate)
{
// We do not need to keep resolve targets around.
vk::get_resource_manager()->dispose(rtt->resolve_surface);
}

if (rtt->frame_tag >= last_finished_frame)
{
// RTT itself still in use by the frame.
return false;
}

if (!rtt->old_contents.empty())
{
rtt->clear_rw_barrier();
}

if (rtt->resolve_surface && memory_pressure >= rsx::problem_severity::moderate)
{
// We do not need to keep resolve targets around.
// TODO: We should surrender this to an image cache immediately for reuse.
vk::get_resource_manager()->dispose(rtt->resolve_surface);
}

switch (memory_pressure)
{
case rsx::problem_severity::low:
Expand Down