-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
I see that webgpu OffscreenCanvas rendering is already available in chromium with this bug fix:
- https://bugs.chromium.org/p/chromium/issues/detail?id=1169710
- https://github.com/gpuweb/cts/blob/main/src/webgpu/web_platform/canvas/context_creation.spec.ts
Looking at current implementation of wgpuInstanceCreateSurface(), it appears to me that rendering to OffscreenCanvas is currently not available in native webgpu API.
This code section shows that wgpuInstanceCreateSurface() asserts expect webgpu surface to be associated only to HTML canvas element?
https://github.com/emscripten-core/emscripten/blob/main/src/library_webgpu.js#L2410
Is my understanding correct?
If so, is there any known alternatives to render to canvas on webworker then transfer rendered output to main thread for chrome browser display?
In my prototype code, I am trying to configure OffscreenCanvas in the HTML and referencing this canvas in wgpuInstanceCreateSurface() call to be used for subsequent rendering.
It appears mandatory to define WGPUSurfaceDescriptorFromCanvasHTMLSelector when creating webgpu surface.
https://github.com/emscripten-core/emscripten/blob/main/src/library_webgpu.js#L2399