Skip to content

Commit

Permalink
VK: add memory barriers to copy_image
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Mar 4, 2025
1 parent c58ab40 commit ad2361c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rpcs3/Emu/RSX/VK/VKPresent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,15 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info)
VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
0, VMM_ALLOCATION_POOL_UNDEFINED);

tmp_tex->change_layout(*m_current_command_buffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
image_to_flip->push_layout(*m_current_command_buffer, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);

const areai rect = areai(0, 0, buffer_width, buffer_height);
vk::copy_image(*m_current_command_buffer, image_to_flip, tmp_tex.get(), rect, rect, 1);

image_to_flip->pop_layout(*m_current_command_buffer);
tmp_tex->change_layout(*m_current_command_buffer, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);

vk::framebuffer_holder* sshot_fbo = vk::get_framebuffer(*m_device, buffer_width, buffer_height, VK_FALSE, single_target_pass, { tmp_tex.get() });
sshot_fbo->add_ref();
render_overlays(sshot_fbo, areau(rect));
Expand Down

0 comments on commit ad2361c

Please sign in to comment.