Skip to content

Generate padding fields in VolkDeviceTable to preserve ABI #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged

Conversation

zeux
Copy link
Owner

@zeux zeux commented Mar 24, 2025

To avoid issues with ABI compatibility of volk built with different sets
of defines, we now generate padding fields for each extension block with
the same number of function pointers. This should make sure that the
offset of every pointer for any given volk version remains stable,
simplifying binary builds.

Fixes #230

To avoid issues with ABI compatibility of volk built with different sets
of defines, we now generate padding fields for each extension block with
the same number of function pointers. This should make sure that the
offset of every pointer for any given volk version remains stable,
simplifying binary builds.
zeux added 2 commits March 24, 2025 08:52
Sequential indices are problematic for future updates, as updates in the
middle of the structure are common, and they will result in larger and
less readable diffs. Instead we can use the CRC32 of the padding
contents to name the field.
Copy link

@charles-lunarg charles-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for taking a stab at it while I am away from a keyboard (laptop died while on a trip.)

@zeux zeux merged commit 8645b5e into master Mar 24, 2025
6 checks passed
@zeux zeux deleted the devt-abi branch March 24, 2025 19:44
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.

volkLoadDeviceTable corrupts memory outside of the given table when loaded from .lib in Vulkan SDK 1.4.309
2 participants