panvk: Export vk_icdGetPhysicalDeviceProcAddr

Support Loader ICD Interface Version 4 by exporting the function
vk_icdGetPhysicalDeviceProcAddr.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14299>
This commit is contained in:
Charles Giessen
2021-12-23 13:29:11 -06:00
committed by Samuel Pitoiset
parent 5a37cc1186
commit b00fe27015

View File

@@ -1120,6 +1120,23 @@ vk_icdGetInstanceProcAddr(VkInstance instance, const char *pName)
return panvk_GetInstanceProcAddr(instance, pName);
}
/* With version 4+ of the loader interface the ICD should expose
* vk_icdGetPhysicalDeviceProcAddr()
*/
PUBLIC
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
vk_icdGetPhysicalDeviceProcAddr(VkInstance _instance,
const char* pName);
PFN_vkVoidFunction
vk_icdGetPhysicalDeviceProcAddr(VkInstance _instance,
const char* pName)
{
VK_FROM_HANDLE(panvk_instance, instance, _instance);
return vk_instance_get_physical_device_proc_addr(&instance->vk, pName);
}
VkResult
panvk_AllocateMemory(VkDevice _device,
const VkMemoryAllocateInfo *pAllocateInfo,
@@ -1657,8 +1674,11 @@ vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *pSupportedVersion)
* - The ICD must implement vkCreate{PLATFORM}SurfaceKHR(),
* vkDestroySurfaceKHR(), and other API which uses VKSurfaceKHR,
* because the loader no longer does so.
*
* - Loader interface v4 differs from v3 in:
* - The ICD must implement vk_icdGetPhysicalDeviceProcAddr().
*/
*pSupportedVersion = MIN2(*pSupportedVersion, 3u);
*pSupportedVersion = MIN2(*pSupportedVersion, 4u);
return VK_SUCCESS;
}