-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Panic whilst loading ktx2 file #9121
Comments
I don't know how this worked previously, but the only desktop/laptop hardware that supported ASTC was Intel iGPUs, and they dropped support for it in recent hardware. edit: I guess previously it was somehow autoconverting it with basis-universal stuff somehow? edit2: It seems like #8336 is when the crashing started. |
Yeah, I checked the original PR where compressed texture support was added, and this comment mentioned an potential issue with WebGPU: #3884 (comment) |
After investigating a bit more, this is caused by a combination of 2 issues:
So, fixing this should just be a case of delaying the |
# Objective Fixes #9121 Context: - `ImageTextureLoader` depends on `RenderDevice` to work out which compressed image formats it can support - `RenderDevice` is initialised by `RenderPlugin` - #8336 made `RenderPlugin` initialisation async - This caused `RenderDevice` to be missing at the time of `ImageTextureLoader` initialisation, which in turn meant UASTC encoded ktx2 textures were being converted to unsupported formats, and thus caused panics ## Solution - Delay `ImageTextureLoader` initialisation --- ## Changelog - Moved `ImageTextureLoader` initialisation from `ImagePlugin::build()` to `ImagePlugin::finish()` - Default to `CompressedImageFormats::NONE` if `RenderDevice` resource is missing --------- Co-authored-by: 66OJ66 <hi0obxud@anonaddy.me>
# Objective Fixes #9121 Context: - `ImageTextureLoader` depends on `RenderDevice` to work out which compressed image formats it can support - `RenderDevice` is initialised by `RenderPlugin` - #8336 made `RenderPlugin` initialisation async - This caused `RenderDevice` to be missing at the time of `ImageTextureLoader` initialisation, which in turn meant UASTC encoded ktx2 textures were being converted to unsupported formats, and thus caused panics ## Solution - Delay `ImageTextureLoader` initialisation --- ## Changelog - Moved `ImageTextureLoader` initialisation from `ImagePlugin::build()` to `ImagePlugin::finish()` - Default to `CompressedImageFormats::NONE` if `RenderDevice` resource is missing --------- Co-authored-by: 66OJ66 <hi0obxud@anonaddy.me>
Bevy version
v0.11.0
[Optional] Relevant system information
Rust 1.70
OS: openSUSE Tumbleweed
What went wrong
I attempted to load a
ktx2
file which led to the following panic.This file loaded without issue in Bevy v0.10.1 (and earlier) with these features enabled:
Additional information
I've uploaded a basic example here: https://github.com/66OJ66/basis_universal_error_repo
The original PNG file was sourced from here: https://ambientcg.com/view?id=Ground037
I converted it to ktx2 using toktx (https://github.khronos.org/KTX-Software/ktxtools/toktx.html).
The exact command was:
toktx --encode uastc --zcmp 22 --genmipmap --uastc_rdo_l 0.5 {output} {input.png}
The text was updated successfully, but these errors were encountered: