Skip to content

Commit 6e8f1d7

Browse files
xiaopengli89bradwerth
authored andcommitted
check multi-planar format
1 parent 9ced6ba commit 6e8f1d7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

wgpu-hal/src/vulkan/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ impl crate::Device<super::Api> for super::Device {
980980
wgt_view_formats = desc.view_formats.clone();
981981
wgt_view_formats.push(desc.format);
982982

983-
if self.shared.private_caps.image_format_list {
983+
if self.shared.private_caps.image_format_list && !desc.format.is_multi_planar_format() {
984984
vk_view_formats = desc
985985
.view_formats
986986
.iter()

wgpu-types/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,6 +2890,11 @@ impl TextureFormat {
28902890
}
28912891
}
28922892

2893+
/// Returns `true` if the format is a multi-planar format
2894+
pub fn is_multi_planar_format(&self) -> bool {
2895+
matches!(*self, Self::NV12)
2896+
}
2897+
28932898
/// Returns `true` if the format has a color aspect
28942899
pub fn has_color_aspect(&self) -> bool {
28952900
!self.is_depth_stencil_format()

0 commit comments

Comments
 (0)