mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 02:29:59 -06:00
Move Presenting, Dumping and ImGui out of Renderer
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
|
||||
#include "VideoCommon/DriverDetails.h"
|
||||
#include "VideoCommon/FramebufferManager.h"
|
||||
#include "VideoCommon/Present.h"
|
||||
#include "VideoCommon/RenderState.h"
|
||||
#include "VideoCommon/VertexManagerBase.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
@ -379,7 +380,7 @@ void Renderer::ExecuteCommandBuffer(bool submit_off_thread, bool wait_for_comple
|
||||
|
||||
void Renderer::CheckForSurfaceChange()
|
||||
{
|
||||
if (!m_surface_changed.TestAndClear() || !m_swap_chain)
|
||||
if (!g_presenter->SurfaceChangedTestAndClear() || !m_swap_chain)
|
||||
return;
|
||||
|
||||
// Submit the current draws up until rendering the XFB.
|
||||
@ -389,9 +390,8 @@ void Renderer::CheckForSurfaceChange()
|
||||
g_command_buffer_mgr->CheckLastPresentFail();
|
||||
|
||||
// Recreate the surface. If this fails we're in trouble.
|
||||
if (!m_swap_chain->RecreateSurface(m_new_surface_handle))
|
||||
if (!m_swap_chain->RecreateSurface(g_presenter->GetNewSurfaceHandle()))
|
||||
PanicAlertFmt("Failed to recreate Vulkan surface. Cannot continue.");
|
||||
m_new_surface_handle = nullptr;
|
||||
|
||||
// Handle case where the dimensions are now different.
|
||||
OnSwapChainResized();
|
||||
@ -399,7 +399,7 @@ void Renderer::CheckForSurfaceChange()
|
||||
|
||||
void Renderer::CheckForSurfaceResize()
|
||||
{
|
||||
if (!m_surface_resized.TestAndClear())
|
||||
if (!g_presenter->SurfaceResizedTestAndClear())
|
||||
return;
|
||||
|
||||
// If we don't have a surface, how can we resize the swap chain?
|
||||
@ -450,8 +450,7 @@ void Renderer::OnConfigChanged(u32 bits)
|
||||
|
||||
void Renderer::OnSwapChainResized()
|
||||
{
|
||||
m_backbuffer_width = m_swap_chain->GetWidth();
|
||||
m_backbuffer_height = m_swap_chain->GetHeight();
|
||||
g_presenter->SetBackbuffer(m_swap_chain->GetWidth(), m_swap_chain->GetHeight());
|
||||
}
|
||||
|
||||
void Renderer::BindFramebuffer(VKFramebuffer* fb)
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "VideoBackends/Vulkan/ObjectCache.h"
|
||||
#include "VideoBackends/Vulkan/VKTexture.h"
|
||||
#include "VideoBackends/Vulkan/VulkanContext.h"
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
#include "VideoCommon/Present.h"
|
||||
|
||||
#if defined(VK_USE_PLATFORM_XLIB_KHR)
|
||||
#include <X11/Xlib.h>
|
||||
@ -265,8 +265,8 @@ bool SwapChain::CreateSwapChain()
|
||||
VkExtent2D size = surface_capabilities.currentExtent;
|
||||
if (size.width == UINT32_MAX)
|
||||
{
|
||||
size.width = std::max(g_renderer->GetBackbufferWidth(), 1);
|
||||
size.height = std::max(g_renderer->GetBackbufferHeight(), 1);
|
||||
size.width = std::max(g_presenter->GetBackbufferWidth(), 1);
|
||||
size.height = std::max(g_presenter->GetBackbufferHeight(), 1);
|
||||
}
|
||||
size.width = std::clamp(size.width, surface_capabilities.minImageExtent.width,
|
||||
surface_capabilities.maxImageExtent.width);
|
||||
|
Reference in New Issue
Block a user