diff options
author | Eric Engestrom <[email protected]> | 2019-09-03 13:54:35 +0300 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2019-09-20 08:31:58 +0000 |
commit | 19db95e78eb03d598c60487cc7939a507784530f (patch) | |
tree | ec59f15bfa5d8134577cb968300e5b2468f05e93 /src/intel/vulkan/anv_device.c | |
parent | 88b8922f57137e75c8ea48969e27a8275adbdf5a (diff) |
anv: split instance dispatch table
This effectively breaks the instance dispatch table in 2 with entry
points using a physical device as first argument getting their own
dispatch table.
As a result we now have to check instance & physical device dispatch
table instead of just the instance dispatch table before.
Signed-off-by: Eric Engestrom <[email protected]>
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index bb1834e1867..391a5576306 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -750,6 +750,20 @@ VkResult anv_CreateInstance( } } + struct anv_physical_device *pdevice = &instance->physicalDevice; + for (unsigned i = 0; i < ARRAY_SIZE(pdevice->dispatch.entrypoints); i++) { + /* Vulkan requires that entrypoints for extensions which have not been + * enabled must not be advertised. + */ + if (!anv_physical_device_entrypoint_is_enabled(i, instance->app_info.api_version, + &instance->enabled_extensions)) { + pdevice->dispatch.entrypoints[i] = NULL; + } else { + pdevice->dispatch.entrypoints[i] = + anv_physical_device_dispatch_table.entrypoints[i]; + } + } + for (unsigned i = 0; i < ARRAY_SIZE(instance->device_dispatch.entrypoints); i++) { /* Vulkan requires that entrypoints for extensions which have not been * enabled must not be advertised. @@ -1964,6 +1978,10 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr( if (idx >= 0) return instance->dispatch.entrypoints[idx]; + idx = anv_get_physical_device_entrypoint_index(pName); + if (idx >= 0) + return instance->physicalDevice.dispatch.entrypoints[idx]; + idx = anv_get_device_entrypoint_index(pName); if (idx >= 0) return instance->device_dispatch.entrypoints[idx]; |