Vulkan: Don't save borders to screenshots/frame dumps
This matches the behavior on GL, making for easier comparisons.
This commit is contained in:
parent
400ba3c7e5
commit
b39ac950eb
|
@ -618,8 +618,15 @@ void Renderer::DrawScreen(const TargetRectangle& src_rect, const Texture2D* src_
|
||||||
|
|
||||||
bool Renderer::DrawScreenshot(const TargetRectangle& src_rect, const Texture2D* src_tex)
|
bool Renderer::DrawScreenshot(const TargetRectangle& src_rect, const Texture2D* src_tex)
|
||||||
{
|
{
|
||||||
u32 width = std::max(1u, static_cast<u32>(s_backbuffer_width));
|
// Draw the screenshot to an image containing only the active screen area, removing any
|
||||||
u32 height = std::max(1u, static_cast<u32>(s_backbuffer_height));
|
// borders as a result of the game rendering in a different aspect ratio.
|
||||||
|
TargetRectangle target_rect = GetTargetRectangle();
|
||||||
|
target_rect.right = target_rect.GetWidth();
|
||||||
|
target_rect.bottom = target_rect.GetHeight();
|
||||||
|
target_rect.left = 0;
|
||||||
|
target_rect.top = 0;
|
||||||
|
u32 width = std::max(1u, static_cast<u32>(target_rect.GetWidth()));
|
||||||
|
u32 height = std::max(1u, static_cast<u32>(target_rect.GetHeight()));
|
||||||
if (!ResizeScreenshotBuffer(width, height))
|
if (!ResizeScreenshotBuffer(width, height))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -637,8 +644,8 @@ bool Renderer::DrawScreenshot(const TargetRectangle& src_rect, const Texture2D*
|
||||||
VK_SUBPASS_CONTENTS_INLINE);
|
VK_SUBPASS_CONTENTS_INLINE);
|
||||||
vkCmdClearAttachments(g_command_buffer_mgr->GetCurrentCommandBuffer(), 1, &clear_attachment, 1,
|
vkCmdClearAttachments(g_command_buffer_mgr->GetCurrentCommandBuffer(), 1, &clear_attachment, 1,
|
||||||
&clear_rect);
|
&clear_rect);
|
||||||
BlitScreen(m_framebuffer_mgr->GetColorCopyForReadbackRenderPass(), GetTargetRectangle(), src_rect,
|
BlitScreen(m_framebuffer_mgr->GetColorCopyForReadbackRenderPass(), target_rect, src_rect, src_tex,
|
||||||
src_tex, true);
|
true);
|
||||||
vkCmdEndRenderPass(g_command_buffer_mgr->GetCurrentCommandBuffer());
|
vkCmdEndRenderPass(g_command_buffer_mgr->GetCurrentCommandBuffer());
|
||||||
|
|
||||||
// Copy to the readback texture.
|
// Copy to the readback texture.
|
||||||
|
|
Loading…
Reference in New Issue