KhronosGroup / KhronosGroup/Vulkan-Loader

loader_gpa_instance_terminator doesn't handle known device functions

Open
#2,029 2 comments 0 reactions 0 assignees View on GitHub
bug layers
Dominant language
C
Stars
695
Forks
343
Avg merge
1d 1h
Merged PRs (30d)
17

Description

**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.

Contributor guide

Open the contributing guide

Research direction

Locate loader_gpa_instance_terminator and inspect how it searches known instance functions before using unknown physical-device/device-function handling. Reproduce the case where a layer queries device functions through vkGetInstanceProcAddr, then verify that device terminator functions are returned and dispatch correctly without exhausting the unknown-function space.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.