HostDisplay: Simplify method naming

Match PCSX2.
This commit is contained in:
Connor McLaughlin
2022-12-04 13:22:11 +10:00
parent 6f868e8d2a
commit eafa4fb1a3
15 changed files with 140 additions and 140 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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