Shutdown Vulkan properly

Well, as properly as can be considering how little is started up :P
This commit is contained in:
Bill Currie 2019-07-07 14:34:02 +09:00
parent ab08e4f207
commit 940ef833ae
2 changed files with 10 additions and 1 deletions

View file

@ -46,6 +46,7 @@ INSTANCE_LEVEL_VULKAN_FUNCTION_EXTENSION (vkCreateDebugUtilsMessengerEXT)
#define DEVICE_LEVEL_VULKAN_FUNCTION(function)
#endif
DEVICE_LEVEL_VULKAN_FUNCTION (vkDestroyDevice)
DEVICE_LEVEL_VULKAN_FUNCTION (vkGetDeviceQueue)
#undef DEVICE_LEVEL_VULKAN_FUNCTION

View file

@ -214,7 +214,7 @@ Vulkan_Init_Common (void)
}
if (developer->int_val & SYS_VID) {
Sys_Printf ("%p %p\n", vulkan_device->device, vulkan_device->queue);
Vulkan_DestroyInstance (vulkan_instance);
Vulkan_Shutdown_Common ();
Sys_Quit();
}
}
@ -222,5 +222,13 @@ Vulkan_Init_Common (void)
void
Vulkan_Shutdown_Common (void)
{
if (vulkan_device) {
vulkan_device->vkDestroyDevice (vulkan_device->device, 0);
free (vulkan_device);
vulkan_device = 0;
}
Vulkan_DestroyInstance (vulkan_instance);
vulkan_instance = 0;
dlclose (vulkan_library);
vulkan_library = 0;
}