Hmm… this is a hard problem.
Let’s stay with the facts:
- we need different functions for different contexts (instance, device)
Let’s assume the following desired properties:
- we want for LWJGL users to call Vulkan functions easily with methods named after the Vulkan functions
How to provide context?
- Like you said, with dispatching via object-orientation using implied this parameters for a given Vulkan instance and/or device (this would mean that it is not possible to call Vulkan methods anymore with static methods)
- With adding an additional parameter to each (instance, [device])-sensitive method that takes the manually lookedup Vulkan function pointer (this can also be the low level on which the previously mentioned object-oriented layer can sit on top of)
- With letting LWJGL’s Vulkan methods keep track of the respective function pointer given the (instance, [device]) context as method parameters for each method invocation. This means, LWJGL would need to hold state/keep track of the current context (which function was invoked to create an instance/device, etc) in a thread-local manner and for each method invocation choose the correct Vulkan function pointer. Probably not a good idea.
Currently, I find none of the above three methods appealing at all.
If I had to choose, I would probably opt for 2. and if so definitely head to 1. as soon as possible with 2. providing the basis.