mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Fix crash when using multiple physical devices and HW core (#14889)
* [Vulkan] Detect if wrong PhysicalDevice is returned. * [Vulkan] Actually query physical device before creating core device.
This commit is contained in:
parent
9fbd62d7b8
commit
f7a9d64d73
@ -1584,6 +1584,9 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
||||
iface = NULL;
|
||||
}
|
||||
|
||||
if (!vulkan_context_init_gpu(vk))
|
||||
return false;
|
||||
|
||||
if (!cached_device_vk && iface && iface->create_device)
|
||||
{
|
||||
struct retro_vulkan_context context = { 0 };
|
||||
@ -1605,6 +1608,9 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vk->context.gpu != VK_NULL_HANDLE && context.gpu != vk->context.gpu)
|
||||
RARCH_ERR("[Vulkan]: Got unexpected VkPhysicalDevice, despite RetroArch using explicit physical device.\n");
|
||||
|
||||
vk->context.destroy_device = iface->destroy_device;
|
||||
|
||||
vk->context.device = context.device;
|
||||
@ -1626,9 +1632,6 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
|
||||
cached_destroy_device_vk = NULL;
|
||||
}
|
||||
|
||||
if (!vulkan_context_init_gpu(vk))
|
||||
return false;
|
||||
|
||||
vkGetPhysicalDeviceProperties(vk->context.gpu,
|
||||
&vk->context.gpu_properties);
|
||||
vkGetPhysicalDeviceMemoryProperties(vk->context.gpu,
|
||||
|
Loading…
x
Reference in New Issue
Block a user