Skip to content

Commit

Permalink
Revert "Proxy webgpu calls back to the main thread. NFC (#20124)" (#2…
Browse files Browse the repository at this point in the history
…1388)

This is a partial revert of 992d1e9
  • Loading branch information
sbc100 authored Feb 26, 2024
1 parent 1e875ed commit 3efadf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
6 changes: 0 additions & 6 deletions src/library_html5_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,4 @@ var LibraryHTML5WebGPU = {
{{{ html5_gpu.makeImportExport('render_bundle_encoder', 'RenderBundleEncoder') }}}
{{{ html5_gpu.makeImportExport('render_bundle', 'RenderBundle') }}}

for (const key of Object.keys(LibraryHTML5WebGPU)) {
if (typeof LibraryHTML5WebGPU[key] === 'function' && !(key + '__proxy' in LibraryHTML5WebGPU)) {
LibraryHTML5WebGPU[key + '__proxy'] = 'sync';
}
}

addToLibrary(LibraryHTML5WebGPU);
3 changes: 0 additions & 3 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2730,9 +2730,6 @@ for (var value in LibraryWebGPU.$WebGPU.FeatureName) {
for (const key of Object.keys(LibraryWebGPU)) {
if (typeof LibraryWebGPU[key] === 'function') {
LibraryWebGPU[key + '__i53abi'] = true;
if (!(key + '__proxy' in LibraryWebGPU)) {
LibraryWebGPU[key + '__proxy'] = 'sync';
}
}
}

Expand Down
13 changes: 3 additions & 10 deletions test/webgpu_get_device.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#include <stdio.h>

#include <emscripten/em_asm.h>
#include <emscripten.h>
#include <emscripten/html5_webgpu.h>

__attribute__((constructor)) void init() {
int main() {
EM_ASM({
Module['preinitializedWebGPUDevice'] = { this_is: 'a_dummy_object' };
});
}

int main() {
WGPUDevice d = emscripten_webgpu_get_device();
printf("emscripten_webgpu_get_device: %p\n", d);
return 0;
emscripten_webgpu_get_device();
}

0 comments on commit 3efadf4

Please sign in to comment.