mach
mach copied to clipboard
examples/custom-renderer: Uniforms are declared differently in Renderer.zig and shader.wgsl
In practice this doesn't make a difference, as the struct alignment of 16 which happens to be correct saves us here. This can be very confusing to newcomers, though, as it is unclear which is the correct option and why this decision was made.
https://github.com/hexops/mach/blob/main/examples/custom-renderer/shader.wgsl#L2-L5 https://github.com/hexops/mach/blob/main/examples/custom-renderer/Renderer.zig#L18-L21
Fix Idea
- Change field names to be identical
- Change field types to be identical
- (Optional) Add align(16) for all fields in the Zig struct