This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
WASM: Support loading assets for GL backend #2174
Labels
feat: WASM support
This issue is related to WebAssembly compilation target support
Projects
Currently, an application compiled using the the
"gl"
backend crashes when loading textures.This is because the
Window
is created on one thread, and in open GL the textures must also be loaded on the same thread. However,amethyst_assets
'AssetStorage
takes in aThreadPool
, and loads assets asynchronously on any thread that picks up the processing task.Code points of interest:
amethyst/amethyst_rendy/src/bundle.rs:121
adds aTextureProcessorSystem
.amethyst/amethyst_rendy/src/system.rs:230
callsprocess
onAssetStorage
.rendy/resource/src/image.rs:86
callsdevice.create_image
.gfx/src/backend/gl/src/lib.rs:375
asserts the thread IDs are equal.What should succeed:
cargo run --example pong --features "gl audio"
The text was updated successfully, but these errors were encountered: