Skip to content

Commit

Permalink
check multi-planar format
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 authored and teoxoy committed Dec 6, 2023
1 parent f470103 commit 2882735
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ impl crate::Device<super::Api> for super::Device {
wgt_view_formats = desc.view_formats.clone();
wgt_view_formats.push(desc.format);

if self.shared.private_caps.image_format_list {
if self.shared.private_caps.image_format_list && !desc.format.is_multi_planar_format() {
vk_view_formats = desc
.view_formats
.iter()
Expand Down
5 changes: 5 additions & 0 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2890,6 +2890,11 @@ impl TextureFormat {
}
}

/// Returns `true` if the format is a multi-planar format
pub fn is_multi_planar_format(&self) -> bool {
matches!(*self, Self::NV12)
}

/// Returns `true` if the format has a color aspect
pub fn has_color_aspect(&self) -> bool {
!self.is_depth_stencil_format()
Expand Down

0 comments on commit 2882735

Please sign in to comment.