From e0e9c56f2bb4f9bc8a560ada38df191728ef5d3d Mon Sep 17 00:00:00 2001 From: Mark Young Date: Fri, 16 Sep 2016 10:18:42 -0600 Subject: loader: More changes for gh181 With Piers' fix, another path was broke because we still needed to intercept the call before it went to the ICD. Now, with his change and this change, all paths work. Also, clean up some code based on comments from Ian and Courtney reviews. Finally, update docs to indicate behavior of new loader 3 interface with ICDs. Change-Id: I2d3f962baffb21c1edeb93b132ffad40f298c8e7 --- loader/loader.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'loader/loader.c') diff --git a/loader/loader.c b/loader/loader.c index 641be744..74ffcd9c 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1653,6 +1653,10 @@ static bool loader_icd_init_entrys(struct loader_icd *icd, VkInstance inst, LOOKUP_GIPA(CreateXlibSurfaceKHR, false); LOOKUP_GIPA(GetPhysicalDeviceXlibPresentationSupportKHR, false); #endif +#ifdef VK_USE_PLATFORM_MIR_KHR + LOOKUP_GIPA(CreateMirSurfaceKHR, false); + LOOKUP_GIPA(GetPhysicalDeviceMirPresentationSupportKHR, false); +#endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR LOOKUP_GIPA(CreateWaylandSurfaceKHR, false); LOOKUP_GIPA(GetPhysicalDeviceWaylandPresentationSupportKHR, false); @@ -3243,6 +3247,22 @@ loader_gpa_instance_internal(VkInstance inst, const char *pName) { return NULL; } +void loader_override_terminating_device_proc( + VkDevice device, struct loader_dev_dispatch_table *disp_table) { + struct loader_device *dev; + struct loader_icd *icd = loader_get_icd_and_device(device, &dev, NULL); + + // Certain device entry-points still need to go through a terminator before + // hitting the ICD. This could be for several reasons, but the main one + // is currently unwrapping an object before passing the appropriate info + // along to the ICD. + if ((PFN_vkVoidFunction)disp_table->core_dispatch.CreateSwapchainKHR == + (PFN_vkVoidFunction)icd->GetDeviceProcAddr(device, + "vkCreateSwapchainKHR")) { + disp_table->core_dispatch.CreateSwapchainKHR = + terminator_vkCreateSwapchainKHR; + } +} VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_device_internal(VkDevice device, const char *pName) { -- cgit v1.2.3