Skip to content
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

examples/custom-renderer: Uniforms are declared differently in Renderer.zig and shader.wgsl #1335

Open
XI2vGMst opened this issue Jan 11, 2025 · 0 comments
Labels
bug Something isn't working needs-triage Issues that need triaging

Comments

@XI2vGMst
Copy link

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
@XI2vGMst XI2vGMst added bug Something isn't working needs-triage Issues that need triaging labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issues that need triaging
Projects
None yet
Development

No branches or pull requests

1 participant