Skip to content

Conversation

@kainino0x
Copy link
Collaborator

Blocked on Firefox support.
Fixes #20280

@kainino0x
Copy link
Collaborator Author

FYI @jimblandy. Supporting this is not urgent, but it should be more efficient than the old code.

@jimblandy
Copy link

@kainino0x Which WebGPU API does this need from Firefox, specifically?

@kainino0x
Copy link
Collaborator Author

Sorry, forgot the detail wasn't here. It's on the linked issue.

This uses the overload of setBindGroup that takes a Uint32Array:

interface mixin GPUBindingCommandsMixin {
    undefined setBindGroup(GPUIndex32 index, GPUBindGroup? bindGroup,
        optional sequence<GPUBufferDynamicOffset> dynamicOffsets = []);

    undefined setBindGroup(GPUIndex32 index, GPUBindGroup? bindGroup,
        Uint32Array dynamicOffsetsData,
        GPUSize64 dynamicOffsetsDataStart,
        GPUSize32 dynamicOffsetsDataLength);
};

Firefox only seems to have the first one:
https://searchfox.org/mozilla-central/source/dom/webidl/WebGPU.webidl#913

@jimblandy
Copy link

Firefox work tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=1878804

This is not an immediate priority for us, but it's in the spec and we will get to it eventually.

@kainino0x kainino0x marked this pull request as ready for review November 5, 2024 17:11
@kainino0x
Copy link
Collaborator Author

People are starting to run into some performance bottlenecks with setBindGroup, and this will help a little bit, so let's go ahead and do it.

@kainino0x
Copy link
Collaborator Author

PTAL @lokokung

@kainino0x kainino0x requested a review from sbc100 November 5, 2024 17:13
@kainino0x
Copy link
Collaborator Author

kainino0x commented Apr 14, 2025

This won't be fixed in Emscripten's current WebGPU bindings, but now that Firefox has been fixed, I'll finally fix this in emdawnwebgpu (see #23432). https://dawn-review.googlesource.com/c/dawn/+/236936

@kainino0x kainino0x closed this Apr 14, 2025
copybara-service bot pushed a commit to google/dawn that referenced this pull request Apr 14, 2025
This was fixed in Firefox, so now we can use it! Tested in my local
sample project that this works in both Chrome and Firefox Nightly.

Migrated from emscripten-core/emscripten#21221

No-Try: true
Bug: emscripten-core/emscripten#20280
Change-Id: I0900e635a043413e516ec73b7de4978d4e574724
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/236936
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

library_webgpu.js: the setBindGroup shim can be simplified.

2 participants