Removing image crate from wasm builds #13247
Labels
A-Rendering
Drawing game state to the screen
C-Dependencies
A change to the crates that Bevy depends on
C-Performance
A change motivated by improving speed, memory usage or compile times
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
O-Web
Specific to web (WASM) builds
S-Blocked
This cannot move forward until something else changes
X-Contentious
There are nontrivial implications that should be thought through
What problem does this solve or what need does it fill?
There is no need for a full-on image parsing library on wasm builds, as the user agent integrates plenty of image parser. It's also possible to directly initialize images from such sources. Either through
HTMLImageElement
orImageData
.This would improve the loading times, by removing the image parser running in wasm, and the delivery time of the wasm file itself, as I assume that the image crate itself is quite heavy.
This is also needed for video support on Web, as there is not really any other option. Any sort of software encoding would be probably too slow or cost a lot cpu.
What solution would you like?
Switching over to using
HTMLImageElement
, but this would require to somehow prevent the AssetServer from fetching, and the AssetLoader getting the full url to create anHTMLImageElement
which is handed over towgpu
.What alternative(s) have you considered?
Additional context
Requires gfx-rs/wgpu#5668
The text was updated successfully, but these errors were encountered: