mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 08:49:20 +01:00
Vulkan: Ensure framedump texture is incorrect layout for render/readback
This commit is contained in:
parent
69b0a31938
commit
48da42b49f
@ -756,6 +756,10 @@ bool Renderer::DrawFrameDump(const TargetRectangle& scaled_efb_rect, u32 xfb_add
|
|||||||
if (!ResizeFrameDumpBuffer(width, height))
|
if (!ResizeFrameDumpBuffer(width, height))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// If there was a previous frame dumped, we'll still be in TRANSFER_SRC layout.
|
||||||
|
m_frame_dump_render_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
|
||||||
|
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||||
|
|
||||||
VkClearValue clear_value = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
|
VkClearValue clear_value = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
|
||||||
VkClearRect clear_rect = {{{0, 0}, {width, height}}, 0, 1};
|
VkClearRect clear_rect = {{{0, 0}, {width, height}}, 0, 1};
|
||||||
VkClearAttachment clear_attachment = {VK_IMAGE_ASPECT_COLOR_BIT, 0, clear_value};
|
VkClearAttachment clear_attachment = {VK_IMAGE_ASPECT_COLOR_BIT, 0, clear_value};
|
||||||
@ -781,6 +785,8 @@ bool Renderer::DrawFrameDump(const TargetRectangle& scaled_efb_rect, u32 xfb_add
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Queue a copy to the current frame dump buffer. It will be written to the frame dump later.
|
// Queue a copy to the current frame dump buffer. It will be written to the frame dump later.
|
||||||
|
m_frame_dump_render_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
|
||||||
|
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||||
readback_texture->CopyFromImage(g_command_buffer_mgr->GetCurrentCommandBuffer(),
|
readback_texture->CopyFromImage(g_command_buffer_mgr->GetCurrentCommandBuffer(),
|
||||||
m_frame_dump_render_texture->GetImage(),
|
m_frame_dump_render_texture->GetImage(),
|
||||||
VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, width, height, 0, 0);
|
VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, width, height, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user