Skip to content

Commit

Permalink
bevy_render: Convert KTX2 R8G8B8_(SRGB|UNORM) to Rgba8Unorm(Srgb)
Browse files Browse the repository at this point in the history
  • Loading branch information
superdump committed Jan 30, 2023
1 parent 5222a41 commit 52461b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_render/src/texture/ktx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,11 @@ pub fn ktx2_format_to_texture_format(
ktx2::Format::R8G8_SNORM => TextureFormat::Rg8Snorm,
ktx2::Format::R8G8_UINT => TextureFormat::Rg8Uint,
ktx2::Format::R8G8_SINT => TextureFormat::Rg8Sint,
ktx2::Format::R8G8B8_UNORM | ktx2::Format::R8G8B8_SRGB => {
return Err(TextureError::FormatRequiresTranscodingError(
TranscodeFormat::Rgb8,
));
}
ktx2::Format::R8G8B8A8_UNORM | ktx2::Format::R8G8B8A8_SRGB => {
if is_srgb {
TextureFormat::Rgba8UnormSrgb
Expand Down

0 comments on commit 52461b4

Please sign in to comment.