mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Vulkan: Fix segfault on swapchain fail.
This at least allows us to detect that the backend failed to init. Happens when switching backends with debugger attached (probably driver bug?)
This commit is contained in:
parent
9e65ae1cef
commit
8edc6eaf5e
@ -137,6 +137,7 @@ VkResult VulkanContext::CreateInstance(const char *app_name, int app_ver, uint32
|
||||
if (res != VK_SUCCESS) {
|
||||
init_error_ = "Failed to enumerate physical devices";
|
||||
vkDestroyInstance(instance_, nullptr);
|
||||
instance_ = nullptr;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ private:
|
||||
|
||||
std::vector<VkDebugReportCallbackEXT> msg_callbacks;
|
||||
|
||||
VkSwapchainKHR swapchain_;
|
||||
VkSwapchainKHR swapchain_ = VK_NULL_HANDLE;
|
||||
VkFormat swapchainFormat_;
|
||||
|
||||
uint32_t queue_count = 0;
|
||||
|
@ -208,7 +208,8 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
|
||||
}
|
||||
|
||||
void WindowsVulkanContext::Shutdown() {
|
||||
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
if (draw_)
|
||||
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user