From 66b26a52f90d49ca6d1fd770b75d3861330a31ef Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 21 Feb 2024 12:58:49 -0800 Subject: [PATCH] Revert "Proxy webgpu calls back to the main thread. NFC (#20124)" This is a partial revert of 992d1e91d5 --- src/library_html5_webgpu.js | 6 ------ src/library_webgpu.js | 3 --- test/webgpu_get_device.cpp | 13 +++---------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/library_html5_webgpu.js b/src/library_html5_webgpu.js index 2ee99864f6c36..b7359799dce70 100644 --- a/src/library_html5_webgpu.js +++ b/src/library_html5_webgpu.js @@ -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); diff --git a/src/library_webgpu.js b/src/library_webgpu.js index 5496479d17d01..d128e8be44d4f 100644 --- a/src/library_webgpu.js +++ b/src/library_webgpu.js @@ -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'; - } } } diff --git a/test/webgpu_get_device.cpp b/test/webgpu_get_device.cpp index a5861042059f7..80ef054bf3c66 100644 --- a/test/webgpu_get_device.cpp +++ b/test/webgpu_get_device.cpp @@ -1,16 +1,9 @@ -#include - -#include +#include #include -__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(); }