From 5938fd2633023c720eeb3282ee7145319c8e3425 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 28 Nov 2023 15:05:27 +0100 Subject: [PATCH] Update Vulkan-Headers to 1.3.271 (#816) * Update Vulkan-Headers to 1.3.270 * Update Vulkan-Headers to 1.3.271 * extensions/nv/low_latency2: Support extension revision 2 Upon request the VK_NV_low_latency2 spec and API has been updated to move the count pointer from the `vkGetLatencyTimingsNV()` function to the `vkGetLatencyMarkerInfoNV` struct where the array pointer already resided. This got uncovered when it was realized that the `latency_marker_info` argument isn't an array at all (which the original design of this extension suggested), but a pointer to a single struct that _contains_ a pointer to an array, with the length passed as a separate argument to the function instead. The move of this count argument to a struct field - together with proper array length annotations - gets our generator to automatically emit a setter based on a slice argument. --- Changelog.md | 2 +- ash/Cargo.toml | 2 +- ash/src/extensions/nv/low_latency2.rs | 23 ++---------- ash/src/vk/const_debugs.rs | 3 ++ ash/src/vk/definitions.rs | 50 ++++++++++++++++++++++++--- ash/src/vk/extensions.rs | 16 +++++++-- generator/Vulkan-Headers | 2 +- 7 files changed, 66 insertions(+), 32 deletions(-) diff --git a/Changelog.md b/Changelog.md index 00b6b12..13d9cd8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `Handle::is_null()` to allow checking if a handle is a `NULL` value (#694) - Allow building `Entry`/`Instance`/`Device` from handle+fns (see their `from_parts_1_x()` associated functions) (#748) -- Update Vulkan-Headers to 1.3.269 (#760, #763, #783) +- Update Vulkan-Headers to 1.3.271 (#760, #763, #783, #816) - Added `VK_NV_memory_decompression` device extension (#761) - Added `VK_GOOGLE_display_timing` device extension (#765) - Added `VK_ANDROID_external_memory_android_hardware_buffer` device extension (#769) diff --git a/ash/Cargo.toml b/ash/Cargo.toml index 19952f3..e27f228 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ash" -version = "0.37.0+1.3.269" +version = "0.37.0+1.3.271" authors = [ "Maik Klein ", "Benjamin Saunders ", diff --git a/ash/src/extensions/nv/low_latency2.rs b/ash/src/extensions/nv/low_latency2.rs index 88a1f92..76a6720 100644 --- a/ash/src/extensions/nv/low_latency2.rs +++ b/ash/src/extensions/nv/low_latency2.rs @@ -4,7 +4,6 @@ use crate::RawPtr; use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; -use std::ptr; /// #[derive(Clone)] @@ -53,32 +52,14 @@ impl LowLatency2 { (self.fp.set_latency_marker_nv)(self.handle, swapchain, latency_marker_info) } - /// Retrieve the number of elements to pass to [`get_latency_timings()`][Self::get_latency_timings()] - #[inline] - pub unsafe fn get_latency_timings_len(&self, swapchain: vk::SwapchainKHR) -> usize { - let mut count = 0; - (self.fp.get_latency_timings_nv)(self.handle, swapchain, &mut count, ptr::null_mut()); - count as usize - } - /// - /// - /// Call [`get_latency_timings_len()`][Self::get_latency_timings_len()] to query the number of elements to pass to `latency_marker_info`. - /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer. #[inline] pub unsafe fn get_latency_timings( &self, swapchain: vk::SwapchainKHR, - latency_marker_info: &mut [vk::GetLatencyMarkerInfoNV<'_>], + latency_marker_info: &mut vk::GetLatencyMarkerInfoNV<'_>, ) { - let mut count = latency_marker_info.len() as u32; - (self.fp.get_latency_timings_nv)( - self.handle, - swapchain, - &mut count, - latency_marker_info.as_mut_ptr(), - ); - assert_eq!(count as usize, latency_marker_info.len()); + (self.fp.get_latency_timings_nv)(self.handle, swapchain, latency_marker_info) } /// diff --git a/ash/src/vk/const_debugs.rs b/ash/src/vk/const_debugs.rs index c7b2b61..af86517 100644 --- a/ash/src/vk/const_debugs.rs +++ b/ash/src/vk/const_debugs.rs @@ -5272,6 +5272,9 @@ impl fmt::Debug for StructureType { Some("PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT") } Self::HDR_METADATA_EXT => Some("HDR_METADATA_EXT"), + Self::PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG => { + Some("PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG") + } Self::SHARED_PRESENT_SURFACE_CAPABILITIES_KHR => { Some("SHARED_PRESENT_SURFACE_CAPABILITIES_KHR") } diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index d9f9dc5..a3b4de4 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -58,7 +58,7 @@ pub const API_VERSION_1_2: u32 = make_api_version(0, 1, 2, 0); #[doc = ""] pub const API_VERSION_1_3: u32 = make_api_version(0, 1, 3, 0); #[doc = ""] -pub const HEADER_VERSION: u32 = 269; +pub const HEADER_VERSION: u32 = 271; #[doc = ""] pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 3, HEADER_VERSION); #[doc = ""] @@ -49770,7 +49770,7 @@ impl<'a> DirectDriverLoadingInfoLUNARG<'a> { #[doc = ""] pub struct DirectDriverLoadingListLUNARG<'a> { pub s_type: StructureType, - pub p_next: *mut c_void, + pub p_next: *const c_void, pub mode: DirectDriverLoadingModeLUNARG, pub driver_count: u32, pub p_drivers: *const DirectDriverLoadingInfoLUNARG<'a>, @@ -49781,7 +49781,7 @@ impl ::std::default::Default for DirectDriverLoadingListLUNARG<'_> { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null_mut(), + p_next: ::std::ptr::null(), mode: DirectDriverLoadingModeLUNARG::default(), driver_count: u32::default(), p_drivers: ::std::ptr::null(), @@ -51872,6 +51872,7 @@ impl<'a> SetLatencyMarkerInfoNV<'a> { pub struct GetLatencyMarkerInfoNV<'a> { pub s_type: StructureType, pub p_next: *const c_void, + pub timing_count: u32, pub p_timings: *mut LatencyTimingsFrameReportNV<'a>, pub _marker: PhantomData<&'a ()>, } @@ -51881,6 +51882,7 @@ impl ::std::default::Default for GetLatencyMarkerInfoNV<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), + timing_count: u32::default(), p_timings: ::std::ptr::null_mut(), _marker: PhantomData, } @@ -51891,8 +51893,9 @@ unsafe impl<'a> TaggedStructure for GetLatencyMarkerInfoNV<'a> { } impl<'a> GetLatencyMarkerInfoNV<'a> { #[inline] - pub fn timings(mut self, timings: &'a mut LatencyTimingsFrameReportNV<'a>) -> Self { - self.p_timings = timings; + pub fn timings(mut self, timings: &'a mut [LatencyTimingsFrameReportNV<'a>]) -> Self { + self.timing_count = timings.len() as _; + self.p_timings = timings.as_mut_ptr(); self } } @@ -52327,3 +52330,40 @@ impl<'a> PhysicalDeviceSchedulingControlsPropertiesARM<'a> { self } } +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub relaxed_line_rasterization: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + relaxed_line_rasterization: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'_> {} +impl<'a> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG<'a> { + #[inline] + pub fn relaxed_line_rasterization(mut self, relaxed_line_rasterization: bool) -> Self { + self.relaxed_line_rasterization = relaxed_line_rasterization.into(); + self + } +} diff --git a/ash/src/vk/extensions.rs b/ash/src/vk/extensions.rs index 882d793..d66bbeb 100644 --- a/ash/src/vk/extensions.rs +++ b/ash/src/vk/extensions.rs @@ -5703,6 +5703,18 @@ impl StructureType { pub const SUBPASS_BEGIN_INFO_KHR: Self = Self::SUBPASS_BEGIN_INFO; pub const SUBPASS_END_INFO_KHR: Self = Self::SUBPASS_END_INFO; } +impl ImgRelaxedLineRasterizationFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_IMG_relaxed_line_rasterization\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct ImgRelaxedLineRasterizationFn; +#[doc = "Generated from 'VK_IMG_relaxed_line_rasterization'"] +impl StructureType { + pub const PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: Self = Self(1_000_110_000); +} impl KhrSharedPresentableImageFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_shared_presentable_image\0") @@ -21711,7 +21723,7 @@ impl StructureType { impl NvLowLatency2Fn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_low_latency2\0") }; - pub const SPEC_VERSION: u32 = 1u32; + pub const SPEC_VERSION: u32 = 2u32; } #[allow(non_camel_case_types)] pub type PFN_vkSetLatencySleepModeNV = unsafe extern "system" fn( @@ -21735,7 +21747,6 @@ pub type PFN_vkSetLatencyMarkerNV = unsafe extern "system" fn( pub type PFN_vkGetLatencyTimingsNV = unsafe extern "system" fn( device: Device, swapchain: SwapchainKHR, - p_timing_count: *mut u32, p_latency_marker_info: *mut GetLatencyMarkerInfoNV<'_>, ); #[allow(non_camel_case_types)] @@ -21817,7 +21828,6 @@ impl NvLowLatency2Fn { unsafe extern "system" fn get_latency_timings_nv( _device: Device, _swapchain: SwapchainKHR, - _p_timing_count: *mut u32, _p_latency_marker_info: *mut GetLatencyMarkerInfoNV<'_>, ) { panic!(concat!( diff --git a/generator/Vulkan-Headers b/generator/Vulkan-Headers index 374f9fd..9d27c89 160000 --- a/generator/Vulkan-Headers +++ b/generator/Vulkan-Headers @@ -1 +1 @@ -Subproject commit 374f9fd97520f6dd1b80745de09208d878ab4a52 +Subproject commit 9d27c893cdfc8d96bc8ad5f6f4d88743f958305e