mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Win32: Improvements to vulkan init error handling
This commit is contained in:
parent
766ddf9148
commit
506c4eef17
1 changed files with 11 additions and 0 deletions
|
@ -173,6 +173,12 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
|
|||
|
||||
Version gitVer(PPSSPP_GIT_VERSION);
|
||||
g_Vulkan = new VulkanContext();
|
||||
if (g_Vulkan->InitError().size()) {
|
||||
*error_message = g_Vulkan->InitError();
|
||||
delete g_Vulkan;
|
||||
g_Vulkan = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// int vulkanFlags = VULKAN_FLAG_PRESENT_FIFO_RELAXED;
|
||||
int vulkanFlags = VULKAN_FLAG_PRESENT_MAILBOX;
|
||||
|
@ -181,6 +187,8 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
|
|||
}
|
||||
if (VK_SUCCESS != g_Vulkan->CreateInstance("PPSSPP", gitVer.ToInteger(), vulkanFlags)) {
|
||||
*error_message = g_Vulkan->InitError();
|
||||
delete g_Vulkan;
|
||||
g_Vulkan = nullptr;
|
||||
return false;
|
||||
}
|
||||
g_Vulkan->ChooseDevice(g_Vulkan->GetBestPhysicalDevice());
|
||||
|
@ -189,6 +197,8 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
|
|||
}
|
||||
if (g_Vulkan->CreateDevice() != VK_SUCCESS) {
|
||||
*error_message = g_Vulkan->InitError();
|
||||
delete g_Vulkan;
|
||||
g_Vulkan = nullptr;
|
||||
return false;
|
||||
}
|
||||
if (g_validate_) {
|
||||
|
@ -197,6 +207,7 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
|
|||
}
|
||||
g_Vulkan->InitSurfaceWin32(hInst, hWnd);
|
||||
if (!g_Vulkan->InitObjects()) {
|
||||
*error_message = g_Vulkan->InitError();
|
||||
Shutdown();
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue