mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-04-23 13:00:24 -05:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user