diff options
author | Jason Ekstrand <[email protected]> | 2018-01-20 10:39:16 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-01-23 00:15:40 -0800 |
commit | de00e8227b00740e3fe91c5c8fd0b2498751606c (patch) | |
tree | 3658a0db8123e86fb22b4a92aeab22d860b31375 /src/intel/vulkan/anv_device.c | |
parent | eac29f3a6dc7f2659cdb34301a57b2618db1ed12 (diff) |
anv: Return trampoline entrypoints from GetInstanceProcAddr
Technically, the Vulkan spec requires that we return valid entrypoints
for all core functionality and any available device extensions. This
means that, for gen-specific functions, we need to return a trampoline
which looks at the device and calls the right device function. In 99%
of cases, the loader will do this for us but, aparently, we're supposed
to do it too. It's a tiny increase in binary size for us to carry this
around but really not bad.
Before:
text data bss dec hex filename
3541775 204112 6136 3752023 394057 libvulkan_intel.so
After:
text data bss dec hex filename
3551463 205632 6136 3763231 396c1f libvulkan_intel.so
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 8fcc73eaba1..0cba17aa169 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -582,8 +582,11 @@ VkResult anv_CreateInstance( if (!anv_entrypoint_is_enabled(i, instance->apiVersion, &instance->enabled_extensions, NULL)) { instance->dispatch.entrypoints[i] = NULL; - } else { + } else if (anv_dispatch_table.entrypoints[i] != NULL) { instance->dispatch.entrypoints[i] = anv_dispatch_table.entrypoints[i]; + } else { + instance->dispatch.entrypoints[i] = + anv_tramp_dispatch_table.entrypoints[i]; } } |