vulkan/device_select: remove get_pdevice_proc_addr

It is optional and is needed only when a layer has physical device
extensions that may be unknown to the loader.

This simplifies the layer a bit, but more importantly, it works around a
bug in the loader when there is another layer in the layer chain that
wraps VkInstance.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16307>
This commit is contained in:
Chia-I Wu 2022-05-03 10:55:03 -07:00 committed by Marge Bot
parent 259449e573
commit 3831079fdf
1 changed files with 0 additions and 9 deletions

View File

@ -47,7 +47,6 @@ struct instance_info {
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
@ -167,7 +166,6 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
info->has_vulkan11 = pCreateInfo->pApplicationInfo &&
pCreateInfo->pApplicationInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0);
info->GetPhysicalDeviceProcAddr = (PFN_GetPhysicalDeviceProcAddr)info->GetInstanceProcAddr(*pInstance, "vk_layerGetPhysicalDeviceProcAddr");
#define DEVSEL_GET_CB(func) info->func = (PFN_vk##func)info->GetInstanceProcAddr(*pInstance, "vk" #func)
DEVSEL_GET_CB(DestroyInstance);
DEVSEL_GET_CB(EnumeratePhysicalDevices);
@ -607,12 +605,6 @@ out:
return result;
}
static void (*get_pdevice_proc_addr(VkInstance instance, const char* name))()
{
struct instance_info *info = device_select_layer_get_instance(instance);
return info->GetPhysicalDeviceProcAddr(instance, name);
}
static void (*get_instance_proc_addr(VkInstance instance, const char* name))()
{
if (strcmp(name, "vkGetInstanceProcAddr") == 0)
@ -637,7 +629,6 @@ VK_LAYER_EXPORT VkResult vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayer
pVersionStruct->loaderLayerInterfaceVersion = 2;
pVersionStruct->pfnGetInstanceProcAddr = get_instance_proc_addr;
pVersionStruct->pfnGetPhysicalDeviceProcAddr = get_pdevice_proc_addr;
return VK_SUCCESS;
}