- From: Joe Pea via GitHub <sysbot+gh@w3.org>
- Date: Mon, 19 Feb 2024 20:59:32 +0000
- To: public-houdini-archive@w3.org
I'd like to render WebGL as the background of an element, for example. One way this could be achieved, apart from adding WebGL APIs to paint worklets, is to add the ability to send a SharedArrayBuffer to worklets, then the data can be used for pixel data in the worklet. For example, outside of a worklet, a hidden/offscreen canvas could be used to draw WebGL stuff into the shared buffer, then a worklet could simply update its pixels from that buffer (it would have no idea WebGL exists). I'm not sure if this is better than just adding WebGL (or WebGPU) APIs to worklets. Right now browsers like Chrome limit webgl contexts to 32 (make a 33rd context and the oldest context will be lost). I imagine this is probably the biggest reason that GPU APIs are not in worklets, as the numbers of backgrounds could easily reach more than 32 and start to crash things. It could be possible that WebGL/GPU in a worklet renders to a texture per worklet, and can draw swap texture to match the current worklet which would have speed overhead, but at least may not crash. In any case, enabling SAB for worklets would allow web devs to experiment with this and let them deal with the context limits. In many cases, it would work out fine (f.e. a single worklet on the background of `body`) -- GitHub Notification of comment by trusktr Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/872#issuecomment-1953152242 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 19 February 2024 20:59:33 UTC