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
This commit is contained in:
parent
37aae00120
commit
ec1916a240
@ -23,9 +23,9 @@ pub fn dds_buffer_to_image(
|
|||||||
Ok(format) => (format, None),
|
Ok(format) => (format, None),
|
||||||
Err(TextureError::FormatRequiresTranscodingError(TranscodeFormat::Rgb8)) => {
|
Err(TextureError::FormatRequiresTranscodingError(TranscodeFormat::Rgb8)) => {
|
||||||
let format = if is_srgb {
|
let format = if is_srgb {
|
||||||
TextureFormat::Bgra8UnormSrgb
|
TextureFormat::Rgba8UnormSrgb
|
||||||
} else {
|
} else {
|
||||||
TextureFormat::Bgra8Unorm
|
TextureFormat::Rgba8Unorm
|
||||||
};
|
};
|
||||||
(format, Some(TranscodeFormat::Rgb8))
|
(format, Some(TranscodeFormat::Rgb8))
|
||||||
}
|
}
|
||||||
|
@ -1558,11 +1558,11 @@ pub enum DataFormat {
|
|||||||
pub enum TranscodeFormat {
|
pub enum TranscodeFormat {
|
||||||
Etc1s,
|
Etc1s,
|
||||||
Uastc(DataFormat),
|
Uastc(DataFormat),
|
||||||
// Has to be transcoded to R8Unorm for use with `wgpu`.
|
/// Has to be transcoded from `R8UnormSrgb` to `R8Unorm` for use with `wgpu`.
|
||||||
R8UnormSrgb,
|
R8UnormSrgb,
|
||||||
// Has to be transcoded to R8G8Unorm for use with `wgpu`.
|
/// Has to be transcoded from `Rg8UnormSrgb` to `R8G8Unorm` for use with `wgpu`.
|
||||||
Rg8UnormSrgb,
|
Rg8UnormSrgb,
|
||||||
// Has to be transcoded to Rgba8 for use with `wgpu`.
|
/// Has to be transcoded from `Rgb8` to `Rgba8` for use with `wgpu`.
|
||||||
Rgb8,
|
Rgb8,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user