-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature proposal: Support for sized arrays #21
Comments
This would be awesome! |
I'm gonna wait until we resolve #20 to properly work on it, since the work there also applies to arrays. |
Bleh. Poked around, and of course One option to forge ahead seems to be to include the Another option is to remove blanket impl for AsStd140, but I suspect this mildly breaks downstream :). Third option, I suppose, is to add another explicit trait, e.g. What think? Seems like only the first option is viable. |
Currently blocked by Lokathor/bytemuck#59 making it to crates.io. |
Even worse than I thought - we cannot emit impl AsStd140 for arrays because arrays are always foreign. :( |
One possible solution I see is thus:
Pros:
Thoughts? |
Since const generics MVP hit the stable, it should be possible to implement
AsStd*
for sized arrays.The corresponding
Std*
type would need to be a sized array of a generated struct type with a field for underlying element'sStd*
representation, and a field for stride-correcting padding.I believe the implementation should be rather straightforward, I'll gladly take on it if it is deemed worthwhile (well, I'd certainly like to use it personally).
The text was updated successfully, but these errors were encountered: