diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 5d97b04994..9545a0eb02 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -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,