diff options
author | Jason Ekstrand <[email protected]> | 2018-01-16 18:11:03 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-01-23 00:15:40 -0800 |
commit | 0c399dca51d2aa1a784edcb6e409aba5b67e1473 (patch) | |
tree | 1ad4cb7c3adecece41a435d5972cc4c34761e981 /src/intel/vulkan/anv_device.c | |
parent | a372b9247ddcaa43d13cf8161d2026c239d0bf57 (diff) |
anv: Add a per-instance dispatch table
We also switch GetInstanceProcAddr over to use it.
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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index c3a8fbbb4e6..d827aec9a71 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -574,6 +574,7 @@ VkResult anv_CreateInstance( instance->apiVersion = client_version; instance->enabled_extensions = enabled_extensions; + instance->dispatch = anv_dispatch_table; instance->physicalDeviceCount = -1; result = vk_debug_report_instance_init(&instance->debug_report_callbacks); @@ -1088,7 +1089,11 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr( if (instance == NULL) return NULL; - return anv_lookup_entrypoint(NULL, pName); + int idx = anv_get_entrypoint_index(pName); + if (idx < 0) + return NULL; + + return instance->dispatch.entrypoints[idx]; } /* With version 1+ of the loader interface the ICD should expose |