summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-11-26 11:36:10 +0100
committerGitHub <noreply@github.com>2017-11-26 11:36:10 +0100
commit96e094e127b2abd72c06d7803f5d8ee8e7ad8aa0 (patch)
treedf4204128c08e5f6da0a52817898e4ead0fa9789 /Source/Core/VideoCommon
parent7e24b093013d4dac14c4adea31322fd0b527d639 (diff)
parentcf1f97514866a655f0d497ab61c9c392d83bef6c (diff)
Merge pull request #6216 from stenzek/headless-frame-dumping
OGL: Fix headless frame dumping
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp8
-rw-r--r--Source/Core/VideoCommon/RenderBase.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 4a46475344..2edd6dcfd5 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -94,6 +94,7 @@ Renderer::Renderer(int backbuffer_width, int backbuffer_height)
if (SConfig::GetInstance().bWii)
m_aspect_wide = Config::Get(Config::SYSCONF_WIDESCREEN);
+ m_surface_handle = Host_GetRenderHandle();
m_last_host_config_bits = ShaderHostConfig::GetCurrent().bits;
}
@@ -400,6 +401,11 @@ float Renderer::CalculateDrawAspectRatio() const
}
}
+bool Renderer::IsHeadless() const
+{
+ return !m_surface_handle;
+}
+
std::tuple<float, float> Renderer::ScaleToDisplayAspectRatio(const int width,
const int height) const
{
@@ -711,7 +717,7 @@ void Renderer::DoDumpFrame()
void Renderer::UpdateFrameDumpTexture()
{
int target_width, target_height;
- if (!g_ActiveConfig.bInternalResolutionFrameDumps)
+ if (!g_ActiveConfig.bInternalResolutionFrameDumps && !IsHeadless())
{
auto target_rect = GetTargetRectangle();
target_width = target_rect.GetWidth();
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index b622372b90..1edb5c75d4 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -94,6 +94,7 @@ public:
const TargetRectangle& GetTargetRectangle() const { return m_target_rectangle; }
float CalculateDrawAspectRatio() const;
+ bool IsHeadless() const;
std::tuple<float, float> ScaleToDisplayAspectRatio(int width, int height) const;
void UpdateDrawRectangle();
@@ -176,9 +177,10 @@ protected:
static const float GX_MAX_DEPTH;
+ void* m_surface_handle = nullptr;
+ void* m_new_surface_handle = nullptr;
Common::Flag m_surface_needs_change;
Common::Event m_surface_changed;
- void* m_new_surface_handle = nullptr;
u32 m_last_host_config_bits = 0;