Skip to content

Commit 3efadf4

Browse files
authored
Revert "Proxy webgpu calls back to the main thread. NFC (#20124)" (#21388)
This is a partial revert of 992d1e9
1 parent 1e875ed commit 3efadf4

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

src/library_html5_webgpu.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,4 @@ var LibraryHTML5WebGPU = {
9090
{{{ html5_gpu.makeImportExport('render_bundle_encoder', 'RenderBundleEncoder') }}}
9191
{{{ html5_gpu.makeImportExport('render_bundle', 'RenderBundle') }}}
9292

93-
for (const key of Object.keys(LibraryHTML5WebGPU)) {
94-
if (typeof LibraryHTML5WebGPU[key] === 'function' && !(key + '__proxy' in LibraryHTML5WebGPU)) {
95-
LibraryHTML5WebGPU[key + '__proxy'] = 'sync';
96-
}
97-
}
98-
9993
addToLibrary(LibraryHTML5WebGPU);

src/library_webgpu.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,9 +2730,6 @@ for (var value in LibraryWebGPU.$WebGPU.FeatureName) {
27302730
for (const key of Object.keys(LibraryWebGPU)) {
27312731
if (typeof LibraryWebGPU[key] === 'function') {
27322732
LibraryWebGPU[key + '__i53abi'] = true;
2733-
if (!(key + '__proxy' in LibraryWebGPU)) {
2734-
LibraryWebGPU[key + '__proxy'] = 'sync';
2735-
}
27362733
}
27372734
}
27382735

test/webgpu_get_device.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
#include <stdio.h>
2-
3-
#include <emscripten/em_asm.h>
1+
#include <emscripten.h>
42
#include <emscripten/html5_webgpu.h>
53

6-
__attribute__((constructor)) void init() {
4+
int main() {
75
EM_ASM({
86
Module['preinitializedWebGPUDevice'] = { this_is: 'a_dummy_object' };
97
});
10-
}
11-
12-
int main() {
13-
WGPUDevice d = emscripten_webgpu_get_device();
14-
printf("emscripten_webgpu_get_device: %p\n", d);
15-
return 0;
8+
emscripten_webgpu_get_device();
169
}

0 commit comments

Comments
 (0)