1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

rsx: Fix reference leak when cloning surfaces

This commit is contained in:
kd-11 2019-07-15 19:36:29 +03:00 committed by kd-11
parent 009e01a347
commit 998717659f
2 changed files with 29 additions and 1 deletions

View File

@ -196,7 +196,7 @@ struct gl_render_target_traits
static
void clone_surface(
gl::command_context&,
gl::command_context& cmd,
std::unique_ptr<gl::render_target>& sink, gl::render_target* ref,
u32 address, barrier_descriptor_t& prev)
{
@ -227,6 +227,20 @@ struct gl_render_target_traits
prev.target = sink.get();
sink->sync_tag();
if (!sink->old_contents.empty())
{
// Deal with this, likely only needs to clear
if (sink->surface_width > prev.width || sink->surface_height > prev.height)
{
sink->write_barrier(cmd);
}
else
{
sink->clear_rw_barrier();
}
}
sink->set_old_contents_region(prev, false);
sink->last_use_tag = ref->last_use_tag;
}

View File

@ -590,6 +590,20 @@ namespace rsx
sink->rsx_pitch = ref->get_rsx_pitch();
sink->sync_tag();
if (!sink->old_contents.empty())
{
// Deal with this, likely only needs to clear
if (sink->surface_width > prev.width || sink->surface_height > prev.height)
{
sink->write_barrier(cmd);
}
else
{
sink->clear_rw_barrier();
}
}
sink->set_old_contents_region(prev, false);
sink->last_use_tag = ref->last_use_tag;
}