-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Naga mesh shader WGSL writer #8481
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
Naga mesh shader WGSL writer #8481
Conversation
inner-daemons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up from me, no further comments
|
Ci is mad |
cwfitzgerald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some comments
|
uhhh, that's not any of my code causing CI to get mad... |
…gpu into naga-mesh-wgpu-writer
…gpu into naga-mesh-wgpu-writer
a99d488 to
1791451
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds WGSL writer support for mesh shader functionality to Naga, building on PR #8370 which added the parsing support. The implementation enables round-trip conversion of mesh shader code through the WGSL writer, completing the mesh shader support for WGSL.
Key Changes
- Added WGSL writer support for mesh and task shader stages with proper attribute handling (@mesh, @task, @payload)
- Implemented built-in name mappings for mesh shader-specific built-ins (mesh_task_size, triangle_indices, etc.)
- Added support for task_payload address space and per_primitive attribute in WGSL output
- Updated test targets from "IR | ANALYSIS" to "WGSL" to generate WGSL output files instead
Reviewed changes
Copilot reviewed 7 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
naga/src/common/wgsl/to_wgsl.rs |
Exposed mesh shader built-in names (previously returned None) and added task_payload address space string |
naga/src/back/wgsl/writer.rs |
Added MeshStage, TaskPayload, and PerPrimitive attribute variants; implemented mesh/task entry point attribute handling; added wgpu_mesh_shader enable detection |
naga/tests/in/wgsl/*.toml |
Changed test targets from "IR | ANALYSIS" to "WGSL" |
naga/tests/out/wgsl/*.wgsl |
New WGSL output files for mesh shader test cases |
naga/tests/out/ir/*.ron |
Removed IR output files (no longer generated) |
naga/tests/out/analysis/*.info.ron |
Removed analysis output files (no longer generated) |
CHANGELOG.md |
Added entry documenting the new WGSL writer support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cwfitzgerald
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's it? Hell yeah
Connections
Based off of #8370
Description
Adds a WGSL writer for mesh shader functionality.
Testing
TODO
Squash or Rebase?
Squash
Checklist
cargo fmt.taplo format.cargo clippy --tests.cargo xtask testto run tests.CHANGELOG.mdentry.