check multi-planar format

This commit is contained in:
xiaopengli89 authored and Teodor Tanasoaia committed 2023-12-06 10:36:50 +01:00
1 parent f470103874
commit 2882735cb9
2 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -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()
+5
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
pub fn has_color_aspect(&self) -> bool {
!self.is_depth_stencil_format()