check multi-planar format

This commit is contained in:
xiaopengli89 2023-12-05 21:16:22 +08:00 committed by Teodor Tanasoaia
parent f470103874
commit 2882735cb9
2 changed files with 6 additions and 1 deletions

View File

@ -980,7 +980,7 @@ impl crate::Device<super::Api> for super::Device {
wgt_view_formats = desc.view_formats.clone(); wgt_view_formats = desc.view_formats.clone();
wgt_view_formats.push(desc.format); 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 vk_view_formats = desc
.view_formats .view_formats
.iter() .iter()

View File

@ -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 /// Returns `true` if the format has a color aspect
pub fn has_color_aspect(&self) -> bool { pub fn has_color_aspect(&self) -> bool {
!self.is_depth_stencil_format() !self.is_depth_stencil_format()