mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
device_select: reorder CreateInstance to have shorter failure paths
no functional changes Fixes: 991cc686a5f (egl: really fix kopper fd passing) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
This commit is contained in:
parent
3b2de16fa5
commit
39ae6a891d
1 changed files with 5 additions and 6 deletions
|
|
@ -123,13 +123,10 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
|
|||
break;
|
||||
|
||||
assert(chain_info->u.pLayerInfo);
|
||||
struct instance_info *info = (struct instance_info *)calloc(1, sizeof(struct instance_info));
|
||||
|
||||
info->GetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
|
||||
PFN_vkCreateInstance fpCreateInstance =
|
||||
(PFN_vkCreateInstance)info->GetInstanceProcAddr(NULL, "vkCreateInstance");
|
||||
PFN_vkGetInstanceProcAddr GetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
|
||||
PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)GetInstanceProcAddr(NULL, "vkCreateInstance");
|
||||
if (fpCreateInstance == NULL) {
|
||||
free(info);
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
|
|
@ -137,10 +134,12 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
|
|||
|
||||
VkResult result = fpCreateInstance(pCreateInfo, pAllocator, pInstance);
|
||||
if (result != VK_SUCCESS) {
|
||||
free(info);
|
||||
return result;
|
||||
}
|
||||
|
||||
struct instance_info *info = (struct instance_info *)calloc(1, sizeof(struct instance_info));
|
||||
info->GetInstanceProcAddr = GetInstanceProcAddr;
|
||||
|
||||
for (unsigned i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue