Describe the bug
The implementation of loader_gpa_instance_terminator searches the list of known instance functions before resorting to using the unknown physical device/device function handling. This is fine for a few functions, but if the entire list of device functions are queried, the loader runs out of space in the unknown function handling. This was discovered by @PancakeTAS whose layer uses Vulkan-Hpp which uses vkGetInstanceProcAddr to query device functions initially. Since there are well over 250 device functions in the API, the loader runs out of room.
Solution:
Add device terminator functions that can be returned by loader_gpa_instance_terminator so layers can query device functions with vkGetInstanceProcAddr and get a function that can dispatch it correctly.
Alternatively, if a layer is hitting this out in the wild, they can switch to exclusively using vkGetDeviceProcAddr for device functions. Plus, its more performant because function calls don't have to dispatch through the loader.
Describe the bug
The implementation of
loader_gpa_instance_terminatorsearches the list of known instance functions before resorting to using the unknown physical device/device function handling. This is fine for a few functions, but if the entire list of device functions are queried, the loader runs out of space in the unknown function handling. This was discovered by @PancakeTAS whose layer uses Vulkan-Hpp which uses vkGetInstanceProcAddr to query device functions initially. Since there are well over 250 device functions in the API, the loader runs out of room.Solution:
Add device terminator functions that can be returned by
loader_gpa_instance_terminatorso layers can query device functions withvkGetInstanceProcAddrand get a function that can dispatch it correctly.Alternatively, if a layer is hitting this out in the wild, they can switch to exclusively using
vkGetDeviceProcAddrfor device functions. Plus, its more performant because function calls don't have to dispatch through the loader.