You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose Metal MULTI_DRAW_INDIRECT_COUNT via prepass ICBs
Rebuilt on the reworked gfx-rs#9640 prepass architecture:
multi_draw_*_indirect_count (draw, indexed, and mesh-task) executes
through a GPU-generated indirect command buffer driven by an execution
range that a deferred kernel clamps to min(count, max_count), so the
draw count is never read by the CPU. The range clamp and ICB generation
ride the same internal pre-pass command buffer as indirect validation.
Because MULTI_DRAW_INDIRECT_COUNT is advertised per adapter but some
pipelines cannot execute inside an ICB (on current Apple silicon
drivers, any fragment shader that accesses a texture through direct
bindings is rejected — verified empirically on M4; textures bound
through argument buffers are accepted, which matches the constraint
Dawn is migrating to argument buffers to lift), count draws under such
pipelines fall back to a GPU-clamped copy of the argument buffer
consumed by a fixed-length per-draw loop. The count still never
round-trips through the CPU. A new sampled-texture count test covers
the fallback; the existing count readback tests were also verified
against the fallback path directly on M4 hardware.
Also adds wgpu_types::INDIRECT_BUFFER_OFFSET_ALIGNMENT (review asked
for a named alignment rather than a hardcoded 4), validates the count
buffer offset against it, restores the deno chromium-experimental-
multi-draw-indirect surface, and documents the Metal behavior on the
feature flag.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,14 @@ Bottom level categories:
44
44
45
45
### Added/New Features
46
46
47
+
#### General
48
+
49
+
- Added `wgpu_types::INDIRECT_BUFFER_OFFSET_ALIGNMENT` naming the required 4-byte alignment of indirect-argument buffer offsets, and validate that the count-buffer offset in `multi_draw_*_indirect_count` honors it. By @matthargett in [#9679](https://github.com/gfx-rs/wgpu/pull/9679).
50
+
47
51
#### Metal
48
52
49
53
- Metal now lowers fixed-count `multi_draw_indirect` / `multi_draw_indexed_indirect` (and their mesh-task counterpart) with 8 or more draws to GPU-generated indirect command buffers. The generation compute runs in the internal pre-pass command buffer that already carries indirect-draw validation, so the render pass is never interrupted. By @matthargett in [#9640](https://github.com/gfx-rs/wgpu/pull/9640).
54
+
- Expose `MULTI_DRAW_INDIRECT_COUNT` on Metal when indirect command buffers are supported. `multi_draw_*_indirect_count` executes through a GPU-generated indirect command buffer with a GPU-clamped execution range; draws recorded with a pipeline that can't execute inside an ICB fall back to a series of indirect draws over GPU-clamped arguments. The draw count is never read by the CPU. By @matthargett in [#9679](https://github.com/gfx-rs/wgpu/pull/9679).
0 commit comments