diff options
author | Eduardo Lima Mitev <[email protected]> | 2020-03-21 20:18:56 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-24 09:09:14 +0000 |
commit | 4dc7b7627671eeaefda55b21bc9a7a5a06b43c30 (patch) | |
tree | 2983f72e4b6401e1d663e953e6ddf69a6317c001 | |
parent | 665250e8300e2b0f3eae27628a9a6f2666e650dd (diff) |
anv/radv: Resolving 'GetInstanceProcAddr' should not require a valid instance
Since vk_icdGetInstanceProcAddr() is wired through
vkGetInstanceProcAddr() in both drivers, we lost the ability for
'GetInstanceProcAddr' to resolve itself prior to having a valid
instance.
An upcoming spec change will fix that and allow
vkGetInstanceProcAddr() to resolve itself passing NULL as
instance. See https://gitlab.khronos.org/vulkan/vulkan/issues/2057
for details.
This patch implements the change in both radv and anvil.
CTS changes have already landed:
https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/2278
vulkan-loader changes have also landed:
https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/2278
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4273>
-rw-r--r-- | src/amd/vulkan/radv_device.c | 5 | ||||
-rw-r--r-- | src/intel/vulkan/anv_device.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 730d1a67747..bed7062ec1d 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -4948,6 +4948,11 @@ PFN_vkVoidFunction radv_GetInstanceProcAddr( LOOKUP_RADV_ENTRYPOINT(EnumerateInstanceVersion); LOOKUP_RADV_ENTRYPOINT(CreateInstance); + /* GetInstanceProcAddr() can also be called with a NULL instance. + * See https://gitlab.khronos.org/vulkan/vulkan/issues/2057 + */ + LOOKUP_RADV_ENTRYPOINT(GetInstanceProcAddr); + #undef LOOKUP_RADV_ENTRYPOINT if (instance == NULL) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 1462b761576..caa622d5f4e 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2204,6 +2204,11 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr( LOOKUP_ANV_ENTRYPOINT(EnumerateInstanceVersion); LOOKUP_ANV_ENTRYPOINT(CreateInstance); + /* GetInstanceProcAddr() can also be called with a NULL instance. + * See https://gitlab.khronos.org/vulkan/vulkan/issues/2057 + */ + LOOKUP_ANV_ENTRYPOINT(GetInstanceProcAddr); + #undef LOOKUP_ANV_ENTRYPOINT if (instance == NULL) |