Skip to content

Commit ec1916a

Browse files
authored
Dds transcode channel order fix (#19849)
# Objective - Fix bug in dds channel order transcode - taken from #18411 ## Solution - fix it - improve docs a bit ## Testing - example in linked pr
1 parent 37aae00 commit ec1916a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/bevy_image/src/dds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pub fn dds_buffer_to_image(
2323
Ok(format) => (format, None),
2424
Err(TextureError::FormatRequiresTranscodingError(TranscodeFormat::Rgb8)) => {
2525
let format = if is_srgb {
26-
TextureFormat::Bgra8UnormSrgb
26+
TextureFormat::Rgba8UnormSrgb
2727
} else {
28-
TextureFormat::Bgra8Unorm
28+
TextureFormat::Rgba8Unorm
2929
};
3030
(format, Some(TranscodeFormat::Rgb8))
3131
}

crates/bevy_image/src/image.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,11 +1558,11 @@ pub enum DataFormat {
15581558
pub enum TranscodeFormat {
15591559
Etc1s,
15601560
Uastc(DataFormat),
1561-
// Has to be transcoded to R8Unorm for use with `wgpu`.
1561+
/// Has to be transcoded from `R8UnormSrgb` to `R8Unorm` for use with `wgpu`.
15621562
R8UnormSrgb,
1563-
// Has to be transcoded to R8G8Unorm for use with `wgpu`.
1563+
/// Has to be transcoded from `Rg8UnormSrgb` to `R8G8Unorm` for use with `wgpu`.
15641564
Rg8UnormSrgb,
1565-
// Has to be transcoded to Rgba8 for use with `wgpu`.
1565+
/// Has to be transcoded from `Rgb8` to `Rgba8` for use with `wgpu`.
15661566
Rgb8,
15671567
}
15681568

0 commit comments

Comments
 (0)