Ensure VkPhysicalDevice unwrapping in Device functions
authorCharles Giessen <charles@lunarg.com>
Tue, 10 Jan 2023 00:59:40 +0000 (17:59 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Mon, 30 Jan 2023 21:42:20 +0000 (14:42 -0700)
commitdda7872300933903fdbf86b213bb77bb8955344d
tree0ef5c8a541ddbdd3f90fc959aa9d887972cd1b48
parent0c63db1aeda6916690b863688fa6cdf2ac1f790b
Ensure VkPhysicalDevice unwrapping in Device functions

Certain functions, like vkSetDebugUtilsObjectNameEXT can take a physical device
as a parameter. When this function is queried through vkGetInstanceProcAddr,
the trampoline is returned, whereas when queried through vkGetDeviceProcAddr,
the trampoline wasn't returned, allowing the physical device parameter to not
get unwrapped before calling down the chain, causing a crash.

This commit modifies the codegen to always use the trampoline for these
functions, and adds tests for them. These changes require the the loader check
that the appropriate extensions are enabled during the application's call to
vkGetDeviceProcAddr, since it otherwise always return a non-null function
pointer.
loader/generated/vk_loader_extensions.c
scripts/loader_extension_generator.py
tests/framework/icd/test_icd.cpp
tests/framework/test_environment.cpp
tests/loader_debug_ext_tests.cpp
tests/loader_version_tests.cpp