mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
rsx: Only transfer framebuffer contents if memory contents are compatible
This commit is contained in:
parent
0de0dded53
commit
7a5c88a8d1
2 changed files with 37 additions and 27 deletions
|
@ -364,6 +364,8 @@ void GLGSRender::end()
|
|||
//Check if depth buffer is bound and valid
|
||||
//If ds is not initialized clear it; it seems new depth textures should have depth cleared
|
||||
auto copy_rtt_contents = [](gl::render_target *surface)
|
||||
{
|
||||
if (surface->get_compatible_internal_format() == surface->old_contents->get_compatible_internal_format())
|
||||
{
|
||||
//Copy data from old contents onto this one
|
||||
//1. Clip a rectangular region defning the data
|
||||
|
@ -375,6 +377,9 @@ void GLGSRender::end()
|
|||
std::tie(std::ignore, std::ignore, copy_w, copy_h) = rsx::clip_region<u16>(parent_w, parent_h, 0, 0, surface->width(), surface->height(), true);
|
||||
glCopyImageSubData(surface->old_contents->id(), GL_TEXTURE_2D, 0, 0, 0, 0, surface->id(), GL_TEXTURE_2D, 0, 0, 0, 0, copy_w, copy_h, 1);
|
||||
surface->set_cleared();
|
||||
}
|
||||
//TODO: download image contents and reupload them or do a memory cast to copy memory contents if not compatible
|
||||
|
||||
surface->old_contents = nullptr;
|
||||
};
|
||||
|
||||
|
|
|
@ -1011,6 +1011,8 @@ void VKGSRender::end()
|
|||
if (g_cfg.video.strict_rendering_mode)
|
||||
{
|
||||
auto copy_rtt_contents = [&](vk::render_target* surface)
|
||||
{
|
||||
if (surface->info.format == surface->old_contents->info.format)
|
||||
{
|
||||
const VkImageAspectFlags aspect = surface->attachment_aspect_flag;
|
||||
|
||||
|
@ -1037,6 +1039,9 @@ void VKGSRender::end()
|
|||
vk::change_image_layout(*m_current_command_buffer, surface, old_layout, subresource_range);
|
||||
|
||||
surface->dirty = false;
|
||||
}
|
||||
//TODO: download image contents and reupload them or do a memory cast to copy memory contents if not compatible
|
||||
|
||||
surface->old_contents = nullptr;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue