System: Move present skip check to core

This commit is contained in:
Connor McLaughlin
2022-08-18 23:51:43 +10:00
parent de21ff250c
commit c7e8233b7b
13 changed files with 39 additions and 34 deletions

View File

@ -394,7 +394,7 @@ void Host::DisplayLoadingScreen(const char* message, int progress_min /*= -1*/,
ImGui::End();
ImGui::EndFrame();
g_host_display->Render();
g_host_display->Render(false);
ImGui::NewFrame();
}

View File

@ -745,9 +745,9 @@ bool D3D11HostDisplay::UpdateImGuiFontTexture()
return true;
}
bool D3D11HostDisplay::Render()
bool D3D11HostDisplay::Render(bool skip_present)
{
if (ShouldSkipDisplayingFrame() || !m_swap_chain)
if (skip_present || !m_swap_chain)
{
if (ImGui::GetCurrentContext())
ImGui::Render();

View File

@ -67,7 +67,7 @@ public:
void SetVSync(bool enabled) override;
bool Render() override;
bool Render(bool skip_present) override;
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
HostDisplayPixelFormat* out_format) override;

View File

@ -650,9 +650,9 @@ bool D3D12HostDisplay::UpdateImGuiFontTexture()
return ImGui_ImplDX12_CreateFontsTexture();
}
bool D3D12HostDisplay::Render()
bool D3D12HostDisplay::Render(bool skip_present)
{
if (ShouldSkipDisplayingFrame() || !m_swap_chain)
if (skip_present || !m_swap_chain)
{
if (ImGui::GetCurrentContext())
ImGui::Render();

View File

@ -68,7 +68,7 @@ public:
virtual void SetVSync(bool enabled) override;
virtual bool Render() override;
virtual bool Render(bool skip_present) override;
virtual bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
HostDisplayPixelFormat* out_format) override;

View File

@ -738,9 +738,9 @@ void OpenGLHostDisplay::DestroyResources()
m_display_program.Destroy();
}
bool OpenGLHostDisplay::Render()
bool OpenGLHostDisplay::Render(bool skip_present)
{
if (ShouldSkipDisplayingFrame())
if (skip_present || m_window_info.type == WindowInfo::Type::Surfaceless)
{
if (ImGui::GetCurrentContext())
ImGui::Render();

View File

@ -58,7 +58,7 @@ public:
void SetVSync(bool enabled) override;
bool Render() override;
bool Render(bool skip_present) override;
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
HostDisplayPixelFormat* out_format) override;

View File

@ -572,9 +572,9 @@ bool VulkanHostDisplay::DoneRenderContextCurrent()
return true;
}
bool VulkanHostDisplay::Render()
bool VulkanHostDisplay::Render(bool skip_present)
{
if (ShouldSkipDisplayingFrame() || !m_swap_chain)
if (skip_present || !m_swap_chain)
{
if (ImGui::GetCurrentContext())
ImGui::Render();

View File

@ -63,7 +63,7 @@ public:
void SetVSync(bool enabled) override;
bool Render() override;
bool Render(bool skip_present) override;
bool RenderScreenshot(u32 width, u32 height, std::vector<u32>* out_pixels, u32* out_stride,
HostDisplayPixelFormat* out_format) override;