Skip to content

Commit

Permalink
fix hal view formats
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 committed Oct 30, 2023
1 parent 981d16a commit 1950abe
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,17 +703,18 @@ impl<A: HalApi> Device<A> {
if desc.format == *format {
continue;
}
if let (
TextureFormat::NV12,
TextureFormat::R8Unorm
| TextureFormat::R8Uint
| TextureFormat::Rg8Unorm
| TextureFormat::Rg8Uint,
) = (desc.format, *format)

if !matches!(
(desc.format, *format),
(
TextureFormat::NV12,
TextureFormat::R8Unorm
| TextureFormat::R8Uint
| TextureFormat::Rg8Unorm
| TextureFormat::Rg8Uint,
)
) && desc.format.remove_srgb_suffix() != format.remove_srgb_suffix()
{
continue;
}
if desc.format.remove_srgb_suffix() != format.remove_srgb_suffix() {
return Err(CreateTextureError::InvalidViewFormat(*format, desc.format));
}
hal_view_formats.push(*format);
Expand Down

0 comments on commit 1950abe

Please sign in to comment.