Skip to content

Commit a8ac628

Browse files
committed
Proxy webgpu calls back to the main thread. NFC
Until we have real multi-threaded webgpu support this is probable the best we can do. Fixes: #19645
1 parent 2fca90b commit a8ac628

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/library_webgpu.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ var LibraryWebGPU = {
21962196
#endif
21972197

21982198
var bundles = Array.from(HEAP32.subarray(bundlesPtr >> 2, (bundlesPtr >> 2) + count),
2199-
function(id) { return WebGPU.mgrRenderBundle.get(id); });
2199+
(id) => WebGPU.mgrRenderBundle.get(id));
22002200
pass["executeBundles"](bundles);
22012201
},
22022202

@@ -2582,23 +2582,22 @@ var LibraryWebGPU = {
25822582
var device = WebGPU.mgrDevice.get(deviceId);
25832583
var context = WebGPU.mgrSurface.get(surfaceId);
25842584

2585-
25862585
#if ASSERTIONS
25872586
assert({{{ gpu.PresentMode.Fifo }}} ===
25882587
{{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUSwapChainDescriptor.presentMode) }}});
25892588
#endif
25902589

25912590
var canvasSize = [
2592-
{{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUSwapChainDescriptor.width) }}},
2593-
{{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUSwapChainDescriptor.height) }}}
2591+
{{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUSwapChainDescriptor.width) }}},
2592+
{{{ gpu.makeGetU32('descriptor', C_STRUCTS.WGPUSwapChainDescriptor.height) }}}
25942593
];
25952594

25962595
if (canvasSize[0] !== 0) {
2597-
context["canvas"]["width"] = canvasSize[0];
2596+
context["canvas"]["width"] = canvasSize[0];
25982597
}
25992598

26002599
if (canvasSize[1] !== 0) {
2601-
context["canvas"]["height"] = canvasSize[1];
2600+
context["canvas"]["height"] = canvasSize[1];
26022601
}
26032602

26042603
var configuration = {
@@ -2642,6 +2641,7 @@ for (var value in LibraryWebGPU.$WebGPU.FeatureName) {
26422641

26432642
for (const key of Object.keys(LibraryWebGPU)) {
26442643
LibraryWebGPU[key + '__i53abi'] = true;
2644+
LibraryWebGPU[key + '__proxy'] = 'sync';
26452645
}
26462646

26472647
autoAddDeps(LibraryWebGPU, '$WebGPU');

0 commit comments

Comments
 (0)