From abfc12e58f081bae6d9cf4ea31f38ca5b3d31233 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Wed, 11 Oct 2023 16:04:48 +0200 Subject: [PATCH] Prettier vk descriptor initialization Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com> --- wgpu-hal/src/vulkan/adapter.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index c41a18a1237..6e6eec1db0e 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1772,24 +1772,8 @@ fn supports_bgra8unorm_storage( } unsafe { - let mut properties3 = vk::FormatProperties3 { - s_type: vk::StructureType::FORMAT_PROPERTIES_3, - p_next: std::ptr::null_mut(), - linear_tiling_features: vk::FormatFeatureFlags2::empty(), - optimal_tiling_features: vk::FormatFeatureFlags2::empty(), - buffer_features: vk::FormatFeatureFlags2::empty(), - }; - - let p_next: *mut ash::vk::FormatProperties3 = &mut properties3; - let mut properties2 = vk::FormatProperties2 { - s_type: vk::StructureType::FORMAT_PROPERTIES_2, - p_next: p_next as *mut _, - format_properties: vk::FormatProperties { - linear_tiling_features: vk::FormatFeatureFlags::empty(), - optimal_tiling_features: vk::FormatFeatureFlags::empty(), - buffer_features: vk::FormatFeatureFlags::empty(), - }, - }; + let mut properties3 = vk::FormatProperties3::default(); + let mut properties2 = vk::FormatProperties2::builder().push_next(&mut properties3); instance.get_physical_device_format_properties2( phd,