-
Notifications
You must be signed in to change notification settings - Fork 176
Feature flag for repr(C) Quat #541
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
Comments
|
Sorry yes the inner Maybe the simplest solution is to have a wrapper type around the inner type shared by Happy to open a PR, just let me know if you have any preferences. |
I've made all of the types that wrap simd types I would most likely be OK with making that change. Currently glam uses If this change is made in glam would the bevy change still require a |
The I'm not sure if making So if you made The Not sure of the perf implications here which is why I would put it behind some feature flag. I'm assuming |
Making So specifying The inner |
Yeah afaik it's currently undefined behaviour based on how the ABI is implemented per compiler per architecture. I hadn't seen the scalar feature so that could be an option, just swap to that implementation. I will close as there isn't much more that can be done on the glam side, thanks for the help. |
@bitshifter I have switched to using
It seems to be set up to point to the scalar implementation so a bit confused 🤔 Line 90 in 4488b23
https://github.com/bitshifter/glam-rs/blob/main/src/bool/scalar/bvec4a.rs Am I being stupid? |
Internally glam-rs/src/f32/scalar/vec4.rs Lines 3 to 4 in 4488b23
It's a bit of an annoying API inconsistency, but I felt it was necessarily not to penalise people who wanted to use |
I have been working on a PR for Bevy which allows their types to be passed over FFI using repr(C), however as the Quat implementation Bevy is using from glam is repr(simd) it is not compatible with C FFI (see rust-lang/rust#53346). It was suggested to upstream changes here to reduce complexity in maintaining repr(C) wrapper types to mitigate this in Bevy.
Would you be opposed to a PR implementing a repr(C) version of Quat?
See this PR for current workaround - bevyengine/bevy#14362
The text was updated successfully, but these errors were encountered: