aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-29 16:09:23 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-29 16:09:23 -0600
commite93e3160e068cdeddf95f3bd001d185abe7e7953 (patch)
tree1c4a641f7cbf53b1387fcb6851cab8fd714cebea /loader
parentd5490f20cfdf2703493b3c1ef32dfe0462983cb3 (diff)
downloadusermoji-e93e3160e068cdeddf95f3bd001d185abe7e7953.tar.xz
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.
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.c6
1 files 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(