You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When WebGPU shipped in May 2023 it didn't support loading images from HTMLImageElement. The spec was updated to allow this and Chrome shipped support in v118 so, ... update the examples to use HTMLImageElement
using ImageBitmap is supposedly "better", at least in Chrome, as the idea is that using ImageBitmap is supposed to load the image into the GPU so that when you actually go to use it for uploading into WebGPU (and WebGL) it's ready to use. Further, you can pass in options like "premultiplyAlpha" and "colorSpaceConversion"
Conversely, HTMLImageElement image might not be in a format that can be used immediately and so it forces the browser to re-decode the image, making it slow. For example the HTMLImageElement might use premultiplied alpha which is a lossy format. If you request premultiplyAlpha false, the browser is require to re-decode the image so it is not lossy.
In any case, HTMLImageElement is more common (probably) and the examples should probably be switched to use it? Or maybe just bring it up.
The text was updated successfully, but these errors were encountered:
When WebGPU shipped in May 2023 it didn't support loading images from HTMLImageElement. The spec was updated to allow this and Chrome shipped support in v118 so, ... update the examples to use HTMLImageElement
using
ImageBitmap
is supposedly "better", at least in Chrome, as the idea is that usingImageBitmap
is supposed to load the image into the GPU so that when you actually go to use it for uploading into WebGPU (and WebGL) it's ready to use. Further, you can pass in options like "premultiplyAlpha" and "colorSpaceConversion"Conversely, HTMLImageElement image might not be in a format that can be used immediately and so it forces the browser to re-decode the image, making it slow. For example the HTMLImageElement might use premultiplied alpha which is a lossy format. If you request premultiplyAlpha false, the browser is require to re-decode the image so it is not lossy.
In any case, HTMLImageElement is more common (probably) and the examples should probably be switched to use it? Or maybe just bring it up.
The text was updated successfully, but these errors were encountered: