Skip to content

Conversation

@inner-daemons
Copy link
Collaborator

@inner-daemons inner-daemons commented Nov 10, 2025

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

  • 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.

inner-daemons and others added 30 commits August 14, 2025 12:53
@inner-daemons inner-daemons marked this pull request as ready for review November 10, 2025 23:35
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 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_count and max_task_workgroups_per_dimension to max_task_mesh_workgroup_total_count and max_task_mesh_workgroups_per_dimension to 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.

inner-daemons and others added 4 commits December 16, 2025 17:16
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>
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 fine, please rebase and make sure the ron files and other stuff don't come back.

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) December 17, 2025 05:11
@cwfitzgerald cwfitzgerald merged commit 952d653 into gfx-rs:trunk Dec 17, 2025
47 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.

Limits & validation of mesh and task shader interface in wgpu-core

3 participants