diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-05-28 16:25:02 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-17 20:56:36 -0600 |
| commit | 0d67c29d5d2a2f3383e11279a091a1f164f8eb95 (patch) | |
| tree | e3e1ccc09ecdb9eba13aff5c12ca748787742e84 /loader/loader.c | |
| parent | 813d8d2445d30223a6f46ccf4806f9e41754b333 (diff) | |
| download | usermoji-0d67c29d5d2a2f3383e11279a091a1f164f8eb95.tar.xz | |
loader: Support layers that don't have an extension entrypoint
Change all layers and loader interface to init dispatch tables on
GPA("GetXXXProcAddr"). After that initialization rest of dispatch
tables are inited via unwrapped object using the GPA in the dispatch
table. This also allows App generated GPA calls that the loader can't resolve
to function correctly.
Diffstat (limited to 'loader/loader.c')
| -rw-r--r-- | loader/loader.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/loader/loader.c b/loader/loader.c index 064b3dca..fd234657 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -820,14 +820,12 @@ static void* VKAPI loader_gpa_instance_internal(VkInstance inst, const char * pN VkLayerInstanceDispatchTable* disp_table = * (VkLayerInstanceDispatchTable **) inst; void *addr; + if (!strcmp(pName, "vkGetInstanceProcAddr")) + return (void *) loader_gpa_instance_internal; + if (disp_table == NULL) return NULL; -// addr = debug_report_instance_gpa((struct loader_instance *) inst, pName); -// if (addr) { -// return addr; -// } - addr = loader_lookup_instance_dispatch_table(disp_table, pName); if (addr) { return addr; @@ -1138,7 +1136,7 @@ uint32_t loader_activate_instance_layers(struct loader_instance *inst) layer_idx--; } - loader_init_instance_core_dispatch_table(inst->disp, nextGPA, (VkInstance) nextObj); + loader_init_instance_core_dispatch_table(inst->disp, nextGPA, (VkInstance) nextObj, (VkInstance) baseObj); return inst->layer_count; } @@ -1225,7 +1223,8 @@ extern uint32_t loader_activate_device_layers( layer_idx--; } - loader_init_device_dispatch_table(icd->loader_dispatch + gpu_index, nextGPA, (VkPhysicalDevice) nextObj); + loader_init_device_dispatch_table(icd->loader_dispatch + gpu_index, nextGPA, + (VkPhysicalDevice) nextObj, (VkPhysicalDevice) baseObj); } else { // TODO: Check that active layers match requested? } @@ -1370,7 +1369,7 @@ VkResult loader_EnumeratePhysicalDevices( (wrapped_gpus + i)->nextObject = gpus[i]; memcpy(pPhysicalDevices + count, gpus, sizeof(*pPhysicalDevices)); loader_init_device_dispatch_table(icd->loader_dispatch + i, - get_proc_addr, gpus[i]); + get_proc_addr, gpus[i], gpus[i]); loader_init_dispatch(gpus[i], ptr_instance->disp); } |
