anv: Add a vk_icdGetInstanceProcAddr entrypoint
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 12 Feb 2016 05:18:02 +0000 (21:18 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 12 Feb 2016 05:20:12 +0000 (21:20 -0800)
Aparently there are some issues in symbol resolution if an application
packages its own loader and you have a system-installed one.  I don't
really understand the details, but it's not onorous to add.

src/vulkan/anv_device.c

index 21184c4a2018f6308c701e5ad46697ebd565378e..d313d570e2993ad4625dc82355888358ffeef37b 100644 (file)
@@ -611,6 +611,20 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr(
    return anv_lookup_entrypoint(pName);
 }
 
+/* The loader wants us to expose a second GetInstanceProcAddr function
+ * to work around certain LD_PRELOAD issues seen in apps.
+ */
+VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
+    VkInstance                                  instance,
+    const char*                                 pName);
+
+VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
+    VkInstance                                  instance,
+    const char*                                 pName)
+{
+   return anv_GetInstanceProcAddr(instance, pName);
+}
+
 PFN_vkVoidFunction anv_GetDeviceProcAddr(
     VkDevice                                    device,
     const char*                                 pName)