bevy/crates/bevy_gltf
66OJ66 5b0e6a5321
Fix panic whilst loading UASTC encoded ktx2 textures (#9158)
# Objective

Fixes #9121

Context:
- `ImageTextureLoader` depends on `RenderDevice` to work out which
compressed image formats it can support
- `RenderDevice` is initialised by `RenderPlugin`
- https://github.com/bevyengine/bevy/pull/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>
2023-07-23 01:27:37 +00:00
..
src Fix panic whilst loading UASTC encoded ktx2 textures (#9158) 2023-07-23 01:27:37 +00:00
Cargo.toml Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00