Skip to content

Commit

Permalink
fix view formats for nv12 texture
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 committed Oct 26, 2023
1 parent f7b476d commit 65d6c92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,16 @@ impl<A: HalApi> Device<A> {
if desc.format == *format {
continue;
}
match (desc.format, *format) {
(
TextureFormat::NV12,
TextureFormat::R8Unorm
| TextureFormat::R8Uint
| TextureFormat::Rg8Unorm
| TextureFormat::Rg8Uint,
) => continue,
_ => {}
}
if desc.format.remove_srgb_suffix() != format.remove_srgb_suffix() {
return Err(CreateTextureError::InvalidViewFormat(*format, desc.format));
}
Expand Down

0 comments on commit 65d6c92

Please sign in to comment.