Skip to content

Conversation

SupaMaggie70Incorporated
Copy link
Collaborator

@SupaMaggie70Incorporated SupaMaggie70Incorporated commented Aug 16, 2025

Connections
Addresses #7219, a sub-issue of #7197

Description
This adds a DX12 backend for mesh shaders

Current issues:

  • Limits aren't calculated properly
  • In the pipeline stream descriptor, we could figure out the maximum length and possibly avoid allocations and vec's if that's desirable

Testing
I have updated the mesh shader example to use DXILpassthrough to test this, and it works.

Squash or Rebase?
Squash

Checklist

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

@SupaMaggie70Incorporated SupaMaggie70Incorporated requested a review from a team as a code owner August 16, 2025 04:01
@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as draft August 16, 2025 04:01
@SupaMaggie70Incorporated SupaMaggie70Incorporated marked this pull request as ready for review August 16, 2025 20:22
@cwfitzgerald cwfitzgerald changed the title Mesh shading/dx12 backend [hal/dx12] Mesh Shaders Aug 20, 2025
@SupaMaggie70Incorporated
Copy link
Collaborator Author

SupaMaggie70Incorporated commented Sep 15, 2025

@cwfitzgerald Any chance a review for this could happen soon-ish? I'm waiting on it to continue working on both my PRs #8139 and #8206, since they will modify many of the same files.

@cwfitzgerald
Copy link
Member

I should be able to re-review it today.

@SupaMaggie70Incorporated
Copy link
Collaborator Author

@cwfitzgerald Going to ping you again, not super urgent but it is something I'd like to get reviewed soon-ish.

Copy link
Contributor

@Copilot 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 DirectX12 backend support for mesh shaders, expanding WGPU's mesh shader capabilities beyond Vulkan. The implementation includes direct draw commands, indirect draw variants, and proper pipeline state handling for both task and mesh shaders.

  • Implements mesh shader pipeline creation using D3D12's pipeline stream API
  • Adds mesh shader draw command implementations (direct and indirect variants)
  • Updates examples and tests to support both Vulkan and DX12 backends

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
wgpu-hal/src/dx12/mod.rs Adds mesh shader pipeline state stream structure and command signature support
wgpu-hal/src/dx12/device.rs Implements mesh shader pipeline creation and command signature setup
wgpu-hal/src/dx12/command.rs Implements mesh shader draw commands (direct and indirect variants)
wgpu-hal/src/dx12/adapter.rs Adds mesh shader feature detection and limit configuration
tests/tests/wgpu-gpu/mesh_shader/mod.rs Updates tests to support both Vulkan and DX12 backends with shader compilation
examples/features/src/mesh_shader/mod.rs Updates example to support DX12 backend with HLSL shader compilation
naga/src/back/hlsl/mod.rs Adds HLSL stage string mappings for task and mesh shaders

Tip: Customize your code reviews with copilot-instructions.md. Create the file or 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.

Got some nits, but we're good here once those are resolved.

@SupaMaggie70Incorporated
Copy link
Collaborator Author

@cwfitzgerald I've addressed all comments I think. Good to merge?

@cwfitzgerald
Copy link
Member

CI mad

@SupaMaggie70Incorporated
Copy link
Collaborator Author

@cwfitzgerald Should be good now lmao

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) September 25, 2025 03:01
@cwfitzgerald cwfitzgerald enabled auto-merge (squash) September 25, 2025 03:02
@cwfitzgerald cwfitzgerald merged commit 05cc6dc into gfx-rs:trunk Sep 25, 2025
41 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.

2 participants