Merge pull request #6216 from stenzek/headless-frame-dumping

OGL: Fix headless frame dumping
This commit is contained in:
Markus Wick
2017-11-26 11:36:10 +01:00
committed by GitHub
8 changed files with 70 additions and 44 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();

View File

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