Skip to content

Conversation

@zeux
Copy link
Owner

@zeux zeux commented Nov 6, 2023

Similarly to having an option to bypass global device function
pointers in favor of a device function table, we now provide an API
to load instance pointers into a separate structure.

This makes it possible to create multiple instances and use them
concurrently; this isn't needed as often as multi-device API but can
still be valuable for some applications.

Fixes #137

(needs further testing)

zeux added 2 commits November 5, 2023 14:52
Similarly to having an option to bypass global instance function
pointers in favor of an instance function table, we now provide an API
to load instance pointers into a separate structure.

This makes it possible to create multiple instances and use them
concurrently; this isn't needed as often as multi-device API but can
still be valuable for some applications.
The only differences between device/instance/loader snippets is where to
include each one based on command type
@zeux
Copy link
Owner Author

zeux commented Nov 7, 2023

This runs into a problem with vkGetDeviceProcAddr - it's an instance method so it's only loaded by volkLoadInstance, and without this volkLoadDeviceTable doesn't actually work because it relies on this global function. This will either require volkLoadInstanceTable to actually load this one global function, or we need to change volkLoadDeviceTable interface (or, well, add volkLoadDeviceInstanceTable or thereabouts that accepts both instance and device pointers).

…ProcAddr

In the future we might expose something like volkLoadInstanceDeviceTable
(which would take both instance and device handles), but with the
current interface the only option is to load an extra pointer, which
technically is instance-specific.
zeux added 3 commits October 27, 2025 14:19
This mirrors similar support in VolkDeviceTable and ensures that volk
ABI is stable between changes in configuration macros.
This makes sure that padding fields are initialized to zero; if volk is
compiled without some defines, the associated function pointers in the
returned struct will be NULL instead of uninitialized.
@zeux zeux merged commit 3f1e9f3 into master Oct 28, 2025
6 checks passed
@zeux zeux deleted the instancetable branch October 28, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add InstanceTable?

1 participant