Skip to content

Conversation

@Slightlyclueless
Copy link
Contributor

@Slightlyclueless Slightlyclueless commented Nov 5, 2025

Connections
Based off of #8370

Description

Adds a WGSL writer for mesh shader functionality.

Testing
TODO

Squash or Rebase?
Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests.
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

inner-daemons and others added 30 commits August 14, 2025 12:53
Copy link
Collaborator

@inner-daemons inner-daemons left a 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

@cwfitzgerald
Copy link
Member

Ci is mad

Copy link
Member

@cwfitzgerald cwfitzgerald left a 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

@Slightlyclueless
Copy link
Contributor Author

Slightlyclueless commented Dec 12, 2025

uhhh, that's not any of my code causing CI to get mad...

Copy link
Contributor

Copilot AI left a 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.

Copy link
Member

@cwfitzgerald cwfitzgerald left a 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

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) December 17, 2025 19:18
@cwfitzgerald cwfitzgerald merged commit 49be67a into gfx-rs:trunk Dec 17, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants