Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing image crate from wasm builds #13247

Open
valaphee opened this issue May 5, 2024 · 0 comments
Open

Removing image crate from wasm builds #13247

valaphee opened this issue May 5, 2024 · 0 comments
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

Comments

@valaphee
Copy link
Contributor

valaphee commented May 5, 2024

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 or ImageData.

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 an HTMLImageElement which is handed over to wgpu.

What alternative(s) have you considered?

Additional context

Requires gfx-rs/wgpu#5668

@valaphee valaphee added C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels May 5, 2024
@alice-i-cecile alice-i-cecile added 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 O-Web Specific to web (WASM) builds C-Usability A simple quality-of-life change that makes Bevy easier to use S-Blocked This cannot move forward until something else changes X-Contentious There are nontrivial implications that should be thought through D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled C-Usability A simple quality-of-life change that makes Bevy easier to use labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants