Naga mesh shader WGSL writer#8481
Merged
cwfitzgerald merged 130 commits intogfx-rs:trunkfrom Dec 17, 2025
Merged
Conversation
inner-daemons
approved these changes
Nov 28, 2025
Collaborator
inner-daemons
left a comment
There was a problem hiding this comment.
Thumbs up from me, no further comments
Member
|
Ci is mad |
cwfitzgerald
requested changes
Dec 12, 2025
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
Looks good, some comments
Contributor
Author
|
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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.