parent
6f868e8d2a
commit
eafa4fb1a3
|
@ -41,8 +41,8 @@ bool GPU_HW_D3D11::Initialize()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_device = static_cast<ID3D11Device*>(g_host_display->GetRenderDevice());
|
||||
m_context = static_cast<ID3D11DeviceContext*>(g_host_display->GetRenderContext());
|
||||
m_device = static_cast<ID3D11Device*>(g_host_display->GetDevice());
|
||||
m_context = static_cast<ID3D11DeviceContext*>(g_host_display->GetContext());
|
||||
if (!m_device || !m_context)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -61,18 +61,18 @@ public:
|
|||
ALWAYS_INLINE bool IsGPUTimingEnabled() const { return m_gpu_timing_enabled; }
|
||||
|
||||
virtual RenderAPI GetRenderAPI() const = 0;
|
||||
virtual void* GetRenderDevice() const = 0;
|
||||
virtual void* GetRenderContext() const = 0;
|
||||
virtual void* GetDevice() const = 0;
|
||||
virtual void* GetContext() const = 0;
|
||||
|
||||
virtual bool HasRenderDevice() const = 0;
|
||||
virtual bool HasRenderSurface() const = 0;
|
||||
virtual bool HasDevice() const = 0;
|
||||
virtual bool HasSurface() const = 0;
|
||||
|
||||
virtual bool CreateRenderDevice(const WindowInfo& wi) = 0;
|
||||
virtual bool InitializeRenderDevice() = 0;
|
||||
virtual bool MakeRenderContextCurrent() = 0;
|
||||
virtual bool DoneRenderContextCurrent() = 0;
|
||||
virtual void DestroyRenderSurface() = 0;
|
||||
virtual bool ChangeRenderWindow(const WindowInfo& wi) = 0;
|
||||
virtual bool CreateDevice(const WindowInfo& wi) = 0;
|
||||
virtual bool SetupDevice() = 0;
|
||||
virtual bool MakeCurrent() = 0;
|
||||
virtual bool DoneCurrent() = 0;
|
||||
virtual void DestroySurface() = 0;
|
||||
virtual bool ChangeWindow(const WindowInfo& wi) = 0;
|
||||
virtual bool SupportsFullscreen() const = 0;
|
||||
virtual bool IsFullscreen() = 0;
|
||||
virtual bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) = 0;
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
virtual bool SetPostProcessingChain(const std::string_view& config) = 0;
|
||||
|
||||
/// Call when the window size changes externally to recreate any resources.
|
||||
virtual void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) = 0;
|
||||
virtual void ResizeWindow(s32 new_window_width, s32 new_window_height) = 0;
|
||||
|
||||
/// Creates an abstracted RGBA8 texture. If dynamic, the texture can be updated with UpdateTexture() below.
|
||||
virtual std::unique_ptr<GPUTexture> CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples,
|
||||
|
|
|
@ -409,7 +409,7 @@ void NoGUIHost::ProcessPlatformWindowResize(s32 width, s32 height, float scale)
|
|||
{
|
||||
Host::RunOnCPUThread([width, height, scale]() {
|
||||
// TODO: Scale
|
||||
g_host_display->ResizeRenderWindow(width, height);
|
||||
g_host_display->ResizeWindow(width, height);
|
||||
ImGuiManager::WindowResized();
|
||||
System::HostDisplayResized();
|
||||
});
|
||||
|
@ -654,12 +654,12 @@ bool NoGUIHost::AcquireHostDisplay(RenderAPI api)
|
|||
if (wi.has_value())
|
||||
{
|
||||
g_host_display = Host::CreateDisplayForAPI(api);
|
||||
if (g_host_display && !g_host_display->CreateRenderDevice(wi.value()))
|
||||
if (g_host_display && !g_host_display->CreateDevice(wi.value()))
|
||||
g_host_display.reset();
|
||||
}
|
||||
|
||||
if (g_host_display)
|
||||
g_host_display->DoneRenderContextCurrent();
|
||||
g_host_display->DoneCurrent();
|
||||
else
|
||||
g_nogui_window->DestroyPlatformWindow();
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ bool NoGUIHost::AcquireHostDisplay(RenderAPI api)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!g_host_display->MakeRenderContextCurrent() || !g_host_display->InitializeRenderDevice() ||
|
||||
if (!g_host_display->MakeCurrent() || !g_host_display->SetupDevice() ||
|
||||
!ImGuiManager::Initialize() || !CommonHost::CreateHostDisplayResources())
|
||||
{
|
||||
ImGuiManager::Shutdown();
|
||||
|
|
|
@ -218,7 +218,7 @@ bool MainWindow::createDisplay(bool fullscreen, bool render_to_main)
|
|||
|
||||
g_emu_thread->connectDisplaySignals(m_display_widget);
|
||||
|
||||
if (!g_host_display->CreateRenderDevice(wi.value()))
|
||||
if (!g_host_display->CreateDevice(wi.value()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to create host display device context."));
|
||||
destroyDisplayWidget(true);
|
||||
|
@ -241,7 +241,7 @@ bool MainWindow::createDisplay(bool fullscreen, bool render_to_main)
|
|||
updateDisplayWidgetCursor();
|
||||
m_display_widget->setFocus();
|
||||
|
||||
g_host_display->DoneRenderContextCurrent();
|
||||
g_host_display->DoneCurrent();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ bool MainWindow::updateDisplay(bool fullscreen, bool render_to_main, bool surfac
|
|||
return true;
|
||||
}
|
||||
|
||||
g_host_display->DestroyRenderSurface();
|
||||
g_host_display->DestroySurface();
|
||||
|
||||
destroyDisplayWidget(surfaceless || fullscreen);
|
||||
|
||||
|
@ -315,7 +315,7 @@ bool MainWindow::updateDisplay(bool fullscreen, bool render_to_main, bool surfac
|
|||
|
||||
g_emu_thread->connectDisplaySignals(m_display_widget);
|
||||
|
||||
if (!g_host_display->ChangeRenderWindow(wi.value()))
|
||||
if (!g_host_display->ChangeWindow(wi.value()))
|
||||
Panic("Failed to recreate surface on new widget.");
|
||||
|
||||
if (is_exclusive_fullscreen)
|
||||
|
|
|
@ -616,7 +616,7 @@ void EmuThread::onDisplayWindowResized(int width, int height)
|
|||
return;
|
||||
|
||||
Log_DevPrintf("Display window resized to %dx%d", width, height);
|
||||
g_host_display->ResizeRenderWindow(width, height);
|
||||
g_host_display->ResizeWindow(width, height);
|
||||
ImGuiManager::WindowResized();
|
||||
System::HostDisplayResized();
|
||||
|
||||
|
@ -742,7 +742,7 @@ bool EmuThread::acquireHostDisplay(RenderAPI api)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!g_host_display->MakeRenderContextCurrent() || !g_host_display->InitializeRenderDevice() ||
|
||||
if (!g_host_display->MakeCurrent() || !g_host_display->SetupDevice() ||
|
||||
!ImGuiManager::Initialize() || !CommonHost::CreateHostDisplayResources())
|
||||
{
|
||||
ImGuiManager::Shutdown();
|
||||
|
@ -790,10 +790,10 @@ void EmuThread::updateDisplayState()
|
|||
return;
|
||||
|
||||
// this expects the context to get moved back to us afterwards
|
||||
g_host_display->DoneRenderContextCurrent();
|
||||
g_host_display->DoneCurrent();
|
||||
|
||||
updateDisplayRequested(m_is_fullscreen, m_is_rendering_to_main && !m_is_fullscreen, m_is_surfaceless);
|
||||
if (!g_host_display->MakeRenderContextCurrent())
|
||||
if (!g_host_display->MakeCurrent())
|
||||
Panic("Failed to make device context current after updating");
|
||||
|
||||
m_is_exclusive_fullscreen = g_host_display->IsFullscreen();
|
||||
|
|
|
@ -18,48 +18,48 @@ RenderAPI RegTestHostDisplay::GetRenderAPI() const
|
|||
return RenderAPI::None;
|
||||
}
|
||||
|
||||
void* RegTestHostDisplay::GetRenderDevice() const
|
||||
void* RegTestHostDisplay::GetDevice() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* RegTestHostDisplay::GetRenderContext() const
|
||||
void* RegTestHostDisplay::GetContext() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::HasRenderDevice() const
|
||||
bool RegTestHostDisplay::HasDevice() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::HasRenderSurface() const
|
||||
bool RegTestHostDisplay::HasSurface() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
||||
bool RegTestHostDisplay::CreateDevice(const WindowInfo& wi)
|
||||
{
|
||||
m_window_info = wi;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::InitializeRenderDevice()
|
||||
bool RegTestHostDisplay::SetupDevice()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::MakeRenderContextCurrent()
|
||||
bool RegTestHostDisplay::MakeCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::DoneRenderContextCurrent()
|
||||
bool RegTestHostDisplay::DoneCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void RegTestHostDisplay::DestroyRenderSurface() {}
|
||||
void RegTestHostDisplay::DestroySurface() {}
|
||||
|
||||
bool RegTestHostDisplay::CreateResources()
|
||||
{
|
||||
|
@ -89,13 +89,13 @@ bool RegTestHostDisplay::UpdateImGuiFontTexture()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool RegTestHostDisplay::ChangeRenderWindow(const WindowInfo& wi)
|
||||
bool RegTestHostDisplay::ChangeWindow(const WindowInfo& wi)
|
||||
{
|
||||
m_window_info = wi;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RegTestHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
|
||||
void RegTestHostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
m_window_info.surface_width = new_window_width;
|
||||
m_window_info.surface_height = new_window_height;
|
||||
|
|
|
@ -9,24 +9,24 @@ public:
|
|||
~RegTestHostDisplay();
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetDevice() const override;
|
||||
void* GetContext() const override;
|
||||
|
||||
bool HasRenderDevice() const override;
|
||||
bool HasRenderSurface() const override;
|
||||
bool HasDevice() const override;
|
||||
bool HasSurface() const override;
|
||||
|
||||
bool CreateRenderDevice(const WindowInfo& wi) override;
|
||||
bool InitializeRenderDevice() override;
|
||||
bool CreateDevice(const WindowInfo& wi) override;
|
||||
bool SetupDevice() override;
|
||||
|
||||
bool MakeRenderContextCurrent() override;
|
||||
bool DoneRenderContextCurrent() override;
|
||||
bool MakeCurrent() override;
|
||||
bool DoneCurrent() override;
|
||||
|
||||
bool ChangeRenderWindow(const WindowInfo& wi) override;
|
||||
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool ChangeWindow(const WindowInfo& wi) override;
|
||||
void ResizeWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool SupportsFullscreen() const override;
|
||||
bool IsFullscreen() override;
|
||||
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||
void DestroyRenderSurface() override;
|
||||
void DestroySurface() override;
|
||||
|
||||
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ D3D11HostDisplay::~D3D11HostDisplay()
|
|||
{
|
||||
DestroyStagingBuffer();
|
||||
DestroyResources();
|
||||
DestroyRenderSurface();
|
||||
DestroySurface();
|
||||
m_context.Reset();
|
||||
m_device.Reset();
|
||||
}
|
||||
|
@ -39,22 +39,22 @@ RenderAPI D3D11HostDisplay::GetRenderAPI() const
|
|||
return RenderAPI::D3D11;
|
||||
}
|
||||
|
||||
void* D3D11HostDisplay::GetRenderDevice() const
|
||||
void* D3D11HostDisplay::GetDevice() const
|
||||
{
|
||||
return m_device.Get();
|
||||
}
|
||||
|
||||
void* D3D11HostDisplay::GetRenderContext() const
|
||||
void* D3D11HostDisplay::GetContext() const
|
||||
{
|
||||
return m_context.Get();
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::HasRenderDevice() const
|
||||
bool D3D11HostDisplay::HasDevice() const
|
||||
{
|
||||
return static_cast<bool>(m_device);
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::HasRenderSurface() const
|
||||
bool D3D11HostDisplay::HasSurface() const
|
||||
{
|
||||
return static_cast<bool>(m_swap_chain);
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ void D3D11HostDisplay::SetVSync(bool enabled)
|
|||
m_vsync = enabled;
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
||||
bool D3D11HostDisplay::CreateDevice(const WindowInfo& wi)
|
||||
{
|
||||
UINT create_flags = 0;
|
||||
if (g_settings.gpu_use_debug_device)
|
||||
|
@ -316,7 +316,7 @@ bool D3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::InitializeRenderDevice()
|
||||
bool D3D11HostDisplay::SetupDevice()
|
||||
{
|
||||
if (!CreateResources())
|
||||
return false;
|
||||
|
@ -324,12 +324,12 @@ bool D3D11HostDisplay::InitializeRenderDevice()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::MakeRenderContextCurrent()
|
||||
bool D3D11HostDisplay::MakeCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::DoneRenderContextCurrent()
|
||||
bool D3D11HostDisplay::DoneCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -449,15 +449,15 @@ bool D3D11HostDisplay::CreateSwapChainRTV()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool D3D11HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
||||
bool D3D11HostDisplay::ChangeWindow(const WindowInfo& new_wi)
|
||||
{
|
||||
DestroyRenderSurface();
|
||||
DestroySurface();
|
||||
|
||||
m_window_info = new_wi;
|
||||
return CreateSwapChain(nullptr);
|
||||
}
|
||||
|
||||
void D3D11HostDisplay::DestroyRenderSurface()
|
||||
void D3D11HostDisplay::DestroySurface()
|
||||
{
|
||||
m_window_info.SetSurfaceless();
|
||||
if (IsFullscreen())
|
||||
|
@ -467,7 +467,7 @@ void D3D11HostDisplay::DestroyRenderSurface()
|
|||
m_swap_chain.Reset();
|
||||
}
|
||||
|
||||
void D3D11HostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
|
||||
void D3D11HostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
if (!m_swap_chain)
|
||||
return;
|
||||
|
|
|
@ -24,25 +24,25 @@ public:
|
|||
~D3D11HostDisplay();
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetDevice() const override;
|
||||
void* GetContext() const override;
|
||||
|
||||
bool HasRenderDevice() const override;
|
||||
bool HasRenderSurface() const override;
|
||||
bool HasDevice() const override;
|
||||
bool HasSurface() const override;
|
||||
|
||||
bool CreateRenderDevice(const WindowInfo& wi) override;
|
||||
bool InitializeRenderDevice() override;
|
||||
bool CreateDevice(const WindowInfo& wi) override;
|
||||
bool SetupDevice() override;
|
||||
|
||||
bool MakeRenderContextCurrent() override;
|
||||
bool DoneRenderContextCurrent() override;
|
||||
bool MakeCurrent() override;
|
||||
bool DoneCurrent() override;
|
||||
|
||||
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool ChangeWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool SupportsFullscreen() const override;
|
||||
bool IsFullscreen() override;
|
||||
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||
AdapterAndModeList GetAdapterAndModeList() override;
|
||||
void DestroyRenderSurface() override;
|
||||
void DestroySurface() override;
|
||||
|
||||
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ D3D12HostDisplay::~D3D12HostDisplay()
|
|||
return;
|
||||
|
||||
// DestroyRenderSurface() will exec the command list.
|
||||
DestroyRenderSurface();
|
||||
DestroySurface();
|
||||
DestroyResources();
|
||||
g_d3d12_context->Destroy();
|
||||
}
|
||||
|
@ -36,22 +36,22 @@ RenderAPI D3D12HostDisplay::GetRenderAPI() const
|
|||
return RenderAPI::D3D12;
|
||||
}
|
||||
|
||||
void* D3D12HostDisplay::GetRenderDevice() const
|
||||
void* D3D12HostDisplay::GetDevice() const
|
||||
{
|
||||
return g_d3d12_context->GetDevice();
|
||||
}
|
||||
|
||||
void* D3D12HostDisplay::GetRenderContext() const
|
||||
void* D3D12HostDisplay::GetContext() const
|
||||
{
|
||||
return g_d3d12_context.get();
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::HasRenderDevice() const
|
||||
bool D3D12HostDisplay::HasDevice() const
|
||||
{
|
||||
return static_cast<bool>(g_d3d12_context);
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::HasRenderSurface() const
|
||||
bool D3D12HostDisplay::HasSurface() const
|
||||
{
|
||||
return static_cast<bool>(m_swap_chain);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void D3D12HostDisplay::SetVSync(bool enabled)
|
|||
m_vsync = enabled;
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
||||
bool D3D12HostDisplay::CreateDevice(const WindowInfo& wi)
|
||||
{
|
||||
ComPtr<IDXGIFactory> temp_dxgi_factory;
|
||||
HRESULT hr = CreateDXGIFactory(IID_PPV_ARGS(temp_dxgi_factory.GetAddressOf()));
|
||||
|
@ -208,7 +208,7 @@ bool D3D12HostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::InitializeRenderDevice()
|
||||
bool D3D12HostDisplay::SetupDevice()
|
||||
{
|
||||
if (!CreateResources())
|
||||
return false;
|
||||
|
@ -216,12 +216,12 @@ bool D3D12HostDisplay::InitializeRenderDevice()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::MakeRenderContextCurrent()
|
||||
bool D3D12HostDisplay::MakeCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::DoneRenderContextCurrent()
|
||||
bool D3D12HostDisplay::DoneCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -338,15 +338,15 @@ void D3D12HostDisplay::DestroySwapChainRTVs()
|
|||
m_current_swap_chain_buffer = 0;
|
||||
}
|
||||
|
||||
bool D3D12HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
||||
bool D3D12HostDisplay::ChangeWindow(const WindowInfo& new_wi)
|
||||
{
|
||||
DestroyRenderSurface();
|
||||
DestroySurface();
|
||||
|
||||
m_window_info = new_wi;
|
||||
return CreateSwapChain(nullptr);
|
||||
}
|
||||
|
||||
void D3D12HostDisplay::DestroyRenderSurface()
|
||||
void D3D12HostDisplay::DestroySurface()
|
||||
{
|
||||
m_window_info.SetSurfaceless();
|
||||
|
||||
|
@ -360,7 +360,7 @@ void D3D12HostDisplay::DestroyRenderSurface()
|
|||
m_swap_chain.Reset();
|
||||
}
|
||||
|
||||
void D3D12HostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
|
||||
void D3D12HostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
if (!m_swap_chain)
|
||||
return;
|
||||
|
|
|
@ -26,25 +26,25 @@ public:
|
|||
~D3D12HostDisplay();
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetDevice() const override;
|
||||
void* GetContext() const override;
|
||||
|
||||
bool HasRenderDevice() const override;
|
||||
bool HasRenderSurface() const override;
|
||||
bool HasDevice() const override;
|
||||
bool HasSurface() const override;
|
||||
|
||||
bool CreateRenderDevice(const WindowInfo& wi) override;
|
||||
bool InitializeRenderDevice() override;
|
||||
bool CreateDevice(const WindowInfo& wi) override;
|
||||
bool SetupDevice() override;
|
||||
|
||||
bool MakeRenderContextCurrent() override;
|
||||
bool DoneRenderContextCurrent() override;
|
||||
bool MakeCurrent() override;
|
||||
bool DoneCurrent() override;
|
||||
|
||||
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool ChangeWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool SupportsFullscreen() const override;
|
||||
bool IsFullscreen() override;
|
||||
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||
AdapterAndModeList GetAdapterAndModeList() override;
|
||||
void DestroyRenderSurface() override;
|
||||
void DestroySurface() override;
|
||||
|
||||
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@ RenderAPI OpenGLHostDisplay::GetRenderAPI() const
|
|||
return m_gl_context->IsGLES() ? RenderAPI::OpenGLES : RenderAPI::OpenGL;
|
||||
}
|
||||
|
||||
void* OpenGLHostDisplay::GetRenderDevice() const
|
||||
void* OpenGLHostDisplay::GetDevice() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* OpenGLHostDisplay::GetRenderContext() const
|
||||
void* OpenGLHostDisplay::GetContext() const
|
||||
{
|
||||
return m_gl_context.get();
|
||||
}
|
||||
|
@ -271,17 +271,17 @@ static void APIENTRY GLDebugCallback(GLenum source, GLenum type, GLuint id, GLen
|
|||
}
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::HasRenderDevice() const
|
||||
bool OpenGLHostDisplay::HasDevice() const
|
||||
{
|
||||
return static_cast<bool>(m_gl_context);
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::HasRenderSurface() const
|
||||
bool OpenGLHostDisplay::HasSurface() const
|
||||
{
|
||||
return m_window_info.type != WindowInfo::Type::Surfaceless;
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
||||
bool OpenGLHostDisplay::CreateDevice(const WindowInfo& wi)
|
||||
{
|
||||
m_gl_context = GL::Context::Create(wi);
|
||||
if (!m_gl_context)
|
||||
|
@ -295,7 +295,7 @@ bool OpenGLHostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::InitializeRenderDevice()
|
||||
bool OpenGLHostDisplay::SetupDevice()
|
||||
{
|
||||
m_use_gles2_draw_path = (GetRenderAPI() == RenderAPI::OpenGLES && !GLAD_GL_ES_VERSION_3_0);
|
||||
if (!m_use_gles2_draw_path)
|
||||
|
@ -334,7 +334,7 @@ bool OpenGLHostDisplay::InitializeRenderDevice()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::MakeRenderContextCurrent()
|
||||
bool OpenGLHostDisplay::MakeCurrent()
|
||||
{
|
||||
if (!m_gl_context->MakeCurrent())
|
||||
{
|
||||
|
@ -345,12 +345,12 @@ bool OpenGLHostDisplay::MakeRenderContextCurrent()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::DoneRenderContextCurrent()
|
||||
bool OpenGLHostDisplay::DoneCurrent()
|
||||
{
|
||||
return m_gl_context->DoneCurrent();
|
||||
}
|
||||
|
||||
bool OpenGLHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
||||
bool OpenGLHostDisplay::ChangeWindow(const WindowInfo& new_wi)
|
||||
{
|
||||
Assert(m_gl_context);
|
||||
|
||||
|
@ -364,7 +364,7 @@ bool OpenGLHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
void OpenGLHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
|
||||
void OpenGLHostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
if (!m_gl_context)
|
||||
return;
|
||||
|
@ -403,7 +403,7 @@ HostDisplay::AdapterAndModeList OpenGLHostDisplay::GetAdapterAndModeList()
|
|||
return aml;
|
||||
}
|
||||
|
||||
void OpenGLHostDisplay::DestroyRenderSurface()
|
||||
void OpenGLHostDisplay::DestroySurface()
|
||||
{
|
||||
if (!m_gl_context)
|
||||
return;
|
||||
|
|
|
@ -17,25 +17,25 @@ public:
|
|||
~OpenGLHostDisplay();
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetDevice() const override;
|
||||
void* GetContext() const override;
|
||||
|
||||
bool HasRenderDevice() const override;
|
||||
bool HasRenderSurface() const override;
|
||||
bool HasDevice() const override;
|
||||
bool HasSurface() const override;
|
||||
|
||||
bool CreateRenderDevice(const WindowInfo& wi) override;
|
||||
bool InitializeRenderDevice() override;
|
||||
bool CreateDevice(const WindowInfo& wi) override;
|
||||
bool SetupDevice() override;
|
||||
|
||||
bool MakeRenderContextCurrent() override;
|
||||
bool DoneRenderContextCurrent() override;
|
||||
bool MakeCurrent() override;
|
||||
bool DoneCurrent() override;
|
||||
|
||||
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool ChangeWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool SupportsFullscreen() const override;
|
||||
bool IsFullscreen() override;
|
||||
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||
AdapterAndModeList GetAdapterAndModeList() override;
|
||||
void DestroyRenderSurface() override;
|
||||
void DestroySurface() override;
|
||||
|
||||
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||
|
||||
|
|
|
@ -43,17 +43,17 @@ RenderAPI VulkanHostDisplay::GetRenderAPI() const
|
|||
return RenderAPI::Vulkan;
|
||||
}
|
||||
|
||||
void* VulkanHostDisplay::GetRenderDevice() const
|
||||
void* VulkanHostDisplay::GetDevice() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* VulkanHostDisplay::GetRenderContext() const
|
||||
void* VulkanHostDisplay::GetContext() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
||||
bool VulkanHostDisplay::ChangeWindow(const WindowInfo& new_wi)
|
||||
{
|
||||
g_vulkan_context->WaitForGPUIdle();
|
||||
|
||||
|
@ -98,7 +98,7 @@ bool VulkanHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
void VulkanHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
|
||||
void VulkanHostDisplay::ResizeWindow(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
g_vulkan_context->WaitForGPUIdle();
|
||||
|
||||
|
@ -128,7 +128,7 @@ HostDisplay::AdapterAndModeList VulkanHostDisplay::GetAdapterAndModeList()
|
|||
return StaticGetAdapterAndModeList(m_window_info.type != WindowInfo::Type::Surfaceless ? &m_window_info : nullptr);
|
||||
}
|
||||
|
||||
void VulkanHostDisplay::DestroyRenderSurface()
|
||||
void VulkanHostDisplay::DestroySurface()
|
||||
{
|
||||
m_window_info.SetSurfaceless();
|
||||
g_vulkan_context->WaitForGPUIdle();
|
||||
|
@ -214,7 +214,7 @@ void VulkanHostDisplay::SetVSync(bool enabled)
|
|||
m_swap_chain->SetVSync(enabled);
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
||||
bool VulkanHostDisplay::CreateDevice(const WindowInfo& wi)
|
||||
{
|
||||
WindowInfo local_wi(wi);
|
||||
if (!Vulkan::Context::Create(g_settings.gpu_adapter, &local_wi, &m_swap_chain, g_settings.gpu_threaded_presentation,
|
||||
|
@ -234,7 +234,7 @@ bool VulkanHostDisplay::CreateRenderDevice(const WindowInfo& wi)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::InitializeRenderDevice()
|
||||
bool VulkanHostDisplay::SetupDevice()
|
||||
{
|
||||
if (!CreateResources())
|
||||
return false;
|
||||
|
@ -242,12 +242,12 @@ bool VulkanHostDisplay::InitializeRenderDevice()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::HasRenderDevice() const
|
||||
bool VulkanHostDisplay::HasDevice() const
|
||||
{
|
||||
return static_cast<bool>(g_vulkan_context);
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::HasRenderSurface() const
|
||||
bool VulkanHostDisplay::HasSurface() const
|
||||
{
|
||||
return static_cast<bool>(m_swap_chain);
|
||||
}
|
||||
|
@ -571,12 +571,12 @@ bool VulkanHostDisplay::UpdateImGuiFontTexture()
|
|||
return ImGui_ImplVulkan_CreateFontsTexture();
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::MakeRenderContextCurrent()
|
||||
bool VulkanHostDisplay::MakeCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VulkanHostDisplay::DoneRenderContextCurrent()
|
||||
bool VulkanHostDisplay::DoneCurrent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ bool VulkanHostDisplay::Render(bool skip_present)
|
|||
{
|
||||
if (res == VK_SUBOPTIMAL_KHR || res == VK_ERROR_OUT_OF_DATE_KHR)
|
||||
{
|
||||
ResizeRenderWindow(0, 0);
|
||||
ResizeWindow(0, 0);
|
||||
res = m_swap_chain->AcquireNextImage();
|
||||
}
|
||||
else if (res == VK_ERROR_SURFACE_LOST_KHR)
|
||||
|
|
|
@ -21,25 +21,25 @@ public:
|
|||
~VulkanHostDisplay();
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetDevice() const override;
|
||||
void* GetContext() const override;
|
||||
|
||||
bool HasRenderDevice() const override;
|
||||
bool HasRenderSurface() const override;
|
||||
bool HasDevice() const override;
|
||||
bool HasSurface() const override;
|
||||
|
||||
bool CreateRenderDevice(const WindowInfo& wi) override;
|
||||
bool InitializeRenderDevice() override;
|
||||
bool CreateDevice(const WindowInfo& wi) override;
|
||||
bool SetupDevice() override;
|
||||
|
||||
bool MakeRenderContextCurrent() override;
|
||||
bool DoneRenderContextCurrent() override;
|
||||
bool MakeCurrent() override;
|
||||
bool DoneCurrent() override;
|
||||
|
||||
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool ChangeWindow(const WindowInfo& new_wi) override;
|
||||
void ResizeWindow(s32 new_window_width, s32 new_window_height) override;
|
||||
bool SupportsFullscreen() const override;
|
||||
bool IsFullscreen() override;
|
||||
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
|
||||
AdapterAndModeList GetAdapterAndModeList() override;
|
||||
void DestroyRenderSurface() override;
|
||||
void DestroySurface() override;
|
||||
|
||||
bool SetPostProcessingChain(const std::string_view& config) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue