Skip to content

Commit f817073

Browse files
committed
[ExecuTorch][WebGPU] Use requiredFeatures instance API on native + emscripten Dawn
Pull Request resolved: #20652 **Key the `timedWaitAny` instance setup to the actual Dawn API instead of `__EMSCRIPTEN__`, so native-rig Dawn and emscripten/emdawnwebgpu use the modern `requiredFeatures` path and only the vendored Dawn uses the legacy `capabilities.*` path.** The instance-descriptor setup was guarded by `#if defined(__EMSCRIPTEN__)`, which routed emscripten (emdawnwebgpu, emcc 4.0.19+) through the legacy `capabilities.*` API that no longer exists there. The guard now keys off the API actually present. Key changes: - `WebGPUDevice.cpp` — `#if defined(__EMSCRIPTEN__)` → `#if defined(WEBGPU_DAWN_INSTANCE_CAPABILITIES)`. The legacy `instance_desc.capabilities.*` path is taken only by the buck-vendored Dawn (which defines the macro); native cmake Dawn and emscripten leave it undefined and take the `requiredFeatures` / `WGPUInstanceFeatureName_TimedWaitAny` path. Co-authored-with: Claude Code. ghstack-source-id: 399812934 @exported-using-ghexport Differential Revision: [D110149678](https://our.internmc.facebook.com/intern/diff/D110149678/)
1 parent 3a02baf commit f817073

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

backends/webgpu/runtime/WebGPUDevice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ WebGPUContext create_webgpu_context() {
9090

9191
// TimedWaitAny lets webgpu_wait() block on futures via wgpuInstanceWaitAny.
9292
WGPUInstanceDescriptor instance_desc = {};
93-
#if defined(__EMSCRIPTEN__)
93+
// Vendored (buck) Dawn uses the older capabilities.* API; the rig's native
94+
// Dawn and emscripten's emdawnwebgpu (emcc 4.0.19+) use requiredFeatures.
95+
#if defined(WEBGPU_DAWN_INSTANCE_CAPABILITIES)
9496
instance_desc.capabilities.timedWaitAnyEnable = true;
9597
instance_desc.capabilities.timedWaitAnyMaxCount = 1;
9698
#else

0 commit comments

Comments
 (0)