diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 248253af93..1e380daae5 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -214,6 +214,10 @@ void GLGSRender::end() //Copy data from old contents onto this one const auto region = rsx::get_transferable_region(surface); gl::g_hw_blitter->scale_image(surface->old_contents, surface, { 0, 0, std::get<0>(region), std::get<1>(region) }, { 0, 0, std::get<2>(region) , std::get<3>(region) }, !is_depth, is_depth, {}); + + // Memory has been transferred, discard old contents and update memory flags + // TODO: Preserve memory outside surface clip region + surface->on_write(); } //TODO: download image contents and reupload them or do a memory cast to copy memory contents if not compatible }; @@ -275,7 +279,9 @@ void GLGSRender::end() if (ds && ds->old_contents != nullptr && ds->get_rsx_pitch() == static_cast(ds->old_contents)->get_rsx_pitch() && ds->old_contents->get_internal_format() == gl::texture::internal_format::rgba8) { + // TODO: Partial memory transfer m_depth_converter.run(ds->width(), ds->height(), ds->id(), ds->old_contents->id()); + ds->on_write(); } if (g_cfg.video.strict_rendering_mode) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 4b7f7f2a64..8e1d33907e 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1137,11 +1137,14 @@ void VKGSRender::end() { if (ds->old_contents->info.format == VK_FORMAT_B8G8R8A8_UNORM) { + // TODO: Partial memory transfer auto rp = vk::get_render_pass_location(VK_FORMAT_UNDEFINED, ds->info.format, 0); auto render_pass = m_render_passes[rp]; m_depth_converter->run(*m_current_command_buffer, ds->width(), ds->height(), ds, static_cast(ds->old_contents)->get_view(0xAAE4, rsx::default_remap_vector), render_pass, m_framebuffers_to_clean); + + ds->on_write(); } } @@ -1162,6 +1165,10 @@ void VKGSRender::end() vk::copy_scaled_image(*m_current_command_buffer, surface->old_contents->value, surface->value, surface->old_contents->current_layout, surface->current_layout, 0, 0, src_w, src_h, 0, 0, dst_w, dst_h, 1, aspect, true, VK_FILTER_LINEAR, surface->info.format, surface->old_contents->info.format); + + // Memory has been transferred, discard old contents and update memory flags + // TODO: Preserve memory outside surface clip region + surface->on_write(); } };