bevy/crates/bevy_render/src/texture
Mike 6903a9411b get pixel size from wgpu (#6820)
# Objective

- Get rid of giant match statement to get PixelInfo. 
- This will allow for supporting any texture that is uncompressed, instead of people needing to PR in any textures that are supported in wgpu, but not bevy.

## Solution

- More conservative alternative to https://github.com/bevyengine/bevy/pull/6788, where we don't try to make some of the calculations correct for compressed types.
- Delete `PixelInfo` and get the pixel_size directly from wgpu. Data from wgpu is here: https://docs.rs/wgpu-types/0.14.0/src/wgpu_types/lib.rs.html#2359
- Panic if the texture is a compressed type. An integer byte size of a pixel is no longer a valid concept when talking about compressed textures.
- All internal usages use `pixel_size` and not `pixel_info` and are on uncompressed formats. Most of these usages are on either explicit texture formats or slightly indirectly through `TextureFormat::bevy_default()`. The other uses are in `TextureAtlas` and have other calculations that assumes the texture is uncompressed. 

## Changelog

- remove `PixelInfo` and get `pixel_size` from wgpu

## Migration Guide

`PixelInfo` has been removed. `PixelInfo::components` is equivalent to `texture_format.describe().components`. `PixelInfo::type_size` can be gotten from `texture_format.describe().block_size/ texture_format.describe().components`. But note this can yield incorrect results for some texture types like Rg11b10Float.
2022-12-11 18:22:07 +00:00
..
basis.rs Use new let-else syntax where possible (#6463) 2022-11-04 21:32:09 +00:00
dds.rs dds: Ensure the Extent3d for compressed textures represents the physical size (#5406) 2022-07-20 22:43:36 +00:00
fallback_image.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
hdr_texture_loader.rs update image to 0.24 (#4121) 2022-05-28 02:00:55 +00:00
image_texture_conversion.rs Expose Image conversion functions (fixes #5452) (#5527) 2022-09-03 17:47:38 +00:00
image_texture_loader.rs Do not crash if RenderDevice doesn't exist (#4427) 2022-04-05 19:37:23 +00:00
image.rs get pixel size from wgpu (#6820) 2022-12-11 18:22:07 +00:00
ktx2.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
mod.rs bevy_reflect: Register missing reflected types for bevy_render (#6725) 2022-11-23 00:41:21 +00:00
texture_cache.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00