You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this because I used @embedFile to embed my glb model. Unfortunately, according to ziglang/zig#4680 it's currently not possible to specify alignment for @embedFile.
I know it's simpler to just assume these preconditions (and it's probably faster to cast to u32 pointers). But it would be nice to at least have an assertion for alignment and endianness to help with the error search.
The safer/correct but also slower way would be to treat the data as a byte stream and use something like this:
var reader = std.io.fixedBufferStream(data).reader();
const my_int = reader.readInt(u32, .little);
Edit: nvm, saw in the glTF spec that 4-byte alignment is a requirement. So at least an assertion would be nice.
The text was updated successfully, but these errors were encountered:
Ran into this because I used
@embedFile
to embed my glb model. Unfortunately, according to ziglang/zig#4680 it's currently not possible to specify alignment for@embedFile
.I know it's simpler to just assume these preconditions (and it's probably faster to cast to
u32
pointers). But it would be nice to at least have an assertion for alignment and endianness to help with the error search.The safer/correct but also slower way would be to treat the data as a byte stream and use something like this:Edit: nvm, saw in the glTF spec that 4-byte alignment is a requirement. So at least an assertion would be nice.
The text was updated successfully, but these errors were encountered: