diff options
| author | Stenzek <stenzek@gmail.com> | 2017-11-23 16:53:44 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-11-23 16:53:55 +1000 |
| commit | 32125cf1817b57f0b6eb390409ba7167a1671cf7 (patch) | |
| tree | cc043e67e9ea25c2c9defaad6993ff0f8e675bab /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | ab44536a3c5e03851a94848c8c08779d11eedf3d (diff) | |
OGL: Fix headless frame dumping
Also skips swapping the window system buffers in headless mode, as there
may not be a surface which can be swapped in the first place. Instead,
we call glFlush() at the end of a frame in this case.
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 8 |
1 files changed, 7 insertions, 1 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(); |
