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.
This commit is contained in:
Stenzek 2017-11-23 16:53:44 +10:00
commit 32125cf181
5 changed files with 48 additions and 24 deletions

View file

@ -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();