Skip to content

detail::GenericFeaturesPNextNode's constructor is error-prone due to inconsistent struct alignment #295

Open
@n0F4x

Description

@n0F4x

I had an issue where creating a Vulkan feature struct ended up with a rounded alignment (32 bytes), but the same structure created in another context was not aligned (28 bytes).
This made the resulting detail::GenericFeaturesPNextNodes different.

I was trying to use PhysicalDevice::are_extension_features_present with the 28-byte version as a parameter, and the function returned an unexpected result as the stored feature had been aligned to 32 bytes.
Based on the differing "last" 4 bytes I got the result that the requested feature is not supported, whereas this is not true.

Compiled with:
Clang version 17.0.6
Target x86_64-w64-windows-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions