diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-11-17 15:31:02 -0700 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-11-18 17:05:38 -0700 |
| commit | 01261e73d94be281a6b8bc73e088333841fb83d6 (patch) | |
| tree | 422905de73cc57fc3340522c598c5304187fa7de /loader/table_ops.h | |
| parent | e716d2ed830a7080604a7d6b66224ff88c0f14b6 (diff) | |
| download | usermoji-01261e73d94be281a6b8bc73e088333841fb83d6.tar.xz | |
loader: Add dynamic dispatch for unknown device extension entrypoints
GetInstancePorcAddr() is specified to return trampoline entrypoints for all
Vulkan core and extension entrypoints that are dispatched on an instance object
or a child of that instance object. However, typically, device extensions would
be unknown to the loader (don't want to rev the loader everytime an IHV creates
a new device extension).
This patch allows loader to dynamically discover device extension entrypoints
and configure generic trampoline code for these discovered device extensions.
Diffstat (limited to 'loader/table_ops.h')
| -rw-r--r-- | loader/table_ops.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/loader/table_ops.h b/loader/table_ops.h index 2b113e36..e468b0d9 100644 --- a/loader/table_ops.h +++ b/loader/table_ops.h @@ -31,11 +31,19 @@ #include "loader.h" #include "vk_loader_platform.h" -static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table, +static VkResult vkDevExtError(VkDevice dev) +{ + return VK_ERROR_INITIALIZATION_FAILED; +} + +static inline void loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa, VkDevice dev_next, VkDevice dev) { + VkLayerDispatchTable *table = &dev_table->core_dispatch; + for (uint32_t i = 0; i < MAX_NUM_DEV_EXTS; i++) + dev_table->ext_dispatch.DevExt[i] = (PFN_vkDevExt) vkDevExtError; // If layer is next, this will trigger layers to initialize their dispatch tables //then use the gpa in their dispatch for subsequent layers in the chain table->GetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) gpa(dev_next, "vkGetDeviceProcAddr"); |
