From e93e3160e068cdeddf95f3bd001d185abe7e7953 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Mon, 29 Jun 2015 16:09:23 -0600 Subject: loader: Need to use ICD's GetDeviceProcAddr The loader_GetDeviceProcAddr is the terminator for the CreateDevice chain. It needs to call the ICD's GetDeviceProcAddr to get the correct function pointer not the object's current dispatch table that points at the beginning of the chain. Saw issue when running cube with only DRAW_STATE layer enabled. --- loader/loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/loader/loader.c b/loader/loader.c index 30a5101f..139c0ece 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1449,8 +1449,6 @@ static VkResult scratch_vkCreateDevice( static void * VKAPI loader_GetDeviceChainProcAddr(VkDevice device, const char * name) { - const VkLayerDispatchTable *disp_table = * (VkLayerDispatchTable **) device; - /* CreateDevice workaround: Make the terminator be a scratch function * that does nothing since we have already called the ICD's create device. * We can then call down the device chain and have all the layers get set up. @@ -1460,7 +1458,9 @@ static void * VKAPI loader_GetDeviceChainProcAddr(VkDevice device, const char * if (!strcmp(name, "vkCreateDevice")) return (void *) scratch_vkCreateDevice; - return disp_table->GetDeviceProcAddr(device, name); + struct loader_device *found_dev; + struct loader_icd *icd = loader_get_icd_and_device(device, &found_dev); + return icd->GetDeviceProcAddr(device, name); } static uint32_t loader_activate_device_layers( -- cgit v1.2.3