- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
Fix panic whilst loading UASTC encoded ktx2 textures #9158
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
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 <[email protected]>
Objective
Fixes #9121
Context:
ImageTextureLoaderdepends onRenderDeviceto work out which compressed image formats it can supportRenderDeviceis initialised byRenderPluginRenderPlugininitialisation asyncRenderDeviceto be missing at the time ofImageTextureLoaderinitialisation, which in turn meant UASTC encoded ktx2 textures were being converted to unsupported formats, and thus caused panicsSolution
ImageTextureLoaderinitialisationChangelog
ImageTextureLoaderinitialisation fromImagePlugin::build()toImagePlugin::finish()CompressedImageFormats::NONEifRenderDeviceresource is missing