mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 09:48:37 +12:00
rsx: Update memory flags after memory transfer
This commit is contained in:
parent
fc18e17ba6
commit
1b9c9267f0
2 changed files with 13 additions and 0 deletions
|
@ -214,6 +214,10 @@ void GLGSRender::end()
|
||||||
//Copy data from old contents onto this one
|
//Copy data from old contents onto this one
|
||||||
const auto region = rsx::get_transferable_region(surface);
|
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, {});
|
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
|
//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<gl::render_target*>(ds->old_contents)->get_rsx_pitch() &&
|
if (ds && ds->old_contents != nullptr && ds->get_rsx_pitch() == static_cast<gl::render_target*>(ds->old_contents)->get_rsx_pitch() &&
|
||||||
ds->old_contents->get_internal_format() == gl::texture::internal_format::rgba8)
|
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());
|
m_depth_converter.run(ds->width(), ds->height(), ds->id(), ds->old_contents->id());
|
||||||
|
ds->on_write();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_cfg.video.strict_rendering_mode)
|
if (g_cfg.video.strict_rendering_mode)
|
||||||
|
|
|
@ -1137,11 +1137,14 @@ void VKGSRender::end()
|
||||||
{
|
{
|
||||||
if (ds->old_contents->info.format == VK_FORMAT_B8G8R8A8_UNORM)
|
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 rp = vk::get_render_pass_location(VK_FORMAT_UNDEFINED, ds->info.format, 0);
|
||||||
auto render_pass = m_render_passes[rp];
|
auto render_pass = m_render_passes[rp];
|
||||||
m_depth_converter->run(*m_current_command_buffer, ds->width(), ds->height(), ds,
|
m_depth_converter->run(*m_current_command_buffer, ds->width(), ds->height(), ds,
|
||||||
static_cast<vk::render_target*>(ds->old_contents)->get_view(0xAAE4, rsx::default_remap_vector),
|
static_cast<vk::render_target*>(ds->old_contents)->get_view(0xAAE4, rsx::default_remap_vector),
|
||||||
render_pass, m_framebuffers_to_clean);
|
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,
|
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,
|
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);
|
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();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue