Fix panic whilst loading UASTC encoded ktx2 textures#9158
Merged
mockersf merged 4 commits intobevyengine:mainfrom Jul 23, 2023
66OJ66:main
Merged
Fix panic whilst loading UASTC encoded ktx2 textures#9158mockersf merged 4 commits intobevyengine:mainfrom 66OJ66:main
mockersf merged 4 commits intobevyengine:mainfrom
66OJ66:main
Conversation
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Contributor
Contributor
|
Maybe the GLTF loader also needs to be adjusted? |
Contributor
Author
|
Thanks for flagging @nicopap! |
nicopap
approved these changes
Jul 14, 2023
mockersf
approved these changes
Jul 18, 2023
cart
pushed a commit
that referenced
this pull request
Aug 10, 2023
# 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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