diff --git a/common/video/vulkan/vulkan_context.cpp b/common/video/vulkan/vulkan_context.cpp index 7c9b2f95..8cf4ae4e 100644 --- a/common/video/vulkan/vulkan_context.cpp +++ b/common/video/vulkan/vulkan_context.cpp @@ -100,7 +100,7 @@ bool Context::init_win32() if (!instance) return false; - return init(preferred_device); + return init(); } bool Context::create_win32_surface(HINSTANCE hinstance, HWND hwnd) diff --git a/qt/src/EmuCanvasVulkan.cpp b/qt/src/EmuCanvasVulkan.cpp index 20bb6903..eca44852 100644 --- a/qt/src/EmuCanvasVulkan.cpp +++ b/qt/src/EmuCanvasVulkan.cpp @@ -89,7 +89,7 @@ bool EmuCanvasVulkan::createContext() #ifdef _WIN32 auto hwnd = (HWND)winId(); - if (!context->init_win32(nullptr, hwnd, config->display_device_index)) + if (!context->init_win32()) goto fail; if (!context->create_win32_surface(nullptr, hwnd)) goto fail; diff --git a/win32/CVulkan.cpp b/win32/CVulkan.cpp index 9f3a226f..37fb04c5 100644 --- a/win32/CVulkan.cpp +++ b/win32/CVulkan.cpp @@ -62,7 +62,11 @@ bool CVulkan::Initialize(HWND hWnd) try { context = std::make_unique(); - if (!context->init_win32(0, hWnd)) + if (!context->init_win32()) + return false; + if (!context->create_win32_surface(0, hWnd)) + return false; + if (!context->create_swapchain()) return false; } catch (std::exception& e) @@ -180,7 +184,7 @@ bool CVulkan::ChangeRenderSize(unsigned int newWidth, unsigned int newHeight) if (newWidth != current_width || newHeight != current_height) { - context->recreate_swapchain(newWidth, newHeight); + context->recreate_swapchain(); context->wait_idle(); current_width = newWidth; current_height = newHeight;