From 12cbe2143a04d454e0b2b1930b712382c574fc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 26 Jul 2026 14:01:05 +0200 Subject: [PATCH] Rename WindowsVulkanContext to VulkanGraphicsContext, preparing for moving it --- Windows/GPU/WindowsVulkanContext.cpp | 14 +++++++------- Windows/GPU/WindowsVulkanContext.h | 4 ++-- Windows/main.cpp | 2 +- headless/WindowsHeadlessHost.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Windows/GPU/WindowsVulkanContext.cpp b/Windows/GPU/WindowsVulkanContext.cpp index 48f778db89..de0e4d056b 100644 --- a/Windows/GPU/WindowsVulkanContext.cpp +++ b/Windows/GPU/WindowsVulkanContext.cpp @@ -69,7 +69,7 @@ static const bool g_validate_ = true; static const bool g_validate_ = false; #endif -bool WindowsVulkanContext::InitAPI(void *wnd, std::string *deviceName, std::string *errorMessage) { +bool VulkanGraphicsContext::InitAPI(void *wnd, std::string *deviceName, std::string *errorMessage) { *errorMessage = "N/A"; _dbg_assert_(deviceName); @@ -120,7 +120,7 @@ bool WindowsVulkanContext::InitAPI(void *wnd, std::string *deviceName, std::stri return true; } -bool WindowsVulkanContext::InitSurface(WindowSystem winsys, void *data1, void *data2, std::string *errorMessage) { +bool VulkanGraphicsContext::InitSurface(WindowSystem winsys, void *data1, void *data2, std::string *errorMessage) { _dbg_assert_(winsys == WINDOWSYSTEM_WIN32); HINSTANCE hInst = (HINSTANCE)data1; HWND hWnd = (HWND)data2; @@ -162,7 +162,7 @@ bool WindowsVulkanContext::InitSurface(WindowSystem winsys, void *data1, void *d return true; } -void WindowsVulkanContext::ShutdownSurface() { +void VulkanGraphicsContext::ShutdownSurface() { if (draw_) { draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight()); } @@ -175,7 +175,7 @@ void WindowsVulkanContext::ShutdownSurface() { vulkan_->DestroySurface(); } -void WindowsVulkanContext::ShutdownAPI() { +void VulkanGraphicsContext::ShutdownAPI() { vulkan_->DestroyDevice(); vulkan_->DestroyInstance(); @@ -186,7 +186,7 @@ void WindowsVulkanContext::ShutdownAPI() { finalize_glslang(); } -void WindowsVulkanContext::Resize() { +void VulkanGraphicsContext::Resize() { draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight()); VkPresentModeKHR presentMode = ConfigPresentModeToVulkan(draw_); @@ -200,7 +200,7 @@ void WindowsVulkanContext::Resize() { draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight()); } -void WindowsVulkanContext::Poll() { +void VulkanGraphicsContext::Poll() { // Check for existing swapchain to avoid issues during shutdown. if (vulkan_->IsSwapchainInited() && renderManager_->NeedsSwapchainRecreate()) { Resize(); @@ -210,6 +210,6 @@ void WindowsVulkanContext::Poll() { } } -void *WindowsVulkanContext::GetAPIContext() { +void *VulkanGraphicsContext::GetAPIContext() { return vulkan_; } diff --git a/Windows/GPU/WindowsVulkanContext.h b/Windows/GPU/WindowsVulkanContext.h index 7fc97d1bb6..363cdf1c68 100644 --- a/Windows/GPU/WindowsVulkanContext.h +++ b/Windows/GPU/WindowsVulkanContext.h @@ -23,9 +23,9 @@ class VulkanContext; class VulkanRenderManager; -class WindowsVulkanContext : public GraphicsContext { +class VulkanGraphicsContext : public GraphicsContext { public: - WindowsVulkanContext() : draw_(nullptr) {} + VulkanGraphicsContext() : draw_(nullptr) {} bool InitAPI(void *wnd, std::string *deviceName, std::string *errorMessage) override; bool InitSurface(WindowSystem winsys, void *data1, void *data2, std::string *errorMessage); void ShutdownSurface() override; diff --git a/Windows/main.cpp b/Windows/main.cpp index 24737d26ef..3f96935a0c 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -1041,7 +1041,7 @@ static GraphicsContext *CreateGraphicsContext(GPUBackend backend, std::string ** break; case GPUBackend::VULKAN: default: - graphicsContext = new WindowsVulkanContext(); + graphicsContext = new VulkanGraphicsContext(); *deviceName = &g_Config.sVulkanDevice; break; } diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index 02fd1e576e..caa12ba670 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -88,7 +88,7 @@ bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsConte break; case GPUCORE_VULKAN: - graphicsContext = new WindowsVulkanContext(); + graphicsContext = new VulkanGraphicsContext(); break; default: _assert_(false);