From b99d34699ac67cf3179ed2299cbc2d853e02558a Mon Sep 17 00:00:00 2001 From: "lixiaopeng.jetspark" Date: Fri, 27 Oct 2023 21:01:07 +0800 Subject: [PATCH] fix TEXTURE_FORMAT_NV12 feature for vulkan --- wgpu-hal/src/vulkan/adapter.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index bbdf7d2e5a4..8c70d155f04 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -538,7 +538,6 @@ impl PhysicalDeviceFeatures { vk::Format::G8_B8R8_2PLANE_420_UNORM, vk::ImageTiling::OPTIMAL, vk::FormatFeatureFlags::SAMPLED_IMAGE - | vk::FormatFeatureFlags::STORAGE_IMAGE | vk::FormatFeatureFlags::TRANSFER_SRC | vk::FormatFeatureFlags::TRANSFER_DST, ), @@ -1541,14 +1540,14 @@ impl crate::Adapter for super::Adapter { .framebuffer_stencil_sample_counts .min(limits.sampled_image_stencil_sample_counts) } else { - match format.sample_type(None).unwrap() { - wgt::TextureSampleType::Float { filterable: _ } => limits + match format.sample_type(None) { + Some(wgt::TextureSampleType::Float { filterable: _ }) => limits .framebuffer_color_sample_counts .min(limits.sampled_image_color_sample_counts), - wgt::TextureSampleType::Sint | wgt::TextureSampleType::Uint => { + Some(wgt::TextureSampleType::Sint) | Some(wgt::TextureSampleType::Uint) => { limits.sampled_image_integer_sample_counts } - _ => unreachable!(), + _ => vk::SampleCountFlags::TYPE_1, } };