-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New mesh shader limits #8507
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
New mesh shader limits #8507
Conversation
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
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 comprehensive mesh shader limits and validation to wgpu, addressing limitations in the previous implementation. It renames existing limit fields for clarity and introduces new granular limits for task and mesh shader workgroup sizes, invocations, and output constraints.
Key changes:
- Renamed
max_task_workgroup_total_countandmax_task_workgroups_per_dimensiontomax_task_mesh_workgroup_total_countandmax_task_mesh_workgroups_per_dimensionto reflect that these limits apply to both task and mesh shader dispatch operations - Added separate invocation limits for task and mesh shaders (
max_task_invocations_per_workgroup,max_mesh_invocations_per_workgroup, etc.) to handle per-shader constraints - Added output limits for mesh shaders (vertices, primitives, payload size)
- Implemented validation for mesh shader outputs, task payloads, and primitive index usage between shader stages
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| wgpu-types/src/limits.rs | Defines new mesh shader limit fields, renames existing fields, and updates documentation and default values |
| wgpu/src/backend/webgpu.rs | Updates WebGPU backend to use renamed limit fields |
| wgpu-hal/src/vulkan/adapter.rs | Implements Vulkan mesh shader limits by querying hardware capabilities and computing min values across dimensions |
| wgpu-hal/src/metal/adapter.rs | Implements Metal mesh shader limits using Metal-specific constants and capabilities |
| wgpu-hal/src/metal/mod.rs | Adds fields to PrivateCapabilities for Metal mesh/task workgroup limits |
| wgpu-hal/src/dx12/adapter.rs | Implements DirectX 12 mesh shader limits using D3D12 constants |
| wgpu-hal/src/gles/adapter.rs | Sets mesh shader limits to 0 (not supported in GLES) |
| wgpu-hal/src/noop/mod.rs | Sets mesh shader limits to maximum values for the no-op backend |
| wgpu-info/src/human.rs | Updates display output to show new mesh shader limits with proper formatting |
| wgpu-core/src/validation.rs | Adds comprehensive validation for mesh shader outputs, task payloads, primitive index usage, and per-primitive attributes; updates workgroup size validation to handle task/mesh shaders |
| wgpu-core/src/device/resource.rs | Updates pipeline creation to use the new StageIo structure with varyings field |
| wgpu-core/src/command/render.rs | Updates draw_mesh_tasks validation to use renamed limit fields |
| wgpu-core/src/command/bundle.rs | Updates bundle draw_mesh_tasks validation to use renamed limit fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 fine, please rebase and make sure the ron files and other stuff don't come back.
Connections
Depends on #8370
Works towards #7197
Closes #8003
Description
Add new limits and validation for mesh shaders
Testing
Same old, same old
Squash or Rebase?
Squash
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.