[Vulkan] Fix freeing the swap chain surface twice during error shutdown.
This commit is contained in:
parent
4f7bfe8816
commit
0a75f68e88
|
@ -102,7 +102,6 @@ bool VulkanContext::Initialize() {
|
|||
provider->device());
|
||||
if (swap_chain_->Initialize(surface) != VK_SUCCESS) {
|
||||
XELOGE("Unable to initialize swap chain");
|
||||
vkDestroySurfaceKHR(*provider->instance(), surface, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -111,7 +110,6 @@ bool VulkanContext::Initialize() {
|
|||
status = immediate_drawer_->Initialize();
|
||||
if (status != VK_SUCCESS) {
|
||||
XELOGE("Failed to initialize the immediate mode drawer");
|
||||
vkDestroySurfaceKHR(*provider->instance(), surface, nullptr);
|
||||
immediate_drawer_.reset();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -245,6 +245,9 @@ bool VulkanInstance::CreateInstance() {
|
|||
instance_info.ppEnabledExtensionNames = enabled_extensions.data();
|
||||
|
||||
auto err = vkCreateInstance(&instance_info, nullptr, &handle);
|
||||
if (err != VK_SUCCESS) {
|
||||
XELOGE("vkCreateInstance returned %s", to_string(err));
|
||||
}
|
||||
switch (err) {
|
||||
case VK_SUCCESS:
|
||||
// Ok!
|
||||
|
|
Loading…
Reference in New Issue