Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2248f6d
Use Metal ICBs for multi-draw indirect
matthargett Jun 2, 2026
8ac5bc3
Disable Metal ICB path on paravirtual adapters
matthargett Jun 2, 2026
8a63005
Gate Metal ICB path to validated Apple GPUs
matthargett Jun 2, 2026
5a311cf
Gate Metal ICBs on modern Apple OS runtimes
matthargett Jun 3, 2026
5534581
Harden multi-draw indirect coverage
matthargett Jun 3, 2026
263d4cb
Avoid Metal ICB resume with pending timestamps
matthargett Jun 3, 2026
8eb4590
Gate Metal ICB render state tracking
matthargett Jun 3, 2026
4bb7e71
Tune Metal ICB fast-path overhead
matthargett Jun 3, 2026
6508e33
Add Metal ICB changelog entry
matthargett Jun 3, 2026
d181efa
Tighten Metal ICB generation gates
matthargett Jun 4, 2026
cd7172a
Use uniform Metal ICB generation dispatch
matthargett Jun 4, 2026
9db378e
update PR link
matthargett Jun 4, 2026
ddbdb12
typo
matthargett Jun 4, 2026
35e4684
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jun 4, 2026
2e1668e
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jun 5, 2026
f7a1762
Add Metal ICB mesh and count MDI coverage
matthargett Jun 7, 2026
c306df7
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jun 7, 2026
4674b25
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jun 11, 2026
e7590b2
Allow Metal ICB MDI on A10X tvOS 18
matthargett Jun 11, 2026
01bc21c
Merge remote-tracking branch 'upstream/trunk' into metal-icb-multi-dr…
matthargett Jul 7, 2026
65d9b19
Move Metal ICB kernels into shader files
matthargett Jul 8, 2026
5b58ab9
Note Chromium mapping for deno MDI count feature
matthargett Jul 8, 2026
56be6b9
Scope Metal MDI PR to fixed-count multi-draw
matthargett Jul 8, 2026
a95a810
Generate Metal ICBs in a pre-pass instead of splitting the render pass
matthargett Jul 8, 2026
7b2115d
Harden Metal ICB prepass edge cases
matthargett Jul 8, 2026
4ada51d
Enable Metal ICB path on Apple Watch (S4+/Apple5)
matthargett Jul 8, 2026
cb0aeca
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jul 9, 2026
6f6d863
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jul 19, 2026
5e21ea7
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jul 22, 2026
7b44e4e
Merge branch 'trunk' into metal-icb-multi-draw-indirect
matthargett Jul 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ By @beholdnec in [#8505](https://github.com/gfx-rs/wgpu/pull/8505).

#### Metal

- Add Metal indirect-command-buffer lowering for fixed-count multi-draw indirect when render state can be safely resumed. By @matthargett in [#9640](https://github.com/gfx-rs/wgpu/pull/9640).
- Add `metal::Queue::add_wait_event` / `add_signal_event` (with `remove_*` companions) to stage `MTLSharedEvent` waits/signals on the next `Queue::submit`, for GPU-side interop with foreign APIs. Waits run on an internal CB committed before user CBs. By @AdrianEddy in [#9483](https://github.com/gfx-rs/wgpu/pull/9483).
- Unconditionally enable `Features::CLIP_DISTANCES`. By @ErichDonGubler in [#9270](https://github.com/gfx-rs/wgpu/pull/9270).
- Added full support for mesh shaders, including in WGSL shaders. By @inner-daemons in [#8739](https://github.com/gfx-rs/wgpu/pull/8739).
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ objc2-metal = { version = "0.3.2", default-features = false, features = [
"MTLCommandBuffer",
"MTLCommandEncoder",
"MTLCommandQueue",
"MTLArgumentEncoder",
"MTLComputeCommandEncoder",
"MTLComputePass",
"MTLComputePipeline",
Expand All @@ -238,6 +239,8 @@ objc2-metal = { version = "0.3.2", default-features = false, features = [
"MTLDevice",
"MTLDrawable",
"MTLEvent",
"MTLIndirectCommandBuffer",
"MTLIndirectCommandEncoder",
"MTLLibrary",
"MTLPipeline",
"MTLPixelFormat",
Expand Down
17 changes: 14 additions & 3 deletions deno_webgpu/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ impl GPUAdapter {
self.features.get(scope, |scope| {
let features = self.instance.adapter_features(self.id);
// Only expose WebGPU features, not wgpu native-only features
let features = features & wgpu_types::Features::all_webgpu_mask();
GPUSupportedFeatures::new(scope, features)
let mut exposed_features =
features & wgpu_types::Features::all_webgpu_mask();
exposed_features.set(
wgpu_types::Features::MULTI_DRAW_INDIRECT_COUNT,
features.contains(wgpu_types::Features::MULTI_DRAW_INDIRECT_COUNT),
Comment thread
matthargett marked this conversation as resolved.
Outdated
);
GPUSupportedFeatures::new(scope, exposed_features)
})
}

Expand Down Expand Up @@ -475,7 +480,13 @@ impl GPUSupportedFeatures {
let set = v8::Set::new(scope);

for feature in features.iter() {
let key = v8::String::new(scope, feature.as_str().unwrap()).unwrap();
let name = match feature {
wgpu_types::Features::MULTI_DRAW_INDIRECT_COUNT => {
"chromium-experimental-multi-draw-indirect"
}
_ => feature.as_str().unwrap(),
};
let key = v8::String::new(scope, name).unwrap();
set.add(scope, key.into());
}

Expand Down
74 changes: 74 additions & 0 deletions deno_webgpu/render_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,80 @@ impl GPURenderPassEncoder {
.err();
self.error_handler.push_error(err);
}

#[required(3)]
#[undefined]
fn multi_draw_indirect(
&self,
#[webidl] indirect_buffer: Ptr<GPUBuffer>,
#[webidl(options(enforce_range = true))] indirect_offset: u64,
#[webidl(options(enforce_range = true))] max_draw_count: u32,
#[webidl] draw_count_buffer: Option<Ptr<GPUBuffer>>,
#[webidl(default = 0, options(enforce_range = true))]
draw_count_buffer_offset: u64,
) {
let err = if let Some(draw_count_buffer) = draw_count_buffer {
self
.instance
.render_pass_multi_draw_indirect_count(
&mut self.render_pass.borrow_mut(),
indirect_buffer.id,
indirect_offset,
draw_count_buffer.id,
draw_count_buffer_offset,
max_draw_count,
)
.err()
} else {
self
.instance
.render_pass_multi_draw_indirect(
&mut self.render_pass.borrow_mut(),
indirect_buffer.id,
indirect_offset,
max_draw_count,
)
.err()
};
self.error_handler.push_error(err);
}

#[required(3)]
#[undefined]
fn multi_draw_indexed_indirect(
&self,
#[webidl] indirect_buffer: Ptr<GPUBuffer>,
#[webidl(options(enforce_range = true))] indirect_offset: u64,
#[webidl(options(enforce_range = true))] max_draw_count: u32,
#[webidl] draw_count_buffer: Option<Ptr<GPUBuffer>>,
#[webidl(default = 0, options(enforce_range = true))]
draw_count_buffer_offset: u64,
) {
let err = if let Some(draw_count_buffer) = draw_count_buffer {
self
.instance
.render_pass_multi_draw_indexed_indirect_count(
&mut self.render_pass.borrow_mut(),
indirect_buffer.id,
indirect_offset,
draw_count_buffer.id,
draw_count_buffer_offset,
max_draw_count,
)
.err()
} else {
self
.instance
.render_pass_multi_draw_indexed_indirect(
&mut self.render_pass.borrow_mut(),
indirect_buffer.id,
indirect_offset,
max_draw_count,
)
.err()
};
self.error_handler.push_error(err);
}
}

#[derive(WebIDL)]
Expand Down
8 changes: 7 additions & 1 deletion deno_webgpu/webidl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,13 @@ impl<'a> WebIdlConverter<'a> for GPUFeatureName {
_options: &Self::Options,
) -> Result<Self, WebIdlError> {
let s = value.to_rust_string_lossy(scope);
s.parse().map(Self).map_err(|()| {
let feature = match s.as_str() {
"chromium-experimental-multi-draw-indirect" => {
Ok(wgpu_types::Features::MULTI_DRAW_INDIRECT_COUNT)
}
_ => s.parse(),
};
feature.map(Self).map_err(|()| {
WebIdlError::new(
prefix,
context,
Expand Down
Loading
Loading