-
-
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
Fix panic whilst loading UASTC encoded ktx2 textures #9158
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Maybe the GLTF loader also needs to be adjusted? |
Thanks for flagging @nicopap! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! It works now. Thank you for the fix
# 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 onRenderDevice
to work out which compressed image formats it can supportRenderDevice
is initialised byRenderPlugin
RenderPlugin
initialisation asyncRenderDevice
to be missing at the time ofImageTextureLoader
initialisation, which in turn meant UASTC encoded ktx2 textures were being converted to unsupported formats, and thus caused panicsSolution
ImageTextureLoader
initialisationChangelog
ImageTextureLoader
initialisation fromImagePlugin::build()
toImagePlugin::finish()
CompressedImageFormats::NONE
ifRenderDevice
resource is missing