diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-10-06 10:58:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-06 10:58:45 +0200 |
| commit | 062de51d707e68c40910b8c2cc11638d45b8805c (patch) | |
| tree | 0ee5d5ec24221753c9eb66f00fcb06be008b31f0 /Source/Core/VideoBackends/Vulkan/Renderer.cpp | |
| parent | 03f5ef1d30d4a5540517da4ead0baafe71f57a53 (diff) | |
| parent | b39ac950eb8fa71fd745e4c42d2805d3317daeda (diff) | |
Merge pull request #4305 from stenzek/vulkan-framedump-fix
Vulkan: Fix minor issues with frame dumping on Vulkan
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/Renderer.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/Renderer.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 7bb15aacdf..c8f9aaa4d3 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -65,6 +65,15 @@ Renderer::Renderer(std::unique_ptr<SwapChain> swap_chain) : m_swap_chain(std::mo Renderer::~Renderer() { +#if defined(HAVE_LIBAV) || defined(_WIN32) + // Stop frame dumping if it was left enabled at shutdown time. + if (bAVIDumping) + { + AVIDump::Stop(); + bAVIDumping = false; + } +#endif + g_Config.bRunning = false; UpdateActiveConfig(); DestroyScreenshotResources(); @@ -609,8 +618,15 @@ void Renderer::DrawScreen(const TargetRectangle& src_rect, const Texture2D* src_ bool Renderer::DrawScreenshot(const TargetRectangle& src_rect, const Texture2D* src_tex) { - u32 width = std::max(1u, static_cast<u32>(s_backbuffer_width)); - u32 height = std::max(1u, static_cast<u32>(s_backbuffer_height)); + // Draw the screenshot to an image containing only the active screen area, removing any + // 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)) return false; @@ -628,8 +644,8 @@ bool Renderer::DrawScreenshot(const TargetRectangle& src_rect, const Texture2D* VK_SUBPASS_CONTENTS_INLINE); vkCmdClearAttachments(g_command_buffer_mgr->GetCurrentCommandBuffer(), 1, &clear_attachment, 1, &clear_rect); - BlitScreen(m_framebuffer_mgr->GetColorCopyForReadbackRenderPass(), GetTargetRectangle(), src_rect, - src_tex, true); + BlitScreen(m_framebuffer_mgr->GetColorCopyForReadbackRenderPass(), target_rect, src_rect, src_tex, + true); vkCmdEndRenderPass(g_command_buffer_mgr->GetCurrentCommandBuffer()); // Copy to the readback texture. @@ -1521,7 +1537,7 @@ bool Renderer::CompileShaders() void main() { - ocol0 = texture(samp0, uv0); + ocol0 = float4(texture(samp0, uv0).xyz, 1.0); } )"; |
