Closed janhohenheim closed 2 months ago
seems it's blocked on someone making that change in the image
crate then
My friend @bash is working on it as we speek :)
PR created 🙂 https://github.com/image-rs/image/pull/1857
Little update: even after the fix, HDRis in WASM retain limited usefulnes since WebGPU does not support texture filtering on 32 bit depth textures . Using filter-less samplers in Bevy is possible, but annoying to setup. Dropping texture filtering quite limits what one can do with the HDRis. This means that in practice, I ended up converting my HDRis to 16 bit depth JPGs. This is not really relevant for this issue, but might be useful for people stumbling upon this issue in the future.
Bevy version
0.9.1
What you did
I used the asset server to load an HDR in WASM.
What went wrong
The game crashed with the console reporting
'failed to spawn thread: Error { kind: Unsupported, message: "operation not supported on this platform" }'
Additional information
This happens because the underlying
image
crate usesscoped_threadpool
to decode HDRs, which spawns a thread pool: https://github.com/image-rs/image/blob/v0.24.5/src/codecs/hdr/decoder.rs#L463 As the error message says, this is not allowed in WASMPer https://github.com/image-rs/image/issues/772#issuecomment-1382406241, we could just remove the multithreading entirely from the HDR decoding to solve this for the time being.