-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[hal/dx12] Mesh Shaders #8110
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
[hal/dx12] Mesh Shaders #8110
Conversation
@cwfitzgerald Going to ping you again, not super urgent but it is something I'd like to get reviewed soon-ish. |
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 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.
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.
Got some nits, but we're good here once those are resolved.
Co-authored-by: Connor Fitzgerald <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Connor Fitzgerald <[email protected]>
@cwfitzgerald I've addressed all comments I think. Good to merge? |
CI mad |
@cwfitzgerald Should be good now lmao |
@vorporeal Thanks for reporting this and doing the work to bisect it. Definitely file an issue. I won't personally be able to get to this for at least a few days since I'll be away from my windows machine. It seems like it will be a big issue for many people so definitely get it on the radar of more maintainers. CC: @cwfitzgerald |
Yup, definitely file an issue, if you have reproduction code too, that should be good. |
Filed #8296; will see if I can reproduce with any of the examples and update that issue accordingly. |
* Features and draw commands added * Tried to implement the pipeline creation (completely untested) * Fixed clippy issues * Fixed something I think * A little bit of work on the mesh shader example (currently doesn't work on dx12) * Reached a new kind of error state * Fixed an alignment issue * DirectX 12 mesh shaders working :party: * Removed stupid change and updated changelog * Fixed typo * Added backends option to example framework * Removed silly no write fragment shader from tests to see if anything breaks * Tried to make mesh shader tests run elsewhere too * Removed printlns and checked that dx12 mesh shader tests run * Documented very strange issue * I'm so lost * Fixed stupid typos * Fixed all issues * Removed unnecessary example stuff, updated tests * Updated typos.toml * Updated limits * Apply suggestion from @cwfitzgerald Co-authored-by: Connor Fitzgerald <[email protected]> * Apply suggestion from @cwfitzgerald Co-authored-by: Connor Fitzgerald <[email protected]> * Removed supported backends, made example & tests always pass the filename to shader compilers * Removed excessive bools in test params * Added new tests to the list * I'm a sinner for this one (unused import) * Replaced random stuff with test params hashing * Updated typos.toml * Updated -Fo typo thing * Actually fixed typo issue this time * Update CHANGELOG.md Co-authored-by: Connor Fitzgerald <[email protected]> * Update tests/tests/wgpu-gpu/mesh_shader/mod.rs Co-authored-by: Copilot <[email protected]> * Update wgpu-hal/src/dx12/mod.rs Co-authored-by: Connor Fitzgerald <[email protected]> * Addressed comments * Lmao --------- Co-authored-by: Connor Fitzgerald <[email protected]> Co-authored-by: Copilot <[email protected]>
Connections
Addresses #7219, a sub-issue of #7197
Description
This adds a DX12 backend for mesh shaders
Current issues:
Testing
I have updated the mesh shader example to use DXILpassthrough to test this, and it works.
Squash or Rebase?
Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.