mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Vulkan: Cache destroy device callback.
This commit is contained in:
parent
58703de05c
commit
4abb0ef331
@ -32,6 +32,7 @@
|
|||||||
static dylib_t vulkan_library;
|
static dylib_t vulkan_library;
|
||||||
static VkInstance cached_instance;
|
static VkInstance cached_instance;
|
||||||
static VkDevice cached_device;
|
static VkDevice cached_device;
|
||||||
|
static retro_vulkan_destroy_device_t cached_destroy_device;
|
||||||
|
|
||||||
#ifdef VULKAN_DEBUG
|
#ifdef VULKAN_DEBUG
|
||||||
static VKAPI_ATTR VkBool32 VKAPI_CALL vulkan_debug_cb(
|
static VKAPI_ATTR VkBool32 VKAPI_CALL vulkan_debug_cb(
|
||||||
@ -1279,6 +1280,12 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cached_device && cached_destroy_device)
|
||||||
|
{
|
||||||
|
vk->context.destroy_device = cached_destroy_device;
|
||||||
|
cached_destroy_device = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (vk->context.gpu == VK_NULL_HANDLE)
|
if (vk->context.gpu == VK_NULL_HANDLE)
|
||||||
{
|
{
|
||||||
if (vkEnumeratePhysicalDevices(vk->context.instance,
|
if (vkEnumeratePhysicalDevices(vk->context.instance,
|
||||||
@ -1826,6 +1833,7 @@ void vulkan_context_destroy(gfx_ctx_vulkan_data_t *vk,
|
|||||||
{
|
{
|
||||||
cached_device = vk->context.device;
|
cached_device = vk->context.device;
|
||||||
cached_instance = vk->context.instance;
|
cached_instance = vk->context.instance;
|
||||||
|
cached_destroy_device = vk->context.destroy_device;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user