bevy/crates/bevy_render/src
66OJ66 c6d774029c 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-08-09 18:02:54 -07:00
..
camera bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
color bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
mesh Fix doc typo (#9162) 2023-08-09 18:01:23 -07:00
primitives bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
render_graph Add ViewNode to simplify render node management (#8118) 2023-05-08 19:42:23 +00:00
render_phase Apply codebase changes in preparation for StandardMaterial transmission (#8704) 2023-05-30 14:21:53 +00:00
render_resource fix module name for AssetPath shaders (#9186) 2023-08-09 18:01:46 -07:00
renderer Refs #8975 -- Add return to RenderDevice::poll() (#8977) 2023-06-28 01:05:03 +00:00
texture Fix panic whilst loading UASTC encoded ktx2 textures (#9158) 2023-08-09 18:02:54 -07:00
view bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
extract_component.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
extract_param.rs Use UnsafeWorldCell to increase code quality for SystemParam (#8174) 2023-04-01 15:45:07 +00:00
extract_resource.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
globals.rs Webgpu support (#8336) 2023-05-04 22:07:57 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
lib.rs Remove unused dependency on once_cell in bevy_render (#9039) 2023-07-04 21:30:58 +00:00
pipelined_rendering.rs Stop using unwrap in the pipelined rendering thread (#9052) 2023-08-09 18:02:44 -07:00
render_asset.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
settings.rs Webgpu support (#8336) 2023-05-04 22:07:57 +00:00
spatial_bundle.rs enum Visibility component (#6320) 2022-12-25 00:39:29 +00:00