Refactor WebGPU ASYNCIFY to use JSPI

Smaller build size and better performance. Also, link time goes down a lot
This commit is contained in:
Wojtek Figat
2026-03-18 23:08:39 +01:00
parent 750fd1f941
commit a5ec8565e4
8 changed files with 130 additions and 28 deletions

View File

@@ -31,10 +31,10 @@ void* GPUBufferWebGPU::Map(GPUResourceMapMode mode)
userData.Call(status == WGPUMapAsyncStatus_Success, status, message);
};
wgpuBufferMapAsync(Buffer, mapMode, 0, _desc.Size, mapRequest.Info);
auto mapRequestResult = mapRequest.Wait();
auto mapRequestResult = mapRequest.Wait(_device->WebGPUInstance);
if (mapRequestResult == WGPUWaitStatus_TimedOut)
{
LOG(Error, "WebGPU buffer map request has timed out after {}s", mapRequest.Data.WaitTime);
LOG(Error, "WebGPU buffer map request has timed out after {}s", (int32)mapRequest.Data.WaitTime);
return nullptr;
}
if (mapRequestResult == WGPUWaitStatus_Error)