From 8ea4a3decf96121b89dbae5cde61a87884cd5c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kurt=20K=C3=BChnert?= Date: Mon, 11 Jul 2022 14:11:29 +0000 Subject: [PATCH] TextureFormat::R16Unorm support for Image (#5249) # Objective Currently some TextureFormats are not supported by the Image type. The `TextureFormat::R16Unorm` format is useful for storing heightmaps. This small change would unblock releasing my terrain plugin on bevy 0.8. ## Solution Added `TextureFormat::R16Unorm` support to Image. This is an alternative (short term solution) to the large texture format issue https://github.com/bevyengine/bevy/pull/4124. --- crates/bevy_render/src/texture/image.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bevy_render/src/texture/image.rs b/crates/bevy_render/src/texture/image.rs index 589e866749..9df55dbf0a 100644 --- a/crates/bevy_render/src/texture/image.rs +++ b/crates/bevy_render/src/texture/image.rs @@ -519,6 +519,7 @@ impl TextureFormatPixelInfo for TextureFormat { | TextureFormat::R16Float | TextureFormat::Rg16Uint | TextureFormat::Rg16Sint + | TextureFormat::R16Unorm | TextureFormat::Rg16Float | TextureFormat::Rgba16Uint | TextureFormat::Rgba16Sint @@ -552,6 +553,7 @@ impl TextureFormatPixelInfo for TextureFormat { | TextureFormat::R8Sint | TextureFormat::R16Uint | TextureFormat::R16Sint + | TextureFormat::R16Unorm | TextureFormat::R16Float | TextureFormat::R32Uint | TextureFormat::R32Sint