-
Notifications
You must be signed in to change notification settings - Fork 266
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
Use bytemuck derives instead of unsafe impls #109
Comments
Nice crate 👍 Does the |
The
For large or dynamically laid out types, I added an interface named |
Seems like a nice crate. I'll probably use |
Fixed in #126 |
In the vertex buffer tutorial, bytemuck is introduced. bytemuck now has a
derive
feature that enables deriving the traits used in the tutorial. The derive validates that bytemuck's preconditions are met, which can be easy to mess up.The
Vertex
would change to this:I tried putting together a PR to make this switch. It was straightforward for this type, but other uses of bytemuck use types from crates like
cgmath
which do not implement the bytemuck traits. Some people stick with the plain unsafe trait impls for that reason.I am a little bit paranoid about the ABI of math library types, so I generally use raw types or a crate I built specifically for safe uniform definitions.
The text was updated successfully, but these errors were encountered: