-
Notifications
You must be signed in to change notification settings - Fork 61
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
Code using AccelerationStructureInstanceKHR
does not compile
#56
Comments
Also, unrelated, but this not being noticed earlier makes me think this project should have one of those things some Zig projects have where it just references every struct to ensure it typechecks (though this specific issue seems to need an initialization attempt to typecheck, not just a reference). |
Ah yes, this type has given some trouble before. It used to work before the packed struct overhaul, I think.
Yes, thats a good idea |
Added this refAllDecls-like test also (even more elaborate than the STD one): https://github.com/Snektron/vulkan-zig/blob/master/test/ref_all_decls.zig Of course it uncovered a bunch of issues, those are also all fixed now. |
Thanks! Looks like |
The issue appears to be that
AccelerationStructureInstanceKHR
is defined to be a packed struct, but it containsTransformMatrixKHR
-- an extern struct, and doing so is now illegal in Zig. Not sure what the solution is here -- presumably, the only thing that actually works is to ensure all structs in packed structs are packed as well, but not sure if we can actually rely on this behaving as expected, as that would require replacingextern
withpacked
in some scenarios, which the C ABI may not like.Though a cursory glance makes me think only
TransformMatrixKHR
andSRTDataNV
would need to undergo theextern
->packed
transition, so at least for now it should be fine.Also, since
packed
structs cannot be inextern
structs, there's a couple places where that would need to be amended as well -- just the simple replacement solution as above seems even sketchier here. There are more scenarios affected by this.The text was updated successfully, but these errors were encountered: