mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
rsx: Fix reference leak when cloning surfaces
This commit is contained in:
parent
009e01a347
commit
998717659f
2 changed files with 29 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue