summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/Renderer.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-10-10 11:48:57 +0200
committerGitHub <noreply@github.com>2016-10-10 11:48:57 +0200
commita583d36c7f38fac9fb66c059bf6990bfd819591f (patch)
tree842adfb6ca1a3ac76b290677bd72db2a406b781f /Source/Core/VideoBackends/Vulkan/Renderer.cpp
parent562bc01d0e21f103fa9d8ee1993654a81e51fb26 (diff)
parent64927a2f81fe64503060c949ead525995fd63a2a (diff)
Merge pull request #4326 from degasus/framedump
Framedump: Merge screenshot code with framedumping.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/Renderer.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/Renderer.cpp41
1 files changed, 6 insertions, 35 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp
index f164f132a7..7192f93169 100644
--- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp
+++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp
@@ -29,7 +29,6 @@
#include "VideoCommon/AVIDump.h"
#include "VideoCommon/BPFunctions.h"
#include "VideoCommon/BPMemory.h"
-#include "VideoCommon/ImageWrite.h"
#include "VideoCommon/OnScreenDisplay.h"
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/PixelShaderManager.h"
@@ -482,24 +481,13 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
// Draw to the screenshot buffer if needed.
- bool needs_framedump = IsFrameDumping();
- bool needs_screenshot = s_bScreenshot || needs_framedump;
- if (needs_screenshot && DrawScreenshot(source_rc, efb_color_texture))
+ if (IsFrameDumping() && DrawScreenshot(source_rc, efb_color_texture))
{
- if (s_bScreenshot)
- {
- WriteScreenshot();
- }
-
- if (needs_framedump)
- {
- DumpFrameData(reinterpret_cast<const u8*>(m_screenshot_readback_texture->GetMapPointer()),
- static_cast<int>(m_screenshot_render_texture->GetWidth()),
- static_cast<int>(m_screenshot_render_texture->GetHeight()),
- static_cast<int>(m_screenshot_readback_texture->GetRowStride()),
- AVIDump::DumpFormat::FORMAT_RGBA);
- FinishFrameData();
- }
+ DumpFrameData(reinterpret_cast<const u8*>(m_screenshot_readback_texture->GetMapPointer()),
+ static_cast<int>(m_screenshot_render_texture->GetWidth()),
+ static_cast<int>(m_screenshot_render_texture->GetHeight()),
+ static_cast<int>(m_screenshot_readback_texture->GetRowStride()));
+ FinishFrameData();
}
// Restore the EFB color texture to color attachment ready for rendering the next frame.
@@ -760,23 +748,6 @@ void Renderer::DestroyScreenshotResources()
m_screenshot_readback_texture.reset();
}
-void Renderer::WriteScreenshot()
-{
- std::lock_guard<std::mutex> guard(s_criticalScreenshot);
-
- if (!TextureToPng(reinterpret_cast<u8*>(m_screenshot_readback_texture->GetMapPointer()),
- static_cast<int>(m_screenshot_readback_texture->GetRowStride()),
- s_sScreenshotName, static_cast<int>(m_screenshot_render_texture->GetWidth()),
- static_cast<int>(m_screenshot_render_texture->GetHeight()), false))
- {
- WARN_LOG(VIDEO, "Failed to write screenshot to %s", s_sScreenshotName.c_str());
- }
-
- s_sScreenshotName.clear();
- s_bScreenshot = false;
- s_screenshotCompleted.Set();
-}
-
void Renderer::CheckForTargetResize(u32 fb_width, u32 fb_stride, u32 fb_height)
{
if (FramebufferManagerBase::LastXfbWidth() == fb_stride &&