RESOLVED FIXED 278908
[GTK][WPE][Skia] Invalid result or crash when painting an accelerated ImageBitmap into WebGL
https://bugs.webkit.org/show_bug.cgi?id=278908
Summary [GTK][WPE][Skia] Invalid result or crash when painting an accelerated ImageBi...
Miguel Gomez
Reported 2024-08-30 02:06:09 PDT
A common pattern when rendering to WebGL is creating an ImageBitmap, rendering into it, and then uploading the result into a WebGL texture. This is typically done for text rendering, for example. When the created ImageBitmap is big enough, it's created as accelerated, which means that it's backed by a gl texture instead of a normal buffer. In this case, trying to render the content of that ImageBitmap won't work as expected. It may cause a crash or fail to actually render properly. The problem can be avoided by not accelerating ImageBitmaps, which is why I know that the problem is related to the accelerated ones. It can be reproduced with https://strike.lightningjs.io/es6/#home where the rendering will be wrong.
Attachments
minimal reproducing example (3.54 KB, text/html)
2024-09-04 05:48 PDT, Pawel Lampe
no flags
Pawel Lampe
Comment 1 2024-09-04 05:48:20 PDT
Created attachment 472446 [details] minimal reproducing example
Pawel Lampe
Comment 2 2024-09-04 05:50:48 PDT
The issue is about worker with context B creating accelerated ImageBitmap, transferring it (with ownership) to the main, and the main thread with context A using such ImageBitmap (context B) in texImage2D() and therefore leading to failure of when reading pixels - due to skia GrDirectContext mismatch.
Pawel Lampe
Comment 3 2024-09-04 08:18:19 PDT
EWS
Comment 4 2024-09-12 09:56:34 PDT
Committed 283563@main (b2b8d3a40c38): <https://commits.webkit.org/283563@main> Reviewed commits have been landed. Closing PR #33122 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.