-
Notifications
You must be signed in to change notification settings - Fork 56
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
Struct (union) offsets are wrong #194
Comments
Saw that with other bindings, I had to manually remap the structure, an example is https://github.com/amerkoleci/Vortice.Windows/blob/main/src/Vortice.Direct3D12/RaytracingInstanceDescription.cs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Noticed when manually reviewing Vortice.MediaFoundation bindings.
MFTOPONODE_ATTRIBUTE_UPDATE
is an example of a wrong structure. cfa2b3b adds a repro, without a fix. Union fields are supposed to all have an offset of32
, but the first member of a union (u32
) is generated to have an offset of28
, which will lead to incorrectly behaving bindings.Most likely
StructTransform
is not robust enough, and I'm not sure why union is aligned to 8 byte boundary, instead of traditional 4. This will require investigation into struct layout ABIs.This is confirmed not to be a regression from 2.0.0-beta.7 to 2.0.0-beta.8.
SharpGenTools/SharpGen/Transform/StructTransform.cs
Lines 89 to 92 in cfa2b3b
FYI, @amerkoleci.
The text was updated successfully, but these errors were encountered: