diff --git a/Changelog.md b/Changelog.md index 2878e37..4c49a5a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +### Added + +- Update Vulkan-Headers to 1.3.244 (#697) + ### Changed - Replaced builders with lifetimes/setters directly on Vulkan structs (#602) diff --git a/ash/Cargo.toml b/ash/Cargo.toml index 9f18ba2..cf685cd 100644 --- a/ash/Cargo.toml +++ b/ash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ash" -version = "0.37.0+1.3.238" +version = "0.37.0+1.3.244" authors = [ "Maik Klein ", "Benjamin Saunders ", diff --git a/ash/src/vk/bitflags.rs b/ash/src/vk/bitflags.rs index 66699d7..2f48e7d 100644 --- a/ash/src/vk/bitflags.rs +++ b/ash/src/vk/bitflags.rs @@ -1280,13 +1280,23 @@ impl VideoEncodeCapabilityFlagsKHR { } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] +pub struct VideoEncodeFeedbackFlagsKHR(pub(crate) Flags); +vk_bitflags_wrapped!(VideoEncodeFeedbackFlagsKHR, Flags); +impl VideoEncodeFeedbackFlagsKHR { + pub const BITSTREAM_BUFFER_OFFSET: Self = Self(0b1); + pub const BITSTREAM_BYTES_WRITTEN: Self = Self(0b10); +} +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[doc = ""] pub struct VideoEncodeRateControlModeFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeRateControlModeFlagsKHR, Flags); impl VideoEncodeRateControlModeFlagsKHR { - pub const NONE: Self = Self(0); - pub const CBR: Self = Self(1); - pub const VBR: Self = Self(2); + pub const DEFAULT: Self = Self(0); + pub const DISABLED: Self = Self(0b1); + pub const CBR: Self = Self(0b10); + pub const VBR: Self = Self(0b100); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -1319,26 +1329,7 @@ impl VideoEncodeH264CapabilityFlagsEXT { pub const ROW_UNALIGNED_SLICE: Self = Self(0b100_0000_0000_0000_0000_0000); pub const DIFFERENT_SLICE_TYPE: Self = Self(0b1000_0000_0000_0000_0000_0000); pub const B_FRAME_IN_L1_LIST: Self = Self(0b1_0000_0000_0000_0000_0000_0000); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH264InputModeFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH264InputModeFlagsEXT, Flags); -impl VideoEncodeH264InputModeFlagsEXT { - pub const FRAME: Self = Self(0b1); - pub const SLICE: Self = Self(0b10); - pub const NON_VCL: Self = Self(0b100); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH264OutputModeFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH264OutputModeFlagsEXT, Flags); -impl VideoEncodeH264OutputModeFlagsEXT { - pub const FRAME: Self = Self(0b1); - pub const SLICE: Self = Self(0b10); - pub const NON_VCL: Self = Self(0b100); + pub const DIFFERENT_REFERENCE_FINAL_LISTS: Self = Self(0b10_0000_0000_0000_0000_0000_0000); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -1474,26 +1465,7 @@ impl VideoEncodeH265CapabilityFlagsEXT { pub const DEPENDENT_SLICE_SEGMENT: Self = Self(0b1000_0000_0000_0000_0000_0000); pub const DIFFERENT_SLICE_TYPE: Self = Self(0b1_0000_0000_0000_0000_0000_0000); pub const B_FRAME_IN_L1_LIST: Self = Self(0b10_0000_0000_0000_0000_0000_0000); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH265InputModeFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH265InputModeFlagsEXT, Flags); -impl VideoEncodeH265InputModeFlagsEXT { - pub const FRAME: Self = Self(0b1); - pub const SLICE_SEGMENT: Self = Self(0b10); - pub const NON_VCL: Self = Self(0b100); -} -#[repr(transparent)] -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[doc = ""] -pub struct VideoEncodeH265OutputModeFlagsEXT(pub(crate) Flags); -vk_bitflags_wrapped!(VideoEncodeH265OutputModeFlagsEXT, Flags); -impl VideoEncodeH265OutputModeFlagsEXT { - pub const FRAME: Self = Self(0b1); - pub const SLICE_SEGMENT: Self = Self(0b10); - pub const NON_VCL: Self = Self(0b100); + pub const DIFFERENT_REFERENCE_FINAL_LISTS: Self = Self(0b100_0000_0000_0000_0000_0000_0000); } #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/ash/src/vk/const_debugs.rs b/ash/src/vk/const_debugs.rs index d23cde4..17741e4 100644 --- a/ash/src/vk/const_debugs.rs +++ b/ash/src/vk/const_debugs.rs @@ -1500,6 +1500,7 @@ impl fmt::Debug for DriverId { Self::MESA_VENUS => Some("MESA_VENUS"), Self::MESA_DOZEN => Some("MESA_DOZEN"), Self::MESA_NVK => Some("MESA_NVK"), + Self::IMAGINATION_OPEN_SOURCE_MESA => Some("IMAGINATION_OPEN_SOURCE_MESA"), _ => None, }; if let Some(x) = name { @@ -1523,12 +1524,15 @@ impl fmt::Debug for DynamicState { Self::STENCIL_REFERENCE => Some("STENCIL_REFERENCE"), Self::VIEWPORT_W_SCALING_NV => Some("VIEWPORT_W_SCALING_NV"), Self::DISCARD_RECTANGLE_EXT => Some("DISCARD_RECTANGLE_EXT"), + Self::DISCARD_RECTANGLE_ENABLE_EXT => Some("DISCARD_RECTANGLE_ENABLE_EXT"), + Self::DISCARD_RECTANGLE_MODE_EXT => Some("DISCARD_RECTANGLE_MODE_EXT"), Self::SAMPLE_LOCATIONS_EXT => Some("SAMPLE_LOCATIONS_EXT"), Self::RAY_TRACING_PIPELINE_STACK_SIZE_KHR => { Some("RAY_TRACING_PIPELINE_STACK_SIZE_KHR") } Self::VIEWPORT_SHADING_RATE_PALETTE_NV => Some("VIEWPORT_SHADING_RATE_PALETTE_NV"), Self::VIEWPORT_COARSE_SAMPLE_ORDER_NV => Some("VIEWPORT_COARSE_SAMPLE_ORDER_NV"), + Self::EXCLUSIVE_SCISSOR_ENABLE_NV => Some("EXCLUSIVE_SCISSOR_ENABLE_NV"), Self::EXCLUSIVE_SCISSOR_NV => Some("EXCLUSIVE_SCISSOR_NV"), Self::FRAGMENT_SHADING_RATE_KHR => Some("FRAGMENT_SHADING_RATE_KHR"), Self::LINE_STIPPLE_EXT => Some("LINE_STIPPLE_EXT"), @@ -2897,6 +2901,12 @@ impl fmt::Debug for MemoryPropertyFlags { debug_flags(f, KNOWN, self.0) } } +impl fmt::Debug for MemoryUnmapFlagsKHR { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + const KNOWN: &[(Flags, &str)] = &[]; + debug_flags(f, KNOWN, self.0) + } +} impl fmt::Debug for MetalSurfaceCreateFlagsEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[]; @@ -3707,6 +3717,10 @@ impl fmt::Debug for PipelineStageFlags2 { PipelineStageFlags2::MICROMAP_BUILD_EXT.0, "MICROMAP_BUILD_EXT", ), + ( + PipelineStageFlags2::CLUSTER_CULLING_SHADER_HUAWEI.0, + "CLUSTER_CULLING_SHADER_HUAWEI", + ), (PipelineStageFlags2::OPTICAL_FLOW_NV.0, "OPTICAL_FLOW_NV"), ]; debug_flags(f, KNOWN, self.0) @@ -3911,6 +3925,10 @@ impl fmt::Debug for QueryPipelineStatisticFlags { QueryPipelineStatisticFlags::MESH_SHADER_INVOCATIONS_EXT.0, "MESH_SHADER_INVOCATIONS_EXT", ), + ( + QueryPipelineStatisticFlags::CLUSTER_CULLING_SHADER_INVOCATIONS_HUAWEI.0, + "CLUSTER_CULLING_SHADER_INVOCATIONS_HUAWEI", + ), ]; debug_flags(f, KNOWN, self.0) } @@ -3980,9 +3998,7 @@ impl fmt::Debug for QueryType { Some("ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV") } Self::PERFORMANCE_QUERY_INTEL => Some("PERFORMANCE_QUERY_INTEL"), - Self::VIDEO_ENCODESTREAM_BUFFER_RANGE_KHR => { - Some("VIDEO_ENCODESTREAM_BUFFER_RANGE_KHR") - } + Self::VIDEO_ENCODE_FEEDBACK_KHR => Some("VIDEO_ENCODE_FEEDBACK_KHR"), Self::MESH_PRIMITIVES_GENERATED_EXT => Some("MESH_PRIMITIVES_GENERATED_EXT"), Self::PRIMITIVES_GENERATED_EXT => Some("PRIMITIVES_GENERATED_EXT"), Self::ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR => { @@ -4366,6 +4382,10 @@ impl fmt::Debug for ShaderStageFlags { ShaderStageFlags::SUBPASS_SHADING_HUAWEI.0, "SUBPASS_SHADING_HUAWEI", ), + ( + ShaderStageFlags::CLUSTER_CULLING_HUAWEI.0, + "CLUSTER_CULLING_HUAWEI", + ), ]; debug_flags(f, KNOWN, self.0) } @@ -4641,9 +4661,6 @@ impl fmt::Debug for StructureType { Self::VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT => { Some("VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT") } - Self::VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT => { - Some("VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT") - } Self::VIDEO_ENCODE_H264_PROFILE_INFO_EXT => Some("VIDEO_ENCODE_H264_PROFILE_INFO_EXT"), Self::VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT => { Some("VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT") @@ -4651,9 +4668,6 @@ impl fmt::Debug for StructureType { Self::VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT => { Some("VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT") } - Self::VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT => { - Some("VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT") - } Self::VIDEO_ENCODE_H265_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H265_CAPABILITIES_EXT"), Self::VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT => { Some("VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT") @@ -4670,13 +4684,7 @@ impl fmt::Debug for StructureType { Self::VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT => { Some("VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT") } - Self::VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT => { - Some("VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT") - } Self::VIDEO_ENCODE_H265_PROFILE_INFO_EXT => Some("VIDEO_ENCODE_H265_PROFILE_INFO_EXT"), - Self::VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT => { - Some("VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT") - } Self::VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT => { Some("VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT") } @@ -5270,6 +5278,8 @@ impl fmt::Debug for StructureType { Self::PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR => { Some("PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR") } + Self::MEMORY_MAP_INFO_KHR => Some("MEMORY_MAP_INFO_KHR"), + Self::MEMORY_UNMAP_INFO_KHR => Some("MEMORY_UNMAP_INFO_KHR"), Self::PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT => { Some("PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT") } @@ -5372,12 +5382,16 @@ impl fmt::Debug for StructureType { } Self::VIDEO_ENCODE_CAPABILITIES_KHR => Some("VIDEO_ENCODE_CAPABILITIES_KHR"), Self::VIDEO_ENCODE_USAGE_INFO_KHR => Some("VIDEO_ENCODE_USAGE_INFO_KHR"), + Self::QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR => { + Some("QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR") + } Self::PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV => { Some("PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV") } Self::DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV => { Some("DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV") } + Self::QUERY_LOW_LATENCY_SUPPORT_NV => Some("QUERY_LOW_LATENCY_SUPPORT_NV"), Self::EXPORT_METAL_OBJECT_CREATE_INFO_EXT => { Some("EXPORT_METAL_OBJECT_CREATE_INFO_EXT") } @@ -5647,6 +5661,12 @@ impl fmt::Debug for StructureType { Self::ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT => { Some("ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT") } + Self::PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI => { + Some("PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI") + } + Self::PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI => { + Some("PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI") + } Self::PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT => { Some("PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT") } @@ -5656,6 +5676,13 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT => { Some("PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT") } + Self::PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM => { + Some("PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM") + } + Self::PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT => { + Some("PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT") + } + Self::IMAGE_VIEW_SLICED_CREATE_INFO_EXT => Some("IMAGE_VIEW_SLICED_CREATE_INFO_EXT"), Self::PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE => { Some("PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE") } @@ -5790,6 +5817,15 @@ impl fmt::Debug for StructureType { Self::PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM => { Some("PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM") } + Self::PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT => { + Some("PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT") + } + Self::PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM => { + Some("PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM") + } + Self::MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM => { + Some("MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM") + } Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => { Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES") } @@ -6444,6 +6480,7 @@ impl fmt::Debug for VendorId { Self::CODEPLAY => Some("CODEPLAY"), Self::MESA => Some("MESA"), Self::POCL => Some("POCL"), + Self::MOBILEYE => Some("MOBILEYE"), _ => None, }; if let Some(x) = name { @@ -6622,6 +6659,21 @@ impl fmt::Debug for VideoEncodeContentFlagsKHR { debug_flags(f, KNOWN, self.0) } } +impl fmt::Debug for VideoEncodeFeedbackFlagsKHR { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + const KNOWN: &[(Flags, &str)] = &[ + ( + VideoEncodeFeedbackFlagsKHR::BITSTREAM_BUFFER_OFFSET.0, + "BITSTREAM_BUFFER_OFFSET", + ), + ( + VideoEncodeFeedbackFlagsKHR::BITSTREAM_BYTES_WRITTEN.0, + "BITSTREAM_BYTES_WRITTEN", + ), + ]; + debug_flags(f, KNOWN, self.0) + } +} impl fmt::Debug for VideoEncodeFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[]; @@ -6725,26 +6777,10 @@ impl fmt::Debug for VideoEncodeH264CapabilityFlagsEXT { VideoEncodeH264CapabilityFlagsEXT::B_FRAME_IN_L1_LIST.0, "B_FRAME_IN_L1_LIST", ), - ]; - debug_flags(f, KNOWN, self.0) - } -} -impl fmt::Debug for VideoEncodeH264InputModeFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH264InputModeFlagsEXT::FRAME.0, "FRAME"), - (VideoEncodeH264InputModeFlagsEXT::SLICE.0, "SLICE"), - (VideoEncodeH264InputModeFlagsEXT::NON_VCL.0, "NON_VCL"), - ]; - debug_flags(f, KNOWN, self.0) - } -} -impl fmt::Debug for VideoEncodeH264OutputModeFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH264OutputModeFlagsEXT::FRAME.0, "FRAME"), - (VideoEncodeH264OutputModeFlagsEXT::SLICE.0, "SLICE"), - (VideoEncodeH264OutputModeFlagsEXT::NON_VCL.0, "NON_VCL"), + ( + VideoEncodeH264CapabilityFlagsEXT::DIFFERENT_REFERENCE_FINAL_LISTS.0, + "DIFFERENT_REFERENCE_FINAL_LISTS", + ), ]; debug_flags(f, KNOWN, self.0) } @@ -6871,6 +6907,10 @@ impl fmt::Debug for VideoEncodeH265CapabilityFlagsEXT { VideoEncodeH265CapabilityFlagsEXT::B_FRAME_IN_L1_LIST.0, "B_FRAME_IN_L1_LIST", ), + ( + VideoEncodeH265CapabilityFlagsEXT::DIFFERENT_REFERENCE_FINAL_LISTS.0, + "DIFFERENT_REFERENCE_FINAL_LISTS", + ), ]; debug_flags(f, KNOWN, self.0) } @@ -6885,32 +6925,6 @@ impl fmt::Debug for VideoEncodeH265CtbSizeFlagsEXT { debug_flags(f, KNOWN, self.0) } } -impl fmt::Debug for VideoEncodeH265InputModeFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH265InputModeFlagsEXT::FRAME.0, "FRAME"), - ( - VideoEncodeH265InputModeFlagsEXT::SLICE_SEGMENT.0, - "SLICE_SEGMENT", - ), - (VideoEncodeH265InputModeFlagsEXT::NON_VCL.0, "NON_VCL"), - ]; - debug_flags(f, KNOWN, self.0) - } -} -impl fmt::Debug for VideoEncodeH265OutputModeFlagsEXT { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeH265OutputModeFlagsEXT::FRAME.0, "FRAME"), - ( - VideoEncodeH265OutputModeFlagsEXT::SLICE_SEGMENT.0, - "SLICE_SEGMENT", - ), - (VideoEncodeH265OutputModeFlagsEXT::NON_VCL.0, "NON_VCL"), - ]; - debug_flags(f, KNOWN, self.0) - } -} impl fmt::Debug for VideoEncodeH265RateControlStructureEXT { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let name = match *self { @@ -6958,7 +6972,8 @@ impl fmt::Debug for VideoEncodeRateControlFlagsKHR { impl fmt::Debug for VideoEncodeRateControlModeFlagsKHR { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { const KNOWN: &[(Flags, &str)] = &[ - (VideoEncodeRateControlModeFlagsKHR::NONE.0, "NONE"), + (VideoEncodeRateControlModeFlagsKHR::DEFAULT.0, "DEFAULT"), + (VideoEncodeRateControlModeFlagsKHR::DISABLED.0, "DISABLED"), (VideoEncodeRateControlModeFlagsKHR::CBR.0, "CBR"), (VideoEncodeRateControlModeFlagsKHR::VBR.0, "VBR"), ]; diff --git a/ash/src/vk/constants.rs b/ash/src/vk/constants.rs index 78da55e..384e28a 100644 --- a/ash/src/vk/constants.rs +++ b/ash/src/vk/constants.rs @@ -10,6 +10,7 @@ pub const MAX_MEMORY_HEAPS: usize = 16; pub const LOD_CLAMP_NONE: f32 = 1000.00; pub const REMAINING_MIP_LEVELS: u32 = !0; pub const REMAINING_ARRAY_LAYERS: u32 = !0; +pub const REMAINING_3D_SLICES_EXT: u32 = !0; pub const WHOLE_SIZE: u64 = !0; pub const ATTACHMENT_UNUSED: u32 = !0; pub const TRUE: Bool32 = 1; diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index be18531..6f07920 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 = 238; +pub const HEADER_VERSION: u32 = 244; #[doc = ""] pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 3, HEADER_VERSION); #[doc = ""] @@ -328,6 +328,11 @@ vk_bitflags_wrapped!(VideoEncodeFlagsKHR, Flags); #[doc = ""] pub struct VideoEncodeRateControlFlagsKHR(pub(crate) Flags); vk_bitflags_wrapped!(VideoEncodeRateControlFlagsKHR, Flags); +#[repr(transparent)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[doc = ""] +pub struct MemoryUnmapFlagsKHR(pub(crate) Flags); +vk_bitflags_wrapped!(MemoryUnmapFlagsKHR, Flags); define_handle!( Instance, INSTANCE, @@ -1192,7 +1197,9 @@ pub struct DeviceCreateInfo<'a> { pub flags: DeviceCreateFlags, pub queue_create_info_count: u32, pub p_queue_create_infos: *const DeviceQueueCreateInfo<'a>, + #[deprecated = "functionality described by this member no longer operates"] pub enabled_layer_count: u32, + #[deprecated = "functionality described by this member no longer operates"] pub pp_enabled_layer_names: *const *const c_char, pub enabled_extension_count: u32, pub pp_enabled_extension_names: *const *const c_char, @@ -1202,6 +1209,7 @@ pub struct DeviceCreateInfo<'a> { impl ::std::default::Default for DeviceCreateInfo<'_> { #[inline] fn default() -> Self { + #[allow(deprecated)] Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), @@ -1234,6 +1242,8 @@ impl<'a> DeviceCreateInfo<'a> { self } #[inline] + #[deprecated = "functionality described by this member no longer operates"] + #[allow(deprecated)] pub fn enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self { self.enabled_layer_count = enabled_layer_names.len() as _; self.pp_enabled_layer_names = enabled_layer_names.as_ptr(); @@ -15409,6 +15419,45 @@ impl<'a> ImageViewUsageCreateInfo<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] +#[doc = ""] +pub struct ImageViewSlicedCreateInfoEXT<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub slice_offset: u32, + pub slice_count: u32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for ImageViewSlicedCreateInfoEXT<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + slice_offset: u32::default(), + slice_count: u32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for ImageViewSlicedCreateInfoEXT<'a> { + const STRUCTURE_TYPE: StructureType = StructureType::IMAGE_VIEW_SLICED_CREATE_INFO_EXT; +} +unsafe impl ExtendsImageViewCreateInfo for ImageViewSlicedCreateInfoEXT<'_> {} +impl<'a> ImageViewSlicedCreateInfoEXT<'a> { + #[inline] + pub fn slice_offset(mut self, slice_offset: u32) -> Self { + self.slice_offset = slice_offset; + self + } + #[inline] + pub fn slice_count(mut self, slice_count: u32) -> Self { + self.slice_count = slice_count; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] #[doc = ""] pub struct PipelineTessellationDomainOriginStateCreateInfo<'a> { pub s_type: StructureType, @@ -28253,6 +28302,66 @@ impl<'a> PhysicalDeviceSubpassShadingPropertiesHUAWEI<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub max_work_group_count: [u32; 3], + pub max_work_group_size: [u32; 3], + pub max_output_cluster_count: u32, + pub indirect_buffer_offset_alignment: DeviceSize, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + max_work_group_count: unsafe { ::std::mem::zeroed() }, + max_work_group_size: unsafe { ::std::mem::zeroed() }, + max_output_cluster_count: u32::default(), + indirect_buffer_offset_alignment: DeviceSize::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI; +} +unsafe impl ExtendsPhysicalDeviceProperties2 + for PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'_> +{ +} +impl<'a> PhysicalDeviceClusterCullingShaderPropertiesHUAWEI<'a> { + #[inline] + pub fn max_work_group_count(mut self, max_work_group_count: [u32; 3]) -> Self { + self.max_work_group_count = max_work_group_count; + self + } + #[inline] + pub fn max_work_group_size(mut self, max_work_group_size: [u32; 3]) -> Self { + self.max_work_group_size = max_work_group_size; + self + } + #[inline] + pub fn max_output_cluster_count(mut self, max_output_cluster_count: u32) -> Self { + self.max_output_cluster_count = max_output_cluster_count; + self + } + #[inline] + pub fn indirect_buffer_offset_alignment( + mut self, + indirect_buffer_offset_alignment: DeviceSize, + ) -> Self { + self.indirect_buffer_offset_alignment = indirect_buffer_offset_alignment; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] #[doc = ""] pub struct MemoryOpaqueCaptureAddressAllocateInfo<'a> { pub s_type: StructureType, @@ -33111,6 +33220,53 @@ impl<'a> PhysicalDeviceSubpassShadingFeaturesHUAWEI<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub clusterculling_shader: Bool32, + pub multiview_cluster_culling_shader: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + clusterculling_shader: Bool32::default(), + multiview_cluster_culling_shader: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'_> {} +impl<'a> PhysicalDeviceClusterCullingShaderFeaturesHUAWEI<'a> { + #[inline] + pub fn clusterculling_shader(mut self, clusterculling_shader: bool) -> Self { + self.clusterculling_shader = clusterculling_shader.into(); + self + } + #[inline] + pub fn multiview_cluster_culling_shader( + mut self, + multiview_cluster_culling_shader: bool, + ) -> Self { + self.multiview_cluster_culling_shader = multiview_cluster_culling_shader.into(); + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] #[doc = ""] pub struct BufferCopy2<'a> { pub s_type: StructureType, @@ -34468,6 +34624,40 @@ impl<'a> PhysicalDeviceImage2DViewOf3DFeaturesEXT<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub image_sliced_view_of3_d: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + image_sliced_view_of3_d: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'_> {} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'_> {} +impl<'a> PhysicalDeviceImageSlicedViewOf3DFeaturesEXT<'a> { + #[inline] + pub fn image_sliced_view_of3_d(mut self, image_sliced_view_of3_d: bool) -> Self { + self.image_sliced_view_of3_d = image_sliced_view_of3_d.into(); + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] #[doc = ""] pub struct PhysicalDeviceMutableDescriptorTypeFeaturesEXT<'a> { pub s_type: StructureType, @@ -37401,9 +37591,9 @@ pub struct VideoEncodeInfoKHR<'a> { pub p_next: *const c_void, pub flags: VideoEncodeFlagsKHR, pub quality_level: u32, - pub dst_bitstream_buffer: Buffer, - pub dst_bitstream_buffer_offset: DeviceSize, - pub dst_bitstream_buffer_max_range: DeviceSize, + pub dst_buffer: Buffer, + pub dst_buffer_offset: DeviceSize, + pub dst_buffer_range: DeviceSize, pub src_picture_resource: VideoPictureResourceInfoKHR<'a>, pub p_setup_reference_slot: *const VideoReferenceSlotInfoKHR<'a>, pub reference_slot_count: u32, @@ -37419,9 +37609,9 @@ impl ::std::default::Default for VideoEncodeInfoKHR<'_> { p_next: ::std::ptr::null(), flags: VideoEncodeFlagsKHR::default(), quality_level: u32::default(), - dst_bitstream_buffer: Buffer::default(), - dst_bitstream_buffer_offset: DeviceSize::default(), - dst_bitstream_buffer_max_range: DeviceSize::default(), + dst_buffer: Buffer::default(), + dst_buffer_offset: DeviceSize::default(), + dst_buffer_range: DeviceSize::default(), src_picture_resource: VideoPictureResourceInfoKHR::default(), p_setup_reference_slot: ::std::ptr::null(), reference_slot_count: u32::default(), @@ -37447,21 +37637,18 @@ impl<'a> VideoEncodeInfoKHR<'a> { self } #[inline] - pub fn dst_bitstream_buffer(mut self, dst_bitstream_buffer: Buffer) -> Self { - self.dst_bitstream_buffer = dst_bitstream_buffer; + pub fn dst_buffer(mut self, dst_buffer: Buffer) -> Self { + self.dst_buffer = dst_buffer; self } #[inline] - pub fn dst_bitstream_buffer_offset(mut self, dst_bitstream_buffer_offset: DeviceSize) -> Self { - self.dst_bitstream_buffer_offset = dst_bitstream_buffer_offset; + pub fn dst_buffer_offset(mut self, dst_buffer_offset: DeviceSize) -> Self { + self.dst_buffer_offset = dst_buffer_offset; self } #[inline] - pub fn dst_bitstream_buffer_max_range( - mut self, - dst_bitstream_buffer_max_range: DeviceSize, - ) -> Self { - self.dst_bitstream_buffer_max_range = dst_bitstream_buffer_max_range; + pub fn dst_buffer_range(mut self, dst_buffer_range: DeviceSize) -> Self { + self.dst_buffer_range = dst_buffer_range; self } #[inline] @@ -37512,14 +37699,50 @@ impl<'a> VideoEncodeInfoKHR<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] +#[doc = ""] +pub struct QueryPoolVideoEncodeFeedbackCreateInfoKHR<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub encode_feedback_flags: VideoEncodeFeedbackFlagsKHR, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for QueryPoolVideoEncodeFeedbackCreateInfoKHR<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + encode_feedback_flags: VideoEncodeFeedbackFlagsKHR::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for QueryPoolVideoEncodeFeedbackCreateInfoKHR<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR; +} +unsafe impl ExtendsQueryPoolCreateInfo for QueryPoolVideoEncodeFeedbackCreateInfoKHR<'_> {} +impl<'a> QueryPoolVideoEncodeFeedbackCreateInfoKHR<'a> { + #[inline] + pub fn encode_feedback_flags( + mut self, + encode_feedback_flags: VideoEncodeFeedbackFlagsKHR, + ) -> Self { + self.encode_feedback_flags = encode_feedback_flags; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] #[doc = ""] pub struct VideoEncodeRateControlInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, pub flags: VideoEncodeRateControlFlagsKHR, pub rate_control_mode: VideoEncodeRateControlModeFlagsKHR, - pub layer_count: u8, - pub p_layer_configs: *const VideoEncodeRateControlLayerInfoKHR<'a>, + pub layer_count: u32, + pub p_layers: *const VideoEncodeRateControlLayerInfoKHR<'a>, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeRateControlInfoKHR<'_> { @@ -37530,8 +37753,8 @@ impl ::std::default::Default for VideoEncodeRateControlInfoKHR<'_> { p_next: ::std::ptr::null(), flags: VideoEncodeRateControlFlagsKHR::default(), rate_control_mode: VideoEncodeRateControlModeFlagsKHR::default(), - layer_count: u8::default(), - p_layer_configs: ::std::ptr::null(), + layer_count: u32::default(), + p_layers: ::std::ptr::null(), _marker: PhantomData, } } @@ -37555,12 +37778,9 @@ impl<'a> VideoEncodeRateControlInfoKHR<'a> { self } #[inline] - pub fn layer_configs( - mut self, - layer_configs: &'a [VideoEncodeRateControlLayerInfoKHR], - ) -> Self { - self.layer_count = layer_configs.len() as _; - self.p_layer_configs = layer_configs.as_ptr(); + pub fn layers(mut self, layers: &'a [VideoEncodeRateControlLayerInfoKHR]) -> Self { + self.layer_count = layers.len() as _; + self.p_layers = layers.as_ptr(); self } } @@ -37571,8 +37791,8 @@ impl<'a> VideoEncodeRateControlInfoKHR<'a> { pub struct VideoEncodeRateControlLayerInfoKHR<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub average_bitrate: u32, - pub max_bitrate: u32, + pub average_bitrate: u64, + pub max_bitrate: u64, pub frame_rate_numerator: u32, pub frame_rate_denominator: u32, pub virtual_buffer_size_in_ms: u32, @@ -37585,8 +37805,8 @@ impl ::std::default::Default for VideoEncodeRateControlLayerInfoKHR<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - average_bitrate: u32::default(), - max_bitrate: u32::default(), + average_bitrate: u64::default(), + max_bitrate: u64::default(), frame_rate_numerator: u32::default(), frame_rate_denominator: u32::default(), virtual_buffer_size_in_ms: u32::default(), @@ -37602,12 +37822,12 @@ unsafe impl ExtendsVideoCodingControlInfoKHR for VideoEncodeRateControlLayerInfo pub unsafe trait ExtendsVideoEncodeRateControlLayerInfoKHR {} impl<'a> VideoEncodeRateControlLayerInfoKHR<'a> { #[inline] - pub fn average_bitrate(mut self, average_bitrate: u32) -> Self { + pub fn average_bitrate(mut self, average_bitrate: u64) -> Self { self.average_bitrate = average_bitrate; self } #[inline] - pub fn max_bitrate(mut self, max_bitrate: u32) -> Self { + pub fn max_bitrate(mut self, max_bitrate: u64) -> Self { self.max_bitrate = max_bitrate; self } @@ -37661,9 +37881,10 @@ pub struct VideoEncodeCapabilitiesKHR<'a> { pub p_next: *mut c_void, pub flags: VideoEncodeCapabilityFlagsKHR, pub rate_control_modes: VideoEncodeRateControlModeFlagsKHR, - pub rate_control_layer_count: u8, - pub quality_level_count: u8, + pub max_rate_control_layers: u32, + pub max_quality_levels: u32, pub input_image_data_fill_alignment: Extent2D, + pub supported_encode_feedback_flags: VideoEncodeFeedbackFlagsKHR, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeCapabilitiesKHR<'_> { @@ -37674,9 +37895,10 @@ impl ::std::default::Default for VideoEncodeCapabilitiesKHR<'_> { p_next: ::std::ptr::null_mut(), flags: VideoEncodeCapabilityFlagsKHR::default(), rate_control_modes: VideoEncodeRateControlModeFlagsKHR::default(), - rate_control_layer_count: u8::default(), - quality_level_count: u8::default(), + max_rate_control_layers: u32::default(), + max_quality_levels: u32::default(), input_image_data_fill_alignment: Extent2D::default(), + supported_encode_feedback_flags: VideoEncodeFeedbackFlagsKHR::default(), _marker: PhantomData, } } @@ -37700,13 +37922,13 @@ impl<'a> VideoEncodeCapabilitiesKHR<'a> { self } #[inline] - pub fn rate_control_layer_count(mut self, rate_control_layer_count: u8) -> Self { - self.rate_control_layer_count = rate_control_layer_count; + pub fn max_rate_control_layers(mut self, max_rate_control_layers: u32) -> Self { + self.max_rate_control_layers = max_rate_control_layers; self } #[inline] - pub fn quality_level_count(mut self, quality_level_count: u8) -> Self { - self.quality_level_count = quality_level_count; + pub fn max_quality_levels(mut self, max_quality_levels: u32) -> Self { + self.max_quality_levels = max_quality_levels; self } #[inline] @@ -37717,6 +37939,14 @@ impl<'a> VideoEncodeCapabilitiesKHR<'a> { self.input_image_data_fill_alignment = input_image_data_fill_alignment; self } + #[inline] + pub fn supported_encode_feedback_flags( + mut self, + supported_encode_feedback_flags: VideoEncodeFeedbackFlagsKHR, + ) -> Self { + self.supported_encode_feedback_flags = supported_encode_feedback_flags; + self + } } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] @@ -37726,11 +37956,9 @@ pub struct VideoEncodeH264CapabilitiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, pub flags: VideoEncodeH264CapabilityFlagsEXT, - pub input_mode_flags: VideoEncodeH264InputModeFlagsEXT, - pub output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, - pub max_p_picture_l0_reference_count: u8, - pub max_b_picture_l0_reference_count: u8, - pub max_l1_reference_count: u8, + pub max_p_picture_l0_reference_count: u32, + pub max_b_picture_l0_reference_count: u32, + pub max_l1_reference_count: u32, pub motion_vectors_over_pic_boundaries_flag: Bool32, pub max_bytes_per_pic_denom: u32, pub max_bits_per_mb_denom: u32, @@ -37745,11 +37973,9 @@ impl ::std::default::Default for VideoEncodeH264CapabilitiesEXT<'_> { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null_mut(), flags: VideoEncodeH264CapabilityFlagsEXT::default(), - input_mode_flags: VideoEncodeH264InputModeFlagsEXT::default(), - output_mode_flags: VideoEncodeH264OutputModeFlagsEXT::default(), - max_p_picture_l0_reference_count: u8::default(), - max_b_picture_l0_reference_count: u8::default(), - max_l1_reference_count: u8::default(), + max_p_picture_l0_reference_count: u32::default(), + max_b_picture_l0_reference_count: u32::default(), + max_l1_reference_count: u32::default(), motion_vectors_over_pic_boundaries_flag: Bool32::default(), max_bytes_per_pic_denom: u32::default(), max_bits_per_mb_denom: u32::default(), @@ -37770,22 +37996,9 @@ impl<'a> VideoEncodeH264CapabilitiesEXT<'a> { self } #[inline] - pub fn input_mode_flags(mut self, input_mode_flags: VideoEncodeH264InputModeFlagsEXT) -> Self { - self.input_mode_flags = input_mode_flags; - self - } - #[inline] - pub fn output_mode_flags( - mut self, - output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, - ) -> Self { - self.output_mode_flags = output_mode_flags; - self - } - #[inline] pub fn max_p_picture_l0_reference_count( mut self, - max_p_picture_l0_reference_count: u8, + max_p_picture_l0_reference_count: u32, ) -> Self { self.max_p_picture_l0_reference_count = max_p_picture_l0_reference_count; self @@ -37793,13 +38006,13 @@ impl<'a> VideoEncodeH264CapabilitiesEXT<'a> { #[inline] pub fn max_b_picture_l0_reference_count( mut self, - max_b_picture_l0_reference_count: u8, + max_b_picture_l0_reference_count: u32, ) -> Self { self.max_b_picture_l0_reference_count = max_b_picture_l0_reference_count; self } #[inline] - pub fn max_l1_reference_count(mut self, max_l1_reference_count: u8) -> Self { + pub fn max_l1_reference_count(mut self, max_l1_reference_count: u32) -> Self { self.max_l1_reference_count = max_l1_reference_count; self } @@ -37942,7 +38155,6 @@ impl<'a> VideoEncodeH264SessionParametersCreateInfoEXT<'a> { pub struct VideoEncodeH264DpbSlotInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub slot_index: i8, pub p_std_reference_info: *const StdVideoEncodeH264ReferenceInfo, pub _marker: PhantomData<&'a ()>, } @@ -37952,7 +38164,6 @@ impl ::std::default::Default for VideoEncodeH264DpbSlotInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - slot_index: i8::default(), p_std_reference_info: ::std::ptr::null(), _marker: PhantomData, } @@ -37961,12 +38172,8 @@ impl ::std::default::Default for VideoEncodeH264DpbSlotInfoEXT<'_> { unsafe impl<'a> TaggedStructure for VideoEncodeH264DpbSlotInfoEXT<'a> { const STRUCTURE_TYPE: StructureType = StructureType::VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT; } +unsafe impl ExtendsVideoReferenceSlotInfoKHR for VideoEncodeH264DpbSlotInfoEXT<'_> {} impl<'a> VideoEncodeH264DpbSlotInfoEXT<'a> { - #[inline] - pub fn slot_index(mut self, slot_index: i8) -> Self { - self.slot_index = slot_index; - self - } #[inline] pub fn std_reference_info( mut self, @@ -37983,10 +38190,10 @@ impl<'a> VideoEncodeH264DpbSlotInfoEXT<'a> { pub struct VideoEncodeH264VclFrameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub p_reference_final_lists: *const VideoEncodeH264ReferenceListsInfoEXT<'a>, + pub p_std_reference_final_lists: *const StdVideoEncodeH264ReferenceListsInfo, pub nalu_slice_entry_count: u32, pub p_nalu_slice_entries: *const VideoEncodeH264NaluSliceInfoEXT<'a>, - pub p_current_picture_info: *const StdVideoEncodeH264PictureInfo, + pub p_std_picture_info: *const StdVideoEncodeH264PictureInfo, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH264VclFrameInfoEXT<'_> { @@ -37995,10 +38202,10 @@ impl ::std::default::Default for VideoEncodeH264VclFrameInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - p_reference_final_lists: ::std::ptr::null(), + p_std_reference_final_lists: ::std::ptr::null(), nalu_slice_entry_count: u32::default(), p_nalu_slice_entries: ::std::ptr::null(), - p_current_picture_info: ::std::ptr::null(), + p_std_picture_info: ::std::ptr::null(), _marker: PhantomData, } } @@ -38009,11 +38216,11 @@ unsafe impl<'a> TaggedStructure for VideoEncodeH264VclFrameInfoEXT<'a> { unsafe impl ExtendsVideoEncodeInfoKHR for VideoEncodeH264VclFrameInfoEXT<'_> {} impl<'a> VideoEncodeH264VclFrameInfoEXT<'a> { #[inline] - pub fn reference_final_lists( + pub fn std_reference_final_lists( mut self, - reference_final_lists: &'a VideoEncodeH264ReferenceListsInfoEXT<'a>, + std_reference_final_lists: &'a StdVideoEncodeH264ReferenceListsInfo, ) -> Self { - self.p_reference_final_lists = reference_final_lists; + self.p_std_reference_final_lists = std_reference_final_lists; self } #[inline] @@ -38026,121 +38233,8 @@ impl<'a> VideoEncodeH264VclFrameInfoEXT<'a> { self } #[inline] - pub fn current_picture_info( - mut self, - current_picture_info: &'a StdVideoEncodeH264PictureInfo, - ) -> Self { - self.p_current_picture_info = current_picture_info; - self - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH264ReferenceListsInfoEXT<'a> { - pub s_type: StructureType, - pub p_next: *const c_void, - pub reference_list0_entry_count: u8, - pub p_reference_list0_entries: *const VideoEncodeH264DpbSlotInfoEXT<'a>, - pub reference_list1_entry_count: u8, - pub p_reference_list1_entries: *const VideoEncodeH264DpbSlotInfoEXT<'a>, - pub p_mem_mgmt_ctrl_operations: *const StdVideoEncodeH264RefMemMgmtCtrlOperations, - pub _marker: PhantomData<&'a ()>, -} -impl ::std::default::Default for VideoEncodeH264ReferenceListsInfoEXT<'_> { - #[inline] - fn default() -> Self { - Self { - s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null(), - reference_list0_entry_count: u8::default(), - p_reference_list0_entries: ::std::ptr::null(), - reference_list1_entry_count: u8::default(), - p_reference_list1_entries: ::std::ptr::null(), - p_mem_mgmt_ctrl_operations: ::std::ptr::null(), - _marker: PhantomData, - } - } -} -unsafe impl<'a> TaggedStructure for VideoEncodeH264ReferenceListsInfoEXT<'a> { - const STRUCTURE_TYPE: StructureType = StructureType::VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT; -} -impl<'a> VideoEncodeH264ReferenceListsInfoEXT<'a> { - #[inline] - pub fn reference_list0_entries( - mut self, - reference_list0_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], - ) -> Self { - self.reference_list0_entry_count = reference_list0_entries.len() as _; - self.p_reference_list0_entries = reference_list0_entries.as_ptr(); - self - } - #[inline] - pub fn reference_list1_entries( - mut self, - reference_list1_entries: &'a [VideoEncodeH264DpbSlotInfoEXT], - ) -> Self { - self.reference_list1_entry_count = reference_list1_entries.len() as _; - self.p_reference_list1_entries = reference_list1_entries.as_ptr(); - self - } - #[inline] - pub fn mem_mgmt_ctrl_operations( - mut self, - mem_mgmt_ctrl_operations: &'a StdVideoEncodeH264RefMemMgmtCtrlOperations, - ) -> Self { - self.p_mem_mgmt_ctrl_operations = mem_mgmt_ctrl_operations; - self - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH264EmitPictureParametersInfoEXT<'a> { - pub s_type: StructureType, - pub p_next: *const c_void, - pub sps_id: u8, - pub emit_sps_enable: Bool32, - pub pps_id_entry_count: u32, - pub pps_id_entries: *const u8, - pub _marker: PhantomData<&'a ()>, -} -impl ::std::default::Default for VideoEncodeH264EmitPictureParametersInfoEXT<'_> { - #[inline] - fn default() -> Self { - Self { - s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null(), - sps_id: u8::default(), - emit_sps_enable: Bool32::default(), - pps_id_entry_count: u32::default(), - pps_id_entries: ::std::ptr::null(), - _marker: PhantomData, - } - } -} -unsafe impl<'a> TaggedStructure for VideoEncodeH264EmitPictureParametersInfoEXT<'a> { - const STRUCTURE_TYPE: StructureType = - StructureType::VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT; -} -unsafe impl ExtendsVideoEncodeInfoKHR for VideoEncodeH264EmitPictureParametersInfoEXT<'_> {} -impl<'a> VideoEncodeH264EmitPictureParametersInfoEXT<'a> { - #[inline] - pub fn sps_id(mut self, sps_id: u8) -> Self { - self.sps_id = sps_id; - self - } - #[inline] - pub fn emit_sps_enable(mut self, emit_sps_enable: bool) -> Self { - self.emit_sps_enable = emit_sps_enable.into(); - self - } - #[inline] - pub fn pps_id_entries(mut self, pps_id_entries: &'a [u8]) -> Self { - self.pps_id_entry_count = pps_id_entries.len() as _; - self.pps_id_entries = pps_id_entries.as_ptr(); + pub fn std_picture_info(mut self, std_picture_info: &'a StdVideoEncodeH264PictureInfo) -> Self { + self.p_std_picture_info = std_picture_info; self } } @@ -38185,8 +38279,8 @@ pub struct VideoEncodeH264NaluSliceInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, pub mb_count: u32, - pub p_reference_final_lists: *const VideoEncodeH264ReferenceListsInfoEXT<'a>, - pub p_slice_header_std: *const StdVideoEncodeH264SliceHeader, + pub p_std_reference_final_lists: *const StdVideoEncodeH264ReferenceListsInfo, + pub p_std_slice_header: *const StdVideoEncodeH264SliceHeader, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH264NaluSliceInfoEXT<'_> { @@ -38196,8 +38290,8 @@ impl ::std::default::Default for VideoEncodeH264NaluSliceInfoEXT<'_> { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), mb_count: u32::default(), - p_reference_final_lists: ::std::ptr::null(), - p_slice_header_std: ::std::ptr::null(), + p_std_reference_final_lists: ::std::ptr::null(), + p_std_slice_header: ::std::ptr::null(), _marker: PhantomData, } } @@ -38212,16 +38306,16 @@ impl<'a> VideoEncodeH264NaluSliceInfoEXT<'a> { self } #[inline] - pub fn reference_final_lists( + pub fn std_reference_final_lists( mut self, - reference_final_lists: &'a VideoEncodeH264ReferenceListsInfoEXT<'a>, + std_reference_final_lists: &'a StdVideoEncodeH264ReferenceListsInfo, ) -> Self { - self.p_reference_final_lists = reference_final_lists; + self.p_std_reference_final_lists = std_reference_final_lists; self } #[inline] - pub fn slice_header_std(mut self, slice_header_std: &'a StdVideoEncodeH264SliceHeader) -> Self { - self.p_slice_header_std = slice_header_std; + pub fn std_slice_header(mut self, std_slice_header: &'a StdVideoEncodeH264SliceHeader) -> Self { + self.p_std_slice_header = std_slice_header; self } } @@ -38236,7 +38330,7 @@ pub struct VideoEncodeH264RateControlInfoEXT<'a> { pub idr_period: u32, pub consecutive_b_frame_count: u32, pub rate_control_structure: VideoEncodeH264RateControlStructureEXT, - pub temporal_layer_count: u8, + pub temporal_layer_count: u32, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH264RateControlInfoEXT<'_> { @@ -38249,7 +38343,7 @@ impl ::std::default::Default for VideoEncodeH264RateControlInfoEXT<'_> { idr_period: u32::default(), consecutive_b_frame_count: u32::default(), rate_control_structure: VideoEncodeH264RateControlStructureEXT::default(), - temporal_layer_count: u8::default(), + temporal_layer_count: u32::default(), _marker: PhantomData, } } @@ -38283,7 +38377,7 @@ impl<'a> VideoEncodeH264RateControlInfoEXT<'a> { self } #[inline] - pub fn temporal_layer_count(mut self, temporal_layer_count: u8) -> Self { + pub fn temporal_layer_count(mut self, temporal_layer_count: u32) -> Self { self.temporal_layer_count = temporal_layer_count; self } @@ -38347,7 +38441,7 @@ impl VideoEncodeH264FrameSizeEXT { pub struct VideoEncodeH264RateControlLayerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub temporal_layer_id: u8, + pub temporal_layer_id: u32, pub use_initial_rc_qp: Bool32, pub initial_rc_qp: VideoEncodeH264QpEXT, pub use_min_qp: Bool32, @@ -38364,7 +38458,7 @@ impl ::std::default::Default for VideoEncodeH264RateControlLayerInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - temporal_layer_id: u8::default(), + temporal_layer_id: u32::default(), use_initial_rc_qp: Bool32::default(), initial_rc_qp: VideoEncodeH264QpEXT::default(), use_min_qp: Bool32::default(), @@ -38388,7 +38482,7 @@ unsafe impl ExtendsVideoEncodeRateControlLayerInfoKHR } impl<'a> VideoEncodeH264RateControlLayerInfoEXT<'a> { #[inline] - pub fn temporal_layer_id(mut self, temporal_layer_id: u8) -> Self { + pub fn temporal_layer_id(mut self, temporal_layer_id: u32) -> Self { self.temporal_layer_id = temporal_layer_id; self } @@ -38441,25 +38535,23 @@ pub struct VideoEncodeH265CapabilitiesEXT<'a> { pub s_type: StructureType, pub p_next: *mut c_void, pub flags: VideoEncodeH265CapabilityFlagsEXT, - pub input_mode_flags: VideoEncodeH265InputModeFlagsEXT, - pub output_mode_flags: VideoEncodeH265OutputModeFlagsEXT, pub ctb_sizes: VideoEncodeH265CtbSizeFlagsEXT, pub transform_block_sizes: VideoEncodeH265TransformBlockSizeFlagsEXT, - pub max_p_picture_l0_reference_count: u8, - pub max_b_picture_l0_reference_count: u8, - pub max_l1_reference_count: u8, - pub max_sub_layers_count: u8, - pub min_log2_min_luma_coding_block_size_minus3: u8, - pub max_log2_min_luma_coding_block_size_minus3: u8, - pub min_log2_min_luma_transform_block_size_minus2: u8, - pub max_log2_min_luma_transform_block_size_minus2: u8, - pub min_max_transform_hierarchy_depth_inter: u8, - pub max_max_transform_hierarchy_depth_inter: u8, - pub min_max_transform_hierarchy_depth_intra: u8, - pub max_max_transform_hierarchy_depth_intra: u8, - pub max_diff_cu_qp_delta_depth: u8, - pub min_max_num_merge_cand: u8, - pub max_max_num_merge_cand: u8, + pub max_p_picture_l0_reference_count: u32, + pub max_b_picture_l0_reference_count: u32, + pub max_l1_reference_count: u32, + pub max_sub_layers_count: u32, + pub min_log2_min_luma_coding_block_size_minus3: u32, + pub max_log2_min_luma_coding_block_size_minus3: u32, + pub min_log2_min_luma_transform_block_size_minus2: u32, + pub max_log2_min_luma_transform_block_size_minus2: u32, + pub min_max_transform_hierarchy_depth_inter: u32, + pub max_max_transform_hierarchy_depth_inter: u32, + pub min_max_transform_hierarchy_depth_intra: u32, + pub max_max_transform_hierarchy_depth_intra: u32, + pub max_diff_cu_qp_delta_depth: u32, + pub min_max_num_merge_cand: u32, + pub max_max_num_merge_cand: u32, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH265CapabilitiesEXT<'_> { @@ -38469,25 +38561,23 @@ impl ::std::default::Default for VideoEncodeH265CapabilitiesEXT<'_> { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null_mut(), flags: VideoEncodeH265CapabilityFlagsEXT::default(), - input_mode_flags: VideoEncodeH265InputModeFlagsEXT::default(), - output_mode_flags: VideoEncodeH265OutputModeFlagsEXT::default(), ctb_sizes: VideoEncodeH265CtbSizeFlagsEXT::default(), transform_block_sizes: VideoEncodeH265TransformBlockSizeFlagsEXT::default(), - max_p_picture_l0_reference_count: u8::default(), - max_b_picture_l0_reference_count: u8::default(), - max_l1_reference_count: u8::default(), - max_sub_layers_count: u8::default(), - min_log2_min_luma_coding_block_size_minus3: u8::default(), - max_log2_min_luma_coding_block_size_minus3: u8::default(), - min_log2_min_luma_transform_block_size_minus2: u8::default(), - max_log2_min_luma_transform_block_size_minus2: u8::default(), - min_max_transform_hierarchy_depth_inter: u8::default(), - max_max_transform_hierarchy_depth_inter: u8::default(), - min_max_transform_hierarchy_depth_intra: u8::default(), - max_max_transform_hierarchy_depth_intra: u8::default(), - max_diff_cu_qp_delta_depth: u8::default(), - min_max_num_merge_cand: u8::default(), - max_max_num_merge_cand: u8::default(), + max_p_picture_l0_reference_count: u32::default(), + max_b_picture_l0_reference_count: u32::default(), + max_l1_reference_count: u32::default(), + max_sub_layers_count: u32::default(), + min_log2_min_luma_coding_block_size_minus3: u32::default(), + max_log2_min_luma_coding_block_size_minus3: u32::default(), + min_log2_min_luma_transform_block_size_minus2: u32::default(), + max_log2_min_luma_transform_block_size_minus2: u32::default(), + min_max_transform_hierarchy_depth_inter: u32::default(), + max_max_transform_hierarchy_depth_inter: u32::default(), + min_max_transform_hierarchy_depth_intra: u32::default(), + max_max_transform_hierarchy_depth_intra: u32::default(), + max_diff_cu_qp_delta_depth: u32::default(), + min_max_num_merge_cand: u32::default(), + max_max_num_merge_cand: u32::default(), _marker: PhantomData, } } @@ -38503,19 +38593,6 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { self } #[inline] - pub fn input_mode_flags(mut self, input_mode_flags: VideoEncodeH265InputModeFlagsEXT) -> Self { - self.input_mode_flags = input_mode_flags; - self - } - #[inline] - pub fn output_mode_flags( - mut self, - output_mode_flags: VideoEncodeH265OutputModeFlagsEXT, - ) -> Self { - self.output_mode_flags = output_mode_flags; - self - } - #[inline] pub fn ctb_sizes(mut self, ctb_sizes: VideoEncodeH265CtbSizeFlagsEXT) -> Self { self.ctb_sizes = ctb_sizes; self @@ -38531,7 +38608,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_p_picture_l0_reference_count( mut self, - max_p_picture_l0_reference_count: u8, + max_p_picture_l0_reference_count: u32, ) -> Self { self.max_p_picture_l0_reference_count = max_p_picture_l0_reference_count; self @@ -38539,25 +38616,25 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_b_picture_l0_reference_count( mut self, - max_b_picture_l0_reference_count: u8, + max_b_picture_l0_reference_count: u32, ) -> Self { self.max_b_picture_l0_reference_count = max_b_picture_l0_reference_count; self } #[inline] - pub fn max_l1_reference_count(mut self, max_l1_reference_count: u8) -> Self { + pub fn max_l1_reference_count(mut self, max_l1_reference_count: u32) -> Self { self.max_l1_reference_count = max_l1_reference_count; self } #[inline] - pub fn max_sub_layers_count(mut self, max_sub_layers_count: u8) -> Self { + pub fn max_sub_layers_count(mut self, max_sub_layers_count: u32) -> Self { self.max_sub_layers_count = max_sub_layers_count; self } #[inline] pub fn min_log2_min_luma_coding_block_size_minus3( mut self, - min_log2_min_luma_coding_block_size_minus3: u8, + min_log2_min_luma_coding_block_size_minus3: u32, ) -> Self { self.min_log2_min_luma_coding_block_size_minus3 = min_log2_min_luma_coding_block_size_minus3; @@ -38566,7 +38643,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_log2_min_luma_coding_block_size_minus3( mut self, - max_log2_min_luma_coding_block_size_minus3: u8, + max_log2_min_luma_coding_block_size_minus3: u32, ) -> Self { self.max_log2_min_luma_coding_block_size_minus3 = max_log2_min_luma_coding_block_size_minus3; @@ -38575,7 +38652,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn min_log2_min_luma_transform_block_size_minus2( mut self, - min_log2_min_luma_transform_block_size_minus2: u8, + min_log2_min_luma_transform_block_size_minus2: u32, ) -> Self { self.min_log2_min_luma_transform_block_size_minus2 = min_log2_min_luma_transform_block_size_minus2; @@ -38584,7 +38661,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_log2_min_luma_transform_block_size_minus2( mut self, - max_log2_min_luma_transform_block_size_minus2: u8, + max_log2_min_luma_transform_block_size_minus2: u32, ) -> Self { self.max_log2_min_luma_transform_block_size_minus2 = max_log2_min_luma_transform_block_size_minus2; @@ -38593,7 +38670,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn min_max_transform_hierarchy_depth_inter( mut self, - min_max_transform_hierarchy_depth_inter: u8, + min_max_transform_hierarchy_depth_inter: u32, ) -> Self { self.min_max_transform_hierarchy_depth_inter = min_max_transform_hierarchy_depth_inter; self @@ -38601,7 +38678,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_max_transform_hierarchy_depth_inter( mut self, - max_max_transform_hierarchy_depth_inter: u8, + max_max_transform_hierarchy_depth_inter: u32, ) -> Self { self.max_max_transform_hierarchy_depth_inter = max_max_transform_hierarchy_depth_inter; self @@ -38609,7 +38686,7 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn min_max_transform_hierarchy_depth_intra( mut self, - min_max_transform_hierarchy_depth_intra: u8, + min_max_transform_hierarchy_depth_intra: u32, ) -> Self { self.min_max_transform_hierarchy_depth_intra = min_max_transform_hierarchy_depth_intra; self @@ -38617,23 +38694,23 @@ impl<'a> VideoEncodeH265CapabilitiesEXT<'a> { #[inline] pub fn max_max_transform_hierarchy_depth_intra( mut self, - max_max_transform_hierarchy_depth_intra: u8, + max_max_transform_hierarchy_depth_intra: u32, ) -> Self { self.max_max_transform_hierarchy_depth_intra = max_max_transform_hierarchy_depth_intra; self } #[inline] - pub fn max_diff_cu_qp_delta_depth(mut self, max_diff_cu_qp_delta_depth: u8) -> Self { + pub fn max_diff_cu_qp_delta_depth(mut self, max_diff_cu_qp_delta_depth: u32) -> Self { self.max_diff_cu_qp_delta_depth = max_diff_cu_qp_delta_depth; self } #[inline] - pub fn min_max_num_merge_cand(mut self, min_max_num_merge_cand: u8) -> Self { + pub fn min_max_num_merge_cand(mut self, min_max_num_merge_cand: u32) -> Self { self.min_max_num_merge_cand = min_max_num_merge_cand; self } #[inline] - pub fn max_max_num_merge_cand(mut self, max_max_num_merge_cand: u8) -> Self { + pub fn max_max_num_merge_cand(mut self, max_max_num_merge_cand: u32) -> Self { self.max_max_num_merge_cand = max_max_num_merge_cand; self } @@ -38764,10 +38841,10 @@ impl<'a> VideoEncodeH265SessionParametersCreateInfoEXT<'a> { pub struct VideoEncodeH265VclFrameInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub p_reference_final_lists: *const VideoEncodeH265ReferenceListsInfoEXT<'a>, + pub p_std_reference_final_lists: *const StdVideoEncodeH265ReferenceListsInfo, pub nalu_slice_segment_entry_count: u32, pub p_nalu_slice_segment_entries: *const VideoEncodeH265NaluSliceSegmentInfoEXT<'a>, - pub p_current_picture_info: *const StdVideoEncodeH265PictureInfo, + pub p_std_picture_info: *const StdVideoEncodeH265PictureInfo, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH265VclFrameInfoEXT<'_> { @@ -38776,10 +38853,10 @@ impl ::std::default::Default for VideoEncodeH265VclFrameInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - p_reference_final_lists: ::std::ptr::null(), + p_std_reference_final_lists: ::std::ptr::null(), nalu_slice_segment_entry_count: u32::default(), p_nalu_slice_segment_entries: ::std::ptr::null(), - p_current_picture_info: ::std::ptr::null(), + p_std_picture_info: ::std::ptr::null(), _marker: PhantomData, } } @@ -38790,11 +38867,11 @@ unsafe impl<'a> TaggedStructure for VideoEncodeH265VclFrameInfoEXT<'a> { unsafe impl ExtendsVideoEncodeInfoKHR for VideoEncodeH265VclFrameInfoEXT<'_> {} impl<'a> VideoEncodeH265VclFrameInfoEXT<'a> { #[inline] - pub fn reference_final_lists( + pub fn std_reference_final_lists( mut self, - reference_final_lists: &'a VideoEncodeH265ReferenceListsInfoEXT<'a>, + std_reference_final_lists: &'a StdVideoEncodeH265ReferenceListsInfo, ) -> Self { - self.p_reference_final_lists = reference_final_lists; + self.p_std_reference_final_lists = std_reference_final_lists; self } #[inline] @@ -38807,75 +38884,8 @@ impl<'a> VideoEncodeH265VclFrameInfoEXT<'a> { self } #[inline] - pub fn current_picture_info( - mut self, - current_picture_info: &'a StdVideoEncodeH265PictureInfo, - ) -> Self { - self.p_current_picture_info = current_picture_info; - self - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH265EmitPictureParametersInfoEXT<'a> { - pub s_type: StructureType, - pub p_next: *const c_void, - pub vps_id: u8, - pub sps_id: u8, - pub emit_vps_enable: Bool32, - pub emit_sps_enable: Bool32, - pub pps_id_entry_count: u32, - pub pps_id_entries: *const u8, - pub _marker: PhantomData<&'a ()>, -} -impl ::std::default::Default for VideoEncodeH265EmitPictureParametersInfoEXT<'_> { - #[inline] - fn default() -> Self { - Self { - s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null(), - vps_id: u8::default(), - sps_id: u8::default(), - emit_vps_enable: Bool32::default(), - emit_sps_enable: Bool32::default(), - pps_id_entry_count: u32::default(), - pps_id_entries: ::std::ptr::null(), - _marker: PhantomData, - } - } -} -unsafe impl<'a> TaggedStructure for VideoEncodeH265EmitPictureParametersInfoEXT<'a> { - const STRUCTURE_TYPE: StructureType = - StructureType::VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT; -} -unsafe impl ExtendsVideoEncodeInfoKHR for VideoEncodeH265EmitPictureParametersInfoEXT<'_> {} -impl<'a> VideoEncodeH265EmitPictureParametersInfoEXT<'a> { - #[inline] - pub fn vps_id(mut self, vps_id: u8) -> Self { - self.vps_id = vps_id; - self - } - #[inline] - pub fn sps_id(mut self, sps_id: u8) -> Self { - self.sps_id = sps_id; - self - } - #[inline] - pub fn emit_vps_enable(mut self, emit_vps_enable: bool) -> Self { - self.emit_vps_enable = emit_vps_enable.into(); - self - } - #[inline] - pub fn emit_sps_enable(mut self, emit_sps_enable: bool) -> Self { - self.emit_sps_enable = emit_sps_enable.into(); - self - } - #[inline] - pub fn pps_id_entries(mut self, pps_id_entries: &'a [u8]) -> Self { - self.pps_id_entry_count = pps_id_entries.len() as _; - self.pps_id_entries = pps_id_entries.as_ptr(); + pub fn std_picture_info(mut self, std_picture_info: &'a StdVideoEncodeH265PictureInfo) -> Self { + self.p_std_picture_info = std_picture_info; self } } @@ -38887,8 +38897,8 @@ pub struct VideoEncodeH265NaluSliceSegmentInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, pub ctb_count: u32, - pub p_reference_final_lists: *const VideoEncodeH265ReferenceListsInfoEXT<'a>, - pub p_slice_segment_header_std: *const StdVideoEncodeH265SliceSegmentHeader, + pub p_std_reference_final_lists: *const StdVideoEncodeH265ReferenceListsInfo, + pub p_std_slice_segment_header: *const StdVideoEncodeH265SliceSegmentHeader, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH265NaluSliceSegmentInfoEXT<'_> { @@ -38898,8 +38908,8 @@ impl ::std::default::Default for VideoEncodeH265NaluSliceSegmentInfoEXT<'_> { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), ctb_count: u32::default(), - p_reference_final_lists: ::std::ptr::null(), - p_slice_segment_header_std: ::std::ptr::null(), + p_std_reference_final_lists: ::std::ptr::null(), + p_std_slice_segment_header: ::std::ptr::null(), _marker: PhantomData, } } @@ -38915,19 +38925,19 @@ impl<'a> VideoEncodeH265NaluSliceSegmentInfoEXT<'a> { self } #[inline] - pub fn reference_final_lists( + pub fn std_reference_final_lists( mut self, - reference_final_lists: &'a VideoEncodeH265ReferenceListsInfoEXT<'a>, + std_reference_final_lists: &'a StdVideoEncodeH265ReferenceListsInfo, ) -> Self { - self.p_reference_final_lists = reference_final_lists; + self.p_std_reference_final_lists = std_reference_final_lists; self } #[inline] - pub fn slice_segment_header_std( + pub fn std_slice_segment_header( mut self, - slice_segment_header_std: &'a StdVideoEncodeH265SliceSegmentHeader, + std_slice_segment_header: &'a StdVideoEncodeH265SliceSegmentHeader, ) -> Self { - self.p_slice_segment_header_std = slice_segment_header_std; + self.p_std_slice_segment_header = std_slice_segment_header; self } } @@ -38942,7 +38952,7 @@ pub struct VideoEncodeH265RateControlInfoEXT<'a> { pub idr_period: u32, pub consecutive_b_frame_count: u32, pub rate_control_structure: VideoEncodeH265RateControlStructureEXT, - pub sub_layer_count: u8, + pub sub_layer_count: u32, pub _marker: PhantomData<&'a ()>, } impl ::std::default::Default for VideoEncodeH265RateControlInfoEXT<'_> { @@ -38955,7 +38965,7 @@ impl ::std::default::Default for VideoEncodeH265RateControlInfoEXT<'_> { idr_period: u32::default(), consecutive_b_frame_count: u32::default(), rate_control_structure: VideoEncodeH265RateControlStructureEXT::default(), - sub_layer_count: u8::default(), + sub_layer_count: u32::default(), _marker: PhantomData, } } @@ -38989,7 +38999,7 @@ impl<'a> VideoEncodeH265RateControlInfoEXT<'a> { self } #[inline] - pub fn sub_layer_count(mut self, sub_layer_count: u8) -> Self { + pub fn sub_layer_count(mut self, sub_layer_count: u32) -> Self { self.sub_layer_count = sub_layer_count; self } @@ -39053,7 +39063,7 @@ impl VideoEncodeH265FrameSizeEXT { pub struct VideoEncodeH265RateControlLayerInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub temporal_id: u8, + pub temporal_id: u32, pub use_initial_rc_qp: Bool32, pub initial_rc_qp: VideoEncodeH265QpEXT, pub use_min_qp: Bool32, @@ -39070,7 +39080,7 @@ impl ::std::default::Default for VideoEncodeH265RateControlLayerInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - temporal_id: u8::default(), + temporal_id: u32::default(), use_initial_rc_qp: Bool32::default(), initial_rc_qp: VideoEncodeH265QpEXT::default(), use_min_qp: Bool32::default(), @@ -39094,7 +39104,7 @@ unsafe impl ExtendsVideoEncodeRateControlLayerInfoKHR } impl<'a> VideoEncodeH265RateControlLayerInfoEXT<'a> { #[inline] - pub fn temporal_id(mut self, temporal_id: u8) -> Self { + pub fn temporal_id(mut self, temporal_id: u32) -> Self { self.temporal_id = temporal_id; self } @@ -39179,7 +39189,6 @@ impl<'a> VideoEncodeH265ProfileInfoEXT<'a> { pub struct VideoEncodeH265DpbSlotInfoEXT<'a> { pub s_type: StructureType, pub p_next: *const c_void, - pub slot_index: i8, pub p_std_reference_info: *const StdVideoEncodeH265ReferenceInfo, pub _marker: PhantomData<&'a ()>, } @@ -39189,7 +39198,6 @@ impl ::std::default::Default for VideoEncodeH265DpbSlotInfoEXT<'_> { Self { s_type: Self::STRUCTURE_TYPE, p_next: ::std::ptr::null(), - slot_index: i8::default(), p_std_reference_info: ::std::ptr::null(), _marker: PhantomData, } @@ -39198,12 +39206,8 @@ impl ::std::default::Default for VideoEncodeH265DpbSlotInfoEXT<'_> { unsafe impl<'a> TaggedStructure for VideoEncodeH265DpbSlotInfoEXT<'a> { const STRUCTURE_TYPE: StructureType = StructureType::VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT; } +unsafe impl ExtendsVideoReferenceSlotInfoKHR for VideoEncodeH265DpbSlotInfoEXT<'_> {} impl<'a> VideoEncodeH265DpbSlotInfoEXT<'a> { - #[inline] - pub fn slot_index(mut self, slot_index: i8) -> Self { - self.slot_index = slot_index; - self - } #[inline] pub fn std_reference_info( mut self, @@ -39216,66 +39220,6 @@ impl<'a> VideoEncodeH265DpbSlotInfoEXT<'a> { #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone)] -#[doc = ""] -pub struct VideoEncodeH265ReferenceListsInfoEXT<'a> { - pub s_type: StructureType, - pub p_next: *const c_void, - pub reference_list0_entry_count: u8, - pub p_reference_list0_entries: *const VideoEncodeH265DpbSlotInfoEXT<'a>, - pub reference_list1_entry_count: u8, - pub p_reference_list1_entries: *const VideoEncodeH265DpbSlotInfoEXT<'a>, - pub p_reference_modifications: *const StdVideoEncodeH265ReferenceModifications, - pub _marker: PhantomData<&'a ()>, -} -impl ::std::default::Default for VideoEncodeH265ReferenceListsInfoEXT<'_> { - #[inline] - fn default() -> Self { - Self { - s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null(), - reference_list0_entry_count: u8::default(), - p_reference_list0_entries: ::std::ptr::null(), - reference_list1_entry_count: u8::default(), - p_reference_list1_entries: ::std::ptr::null(), - p_reference_modifications: ::std::ptr::null(), - _marker: PhantomData, - } - } -} -unsafe impl<'a> TaggedStructure for VideoEncodeH265ReferenceListsInfoEXT<'a> { - const STRUCTURE_TYPE: StructureType = StructureType::VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT; -} -impl<'a> VideoEncodeH265ReferenceListsInfoEXT<'a> { - #[inline] - pub fn reference_list0_entries( - mut self, - reference_list0_entries: &'a [VideoEncodeH265DpbSlotInfoEXT], - ) -> Self { - self.reference_list0_entry_count = reference_list0_entries.len() as _; - self.p_reference_list0_entries = reference_list0_entries.as_ptr(); - self - } - #[inline] - pub fn reference_list1_entries( - mut self, - reference_list1_entries: &'a [VideoEncodeH265DpbSlotInfoEXT], - ) -> Self { - self.reference_list1_entry_count = reference_list1_entries.len() as _; - self.p_reference_list1_entries = reference_list1_entries.as_ptr(); - self - } - #[inline] - pub fn reference_modifications( - mut self, - reference_modifications: &'a StdVideoEncodeH265ReferenceModifications, - ) -> Self { - self.p_reference_modifications = reference_modifications; - self - } -} -#[repr(C)] -#[cfg_attr(feature = "debug", derive(Debug))] -#[derive(Copy, Clone)] #[doc = ""] pub struct PhysicalDeviceInheritedViewportScissorFeaturesNV<'a> { pub s_type: StructureType, @@ -46303,6 +46247,43 @@ impl DeviceFaultVendorBinaryHeaderVersionOneEXT { } #[repr(C)] #[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub pipeline_library_group_handles: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + pipeline_library_group_handles: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'_> {} +impl<'a> PhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT<'a> { + #[inline] + pub fn pipeline_library_group_handles(mut self, pipeline_library_group_handles: bool) -> Self { + self.pipeline_library_group_handles = pipeline_library_group_handles.into(); + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] #[derive(Copy, Clone, Default)] #[doc = ""] pub struct DecompressMemoryRegionNV { @@ -46599,7 +46580,7 @@ impl<'a> PhysicalDeviceSwapchainMaintenance1FeaturesEXT<'a> { #[doc = ""] pub struct SwapchainPresentFenceInfoEXT<'a> { pub s_type: StructureType, - pub p_next: *mut c_void, + pub p_next: *const c_void, pub swapchain_count: u32, pub p_fences: *const Fence, pub _marker: PhantomData<&'a ()>, @@ -46609,7 +46590,7 @@ impl ::std::default::Default for SwapchainPresentFenceInfoEXT<'_> { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null_mut(), + p_next: ::std::ptr::null(), swapchain_count: u32::default(), p_fences: ::std::ptr::null(), _marker: PhantomData, @@ -46634,7 +46615,7 @@ impl<'a> SwapchainPresentFenceInfoEXT<'a> { #[doc = ""] pub struct SwapchainPresentModesCreateInfoEXT<'a> { pub s_type: StructureType, - pub p_next: *mut c_void, + pub p_next: *const c_void, pub present_mode_count: u32, pub p_present_modes: *const PresentModeKHR, pub _marker: PhantomData<&'a ()>, @@ -46644,7 +46625,7 @@ impl ::std::default::Default for SwapchainPresentModesCreateInfoEXT<'_> { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null_mut(), + p_next: ::std::ptr::null(), present_mode_count: u32::default(), p_present_modes: ::std::ptr::null(), _marker: PhantomData, @@ -46669,7 +46650,7 @@ impl<'a> SwapchainPresentModesCreateInfoEXT<'a> { #[doc = ""] pub struct SwapchainPresentModeInfoEXT<'a> { pub s_type: StructureType, - pub p_next: *mut c_void, + pub p_next: *const c_void, pub swapchain_count: u32, pub p_present_modes: *const PresentModeKHR, pub _marker: PhantomData<&'a ()>, @@ -46679,7 +46660,7 @@ impl ::std::default::Default for SwapchainPresentModeInfoEXT<'_> { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, - p_next: ::std::ptr::null_mut(), + p_next: ::std::ptr::null(), swapchain_count: u32::default(), p_present_modes: ::std::ptr::null(), _marker: PhantomData, @@ -46996,3 +46977,248 @@ impl<'a> PhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM<'a> { self } } +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceShaderCorePropertiesARM<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub pixel_rate: u32, + pub texel_rate: u32, + pub fma_rate: u32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceShaderCorePropertiesARM<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + pixel_rate: u32::default(), + texel_rate: u32::default(), + fma_rate: u32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceShaderCorePropertiesARM<'a> { + const STRUCTURE_TYPE: StructureType = StructureType::PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM; +} +unsafe impl ExtendsPhysicalDeviceProperties2 for PhysicalDeviceShaderCorePropertiesARM<'_> {} +impl<'a> PhysicalDeviceShaderCorePropertiesARM<'a> { + #[inline] + pub fn pixel_rate(mut self, pixel_rate: u32) -> Self { + self.pixel_rate = pixel_rate; + self + } + #[inline] + pub fn texel_rate(mut self, texel_rate: u32) -> Self { + self.texel_rate = texel_rate; + self + } + #[inline] + pub fn fma_rate(mut self, fma_rate: u32) -> Self { + self.fma_rate = fma_rate; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'a> { + pub s_type: StructureType, + pub p_next: *mut c_void, + pub multiview_per_view_render_areas: Bool32, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null_mut(), + multiview_per_view_render_areas: Bool32::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM; +} +unsafe impl ExtendsPhysicalDeviceFeatures2 + for PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'_> +{ +} +unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'_> {} +impl<'a> PhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM<'a> { + #[inline] + pub fn multiview_per_view_render_areas( + mut self, + multiview_per_view_render_areas: bool, + ) -> Self { + self.multiview_per_view_render_areas = multiview_per_view_render_areas.into(); + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub per_view_render_area_count: u32, + pub p_per_view_render_areas: *const Rect2D, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + per_view_render_area_count: u32::default(), + p_per_view_render_areas: ::std::ptr::null(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'a> { + const STRUCTURE_TYPE: StructureType = + StructureType::MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM; +} +unsafe impl ExtendsRenderPassBeginInfo for MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'_> {} +unsafe impl ExtendsRenderingInfo for MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'_> {} +impl<'a> MultiviewPerViewRenderAreasRenderPassBeginInfoQCOM<'a> { + #[inline] + pub fn per_view_render_areas(mut self, per_view_render_areas: &'a [Rect2D]) -> Self { + self.per_view_render_area_count = per_view_render_areas.len() as _; + self.p_per_view_render_areas = per_view_render_areas.as_ptr(); + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct QueryLowLatencySupportNV<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub p_queried_low_latency_data: *mut c_void, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for QueryLowLatencySupportNV<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + p_queried_low_latency_data: ::std::ptr::null_mut(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for QueryLowLatencySupportNV<'a> { + const STRUCTURE_TYPE: StructureType = StructureType::QUERY_LOW_LATENCY_SUPPORT_NV; +} +unsafe impl ExtendsSemaphoreCreateInfo for QueryLowLatencySupportNV<'_> {} +impl<'a> QueryLowLatencySupportNV<'a> { + #[inline] + pub fn queried_low_latency_data(mut self, queried_low_latency_data: *mut c_void) -> Self { + self.p_queried_low_latency_data = queried_low_latency_data; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct MemoryMapInfoKHR<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub flags: MemoryMapFlags, + pub memory: DeviceMemory, + pub offset: DeviceSize, + pub size: DeviceSize, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for MemoryMapInfoKHR<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + flags: MemoryMapFlags::default(), + memory: DeviceMemory::default(), + offset: DeviceSize::default(), + size: DeviceSize::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for MemoryMapInfoKHR<'a> { + const STRUCTURE_TYPE: StructureType = StructureType::MEMORY_MAP_INFO_KHR; +} +impl<'a> MemoryMapInfoKHR<'a> { + #[inline] + pub fn flags(mut self, flags: MemoryMapFlags) -> Self { + self.flags = flags; + self + } + #[inline] + pub fn memory(mut self, memory: DeviceMemory) -> Self { + self.memory = memory; + self + } + #[inline] + pub fn offset(mut self, offset: DeviceSize) -> Self { + self.offset = offset; + self + } + #[inline] + pub fn size(mut self, size: DeviceSize) -> Self { + self.size = size; + self + } +} +#[repr(C)] +#[cfg_attr(feature = "debug", derive(Debug))] +#[derive(Copy, Clone)] +#[doc = ""] +pub struct MemoryUnmapInfoKHR<'a> { + pub s_type: StructureType, + pub p_next: *const c_void, + pub flags: MemoryUnmapFlagsKHR, + pub memory: DeviceMemory, + pub _marker: PhantomData<&'a ()>, +} +impl ::std::default::Default for MemoryUnmapInfoKHR<'_> { + #[inline] + fn default() -> Self { + Self { + s_type: Self::STRUCTURE_TYPE, + p_next: ::std::ptr::null(), + flags: MemoryUnmapFlagsKHR::default(), + memory: DeviceMemory::default(), + _marker: PhantomData, + } + } +} +unsafe impl<'a> TaggedStructure for MemoryUnmapInfoKHR<'a> { + const STRUCTURE_TYPE: StructureType = StructureType::MEMORY_UNMAP_INFO_KHR; +} +impl<'a> MemoryUnmapInfoKHR<'a> { + #[inline] + pub fn flags(mut self, flags: MemoryUnmapFlagsKHR) -> Self { + self.flags = flags; + self + } + #[inline] + pub fn memory(mut self, memory: DeviceMemory) -> Self { + self.memory = memory; + self + } +} diff --git a/ash/src/vk/enums.rs b/ash/src/vk/enums.rs index a27a55b..289b621 100644 --- a/ash/src/vk/enums.rs +++ b/ash/src/vk/enums.rs @@ -1744,6 +1744,8 @@ impl VendorId { pub const MESA: Self = Self(0x1_0005); #[doc = "PoCL vendor ID"] pub const POCL: Self = Self(0x1_0006); + #[doc = "Mobileye vendor ID"] + pub const MOBILEYE: Self = Self(0x1_0007); } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] @@ -1808,6 +1810,8 @@ impl DriverId { pub const MESA_DOZEN: Self = Self(23); #[doc = "Mesa open source project"] pub const MESA_NVK: Self = Self(24); + #[doc = "Imagination Technologies"] + pub const IMAGINATION_OPEN_SOURCE_MESA: Self = Self(25); } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] #[repr(transparent)] @@ -2898,6 +2902,9 @@ impl fmt::Debug for Result { Self::THREAD_DONE_KHR => Some("THREAD_DONE_KHR"), Self::OPERATION_DEFERRED_KHR => Some("OPERATION_DEFERRED_KHR"), Self::OPERATION_NOT_DEFERRED_KHR => Some("OPERATION_NOT_DEFERRED_KHR"), + Self::ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR => { + Some("ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR") + } Self::ERROR_COMPRESSION_EXHAUSTED_EXT => Some("ERROR_COMPRESSION_EXHAUSTED_EXT"), Self::ERROR_OUT_OF_POOL_MEMORY => Some("ERROR_OUT_OF_POOL_MEMORY"), Self::ERROR_INVALID_EXTERNAL_HANDLE => Some("ERROR_INVALID_EXTERNAL_HANDLE"), diff --git a/ash/src/vk/extensions.rs b/ash/src/vk/extensions.rs index 244e2cc..1fbc1bb 100644 --- a/ash/src/vk/extensions.rs +++ b/ash/src/vk/extensions.rs @@ -1487,8 +1487,6 @@ impl KhrSamplerMirrorClampToEdgeFn { impl SamplerAddressMode { #[doc = "Note that this defines what was previously a core enum, and so uses the 'value' attribute rather than 'offset', and does not have a suffix. This is a special case, and should not be repeated"] pub const MIRROR_CLAMP_TO_EDGE: Self = Self(4); - #[deprecated = "Alias introduced for consistency with extension suffixing rules"] - pub const MIRROR_CLAMP_TO_EDGE_KHR: Self = Self::MIRROR_CLAMP_TO_EDGE; } impl ImgFilterCubicFn { pub const NAME: &'static ::std::ffi::CStr = @@ -2874,7 +2872,7 @@ impl AmdShaderBallotFn { impl ExtVideoEncodeH264Fn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_encode_h264\0") }; - pub const SPEC_VERSION: u32 = 9u32; + pub const SPEC_VERSION: u32 = 10u32; } #[derive(Clone)] pub struct ExtVideoEncodeH264Fn {} @@ -2896,11 +2894,9 @@ impl StructureType { pub const VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: Self = Self(1_000_038_003); pub const VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT: Self = Self(1_000_038_004); pub const VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT: Self = Self(1_000_038_005); - pub const VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT: Self = Self(1_000_038_006); pub const VIDEO_ENCODE_H264_PROFILE_INFO_EXT: Self = Self(1_000_038_007); pub const VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT: Self = Self(1_000_038_008); pub const VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_038_009); - pub const VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT: Self = Self(1_000_038_010); } #[doc = "Generated from 'VK_EXT_video_encode_h264'"] impl VideoCodecOperationFlagsKHR { @@ -2909,7 +2905,7 @@ impl VideoCodecOperationFlagsKHR { impl ExtVideoEncodeH265Fn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_video_encode_h265\0") }; - pub const SPEC_VERSION: u32 = 9u32; + pub const SPEC_VERSION: u32 = 10u32; } #[derive(Clone)] pub struct ExtVideoEncodeH265Fn {} @@ -2931,9 +2927,7 @@ impl StructureType { pub const VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: Self = Self(1_000_039_003); pub const VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT: Self = Self(1_000_039_004); pub const VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT: Self = Self(1_000_039_005); - pub const VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT: Self = Self(1_000_039_006); pub const VIDEO_ENCODE_H265_PROFILE_INFO_EXT: Self = Self(1_000_039_007); - pub const VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT: Self = Self(1_000_039_008); pub const VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT: Self = Self(1_000_039_009); pub const VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT: Self = Self(1_000_039_010); } @@ -5726,7 +5720,7 @@ impl StructureType { impl ExtDiscardRectanglesFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_discard_rectangles\0") }; - pub const SPEC_VERSION: u32 = 1u32; + pub const SPEC_VERSION: u32 = 2u32; } #[allow(non_camel_case_types)] pub type PFN_vkCmdSetDiscardRectangleEXT = unsafe extern "system" fn( @@ -5735,9 +5729,19 @@ pub type PFN_vkCmdSetDiscardRectangleEXT = unsafe extern "system" fn( discard_rectangle_count: u32, p_discard_rectangles: *const Rect2D, ); +#[allow(non_camel_case_types)] +pub type PFN_vkCmdSetDiscardRectangleEnableEXT = + unsafe extern "system" fn(command_buffer: CommandBuffer, discard_rectangle_enable: Bool32); +#[allow(non_camel_case_types)] +pub type PFN_vkCmdSetDiscardRectangleModeEXT = unsafe extern "system" fn( + command_buffer: CommandBuffer, + discard_rectangle_mode: DiscardRectangleModeEXT, +); #[derive(Clone)] pub struct ExtDiscardRectanglesFn { pub cmd_set_discard_rectangle_ext: PFN_vkCmdSetDiscardRectangleEXT, + pub cmd_set_discard_rectangle_enable_ext: PFN_vkCmdSetDiscardRectangleEnableEXT, + pub cmd_set_discard_rectangle_mode_ext: PFN_vkCmdSetDiscardRectangleModeEXT, } unsafe impl Send for ExtDiscardRectanglesFn {} unsafe impl Sync for ExtDiscardRectanglesFn {} @@ -5769,12 +5773,54 @@ impl ExtDiscardRectanglesFn { ::std::mem::transmute(val) } }, + cmd_set_discard_rectangle_enable_ext: unsafe { + unsafe extern "system" fn cmd_set_discard_rectangle_enable_ext( + _command_buffer: CommandBuffer, + _discard_rectangle_enable: Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_discard_rectangle_enable_ext) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetDiscardRectangleEnableEXT\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_discard_rectangle_enable_ext + } else { + ::std::mem::transmute(val) + } + }, + cmd_set_discard_rectangle_mode_ext: unsafe { + unsafe extern "system" fn cmd_set_discard_rectangle_mode_ext( + _command_buffer: CommandBuffer, + _discard_rectangle_mode: DiscardRectangleModeEXT, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_discard_rectangle_mode_ext) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetDiscardRectangleModeEXT\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_discard_rectangle_mode_ext + } else { + ::std::mem::transmute(val) + } + }, } } } #[doc = "Generated from 'VK_EXT_discard_rectangles'"] impl DynamicState { pub const DISCARD_RECTANGLE_EXT: Self = Self(1_000_099_000); + pub const DISCARD_RECTANGLE_ENABLE_EXT: Self = Self(1_000_099_001); + pub const DISCARD_RECTANGLE_MODE_EXT: Self = Self(1_000_099_002); } #[doc = "Generated from 'VK_EXT_discard_rectangles'"] impl StructureType { @@ -11108,9 +11154,16 @@ impl StructureType { impl NvScissorExclusiveFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_scissor_exclusive\0") }; - pub const SPEC_VERSION: u32 = 1u32; + pub const SPEC_VERSION: u32 = 2u32; } #[allow(non_camel_case_types)] +pub type PFN_vkCmdSetExclusiveScissorEnableNV = unsafe extern "system" fn( + command_buffer: CommandBuffer, + first_exclusive_scissor: u32, + exclusive_scissor_count: u32, + p_exclusive_scissor_enables: *const Bool32, +); +#[allow(non_camel_case_types)] pub type PFN_vkCmdSetExclusiveScissorNV = unsafe extern "system" fn( command_buffer: CommandBuffer, first_exclusive_scissor: u32, @@ -11119,6 +11172,7 @@ pub type PFN_vkCmdSetExclusiveScissorNV = unsafe extern "system" fn( ); #[derive(Clone)] pub struct NvScissorExclusiveFn { + pub cmd_set_exclusive_scissor_enable_nv: PFN_vkCmdSetExclusiveScissorEnableNV, pub cmd_set_exclusive_scissor_nv: PFN_vkCmdSetExclusiveScissorNV, } unsafe impl Send for NvScissorExclusiveFn {} @@ -11129,6 +11183,28 @@ impl NvScissorExclusiveFn { F: FnMut(&::std::ffi::CStr) -> *const c_void, { Self { + cmd_set_exclusive_scissor_enable_nv: unsafe { + unsafe extern "system" fn cmd_set_exclusive_scissor_enable_nv( + _command_buffer: CommandBuffer, + _first_exclusive_scissor: u32, + _exclusive_scissor_count: u32, + _p_exclusive_scissor_enables: *const Bool32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_set_exclusive_scissor_enable_nv) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdSetExclusiveScissorEnableNV\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_set_exclusive_scissor_enable_nv + } else { + ::std::mem::transmute(val) + } + }, cmd_set_exclusive_scissor_nv: unsafe { unsafe extern "system" fn cmd_set_exclusive_scissor_nv( _command_buffer: CommandBuffer, @@ -11156,6 +11232,7 @@ impl NvScissorExclusiveFn { } #[doc = "Generated from 'VK_NV_scissor_exclusive'"] impl DynamicState { + pub const EXCLUSIVE_SCISSOR_ENABLE_NV: Self = Self(1_000_205_000); pub const EXCLUSIVE_SCISSOR_NV: Self = Self(1_000_205_001); } #[doc = "Generated from 'VK_NV_scissor_exclusive'"] @@ -13860,6 +13937,74 @@ impl StructureType { pub const PIPELINE_EXECUTABLE_STATISTIC_KHR: Self = Self(1_000_269_004); pub const PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR: Self = Self(1_000_269_005); } +impl KhrMapMemory2Fn { + pub const NAME: &'static ::std::ffi::CStr = + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_map_memory2\0") }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[allow(non_camel_case_types)] +pub type PFN_vkMapMemory2KHR = unsafe extern "system" fn( + device: Device, + p_memory_map_info: *const MemoryMapInfoKHR, + pp_data: *mut *mut c_void, +) -> Result; +#[allow(non_camel_case_types)] +pub type PFN_vkUnmapMemory2KHR = unsafe extern "system" fn( + device: Device, + p_memory_unmap_info: *const MemoryUnmapInfoKHR, +) -> Result; +#[derive(Clone)] +pub struct KhrMapMemory2Fn { + pub map_memory2_khr: PFN_vkMapMemory2KHR, + pub unmap_memory2_khr: PFN_vkUnmapMemory2KHR, +} +unsafe impl Send for KhrMapMemory2Fn {} +unsafe impl Sync for KhrMapMemory2Fn {} +impl KhrMapMemory2Fn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self { + map_memory2_khr: unsafe { + unsafe extern "system" fn map_memory2_khr( + _device: Device, + _p_memory_map_info: *const MemoryMapInfoKHR, + _pp_data: *mut *mut c_void, + ) -> Result { + panic!(concat!("Unable to load ", stringify!(map_memory2_khr))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkMapMemory2KHR\0"); + let val = _f(cname); + if val.is_null() { + map_memory2_khr + } else { + ::std::mem::transmute(val) + } + }, + unmap_memory2_khr: unsafe { + unsafe extern "system" fn unmap_memory2_khr( + _device: Device, + _p_memory_unmap_info: *const MemoryUnmapInfoKHR, + ) -> Result { + panic!(concat!("Unable to load ", stringify!(unmap_memory2_khr))) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkUnmapMemory2KHR\0"); + let val = _f(cname); + if val.is_null() { + unmap_memory2_khr + } else { + ::std::mem::transmute(val) + } + }, + } + } +} +#[doc = "Generated from 'VK_KHR_map_memory2'"] +impl StructureType { + pub const MEMORY_MAP_INFO_KHR: Self = Self(1_000_271_000); + pub const MEMORY_UNMAP_INFO_KHR: Self = Self(1_000_271_001); +} impl ExtShaderAtomicFloat2Fn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_shader_atomic_float2\0") @@ -14745,7 +14890,7 @@ impl StructureType { impl KhrVideoEncodeQueueFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_KHR_video_encode_queue\0") }; - pub const SPEC_VERSION: u32 = 7u32; + pub const SPEC_VERSION: u32 = 8u32; } #[allow(non_camel_case_types)] pub type PFN_vkCmdEncodeVideoKHR = unsafe extern "system" fn( @@ -14822,19 +14967,24 @@ impl PipelineStageFlags2 { } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl QueryType { - pub const VIDEO_ENCODESTREAM_BUFFER_RANGE_KHR: Self = Self(1_000_299_000); + pub const VIDEO_ENCODE_FEEDBACK_KHR: Self = Self(1_000_299_000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl QueueFlags { pub const VIDEO_ENCODE_KHR: Self = Self(0b100_0000); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] +impl Result { + pub const ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR: Self = Self(-1_000_299_000); +} +#[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl StructureType { pub const VIDEO_ENCODE_INFO_KHR: Self = Self(1_000_299_000); pub const VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: Self = Self(1_000_299_001); pub const VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR: Self = Self(1_000_299_002); pub const VIDEO_ENCODE_CAPABILITIES_KHR: Self = Self(1_000_299_003); pub const VIDEO_ENCODE_USAGE_INFO_KHR: Self = Self(1_000_299_004); + pub const QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR: Self = Self(1_000_299_005); } #[doc = "Generated from 'VK_KHR_video_encode_queue'"] impl VideoCodingControlFlagsKHR { @@ -14886,6 +15036,27 @@ impl QcomRenderPassStoreOpsFn { impl AttachmentStoreOp { pub const NONE_QCOM: Self = Self::NONE; } +impl NvLowLatencyFn { + pub const NAME: &'static ::std::ffi::CStr = + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_NV_low_latency\0") }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct NvLowLatencyFn {} +unsafe impl Send for NvLowLatencyFn {} +unsafe impl Sync for NvLowLatencyFn {} +impl NvLowLatencyFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_NV_low_latency'"] +impl StructureType { + pub const QUERY_LOW_LATENCY_SUPPORT_NV: Self = Self(1_000_310_000); +} impl ExtMetalObjectsFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_metal_objects\0") }; @@ -18621,6 +18792,98 @@ impl AttachmentLoadOp { impl AttachmentStoreOp { pub const NONE_EXT: Self = Self::NONE; } +impl HuaweiClusterCullingShaderFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_HUAWEI_cluster_culling_shader\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[allow(non_camel_case_types)] +pub type PFN_vkCmdDrawClusterHUAWEI = unsafe extern "system" fn( + command_buffer: CommandBuffer, + group_count_x: u32, + group_count_y: u32, + group_count_z: u32, +); +#[allow(non_camel_case_types)] +pub type PFN_vkCmdDrawClusterIndirectHUAWEI = + unsafe extern "system" fn(command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize); +#[derive(Clone)] +pub struct HuaweiClusterCullingShaderFn { + pub cmd_draw_cluster_huawei: PFN_vkCmdDrawClusterHUAWEI, + pub cmd_draw_cluster_indirect_huawei: PFN_vkCmdDrawClusterIndirectHUAWEI, +} +unsafe impl Send for HuaweiClusterCullingShaderFn {} +unsafe impl Sync for HuaweiClusterCullingShaderFn {} +impl HuaweiClusterCullingShaderFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self { + cmd_draw_cluster_huawei: unsafe { + unsafe extern "system" fn cmd_draw_cluster_huawei( + _command_buffer: CommandBuffer, + _group_count_x: u32, + _group_count_y: u32, + _group_count_z: u32, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_draw_cluster_huawei) + )) + } + let cname = + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCmdDrawClusterHUAWEI\0"); + let val = _f(cname); + if val.is_null() { + cmd_draw_cluster_huawei + } else { + ::std::mem::transmute(val) + } + }, + cmd_draw_cluster_indirect_huawei: unsafe { + unsafe extern "system" fn cmd_draw_cluster_indirect_huawei( + _command_buffer: CommandBuffer, + _buffer: Buffer, + _offset: DeviceSize, + ) { + panic!(concat!( + "Unable to load ", + stringify!(cmd_draw_cluster_indirect_huawei) + )) + } + let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"vkCmdDrawClusterIndirectHUAWEI\0", + ); + let val = _f(cname); + if val.is_null() { + cmd_draw_cluster_indirect_huawei + } else { + ::std::mem::transmute(val) + } + }, + } + } +} +#[doc = "Generated from 'VK_HUAWEI_cluster_culling_shader'"] +impl PipelineStageFlags2 { + pub const CLUSTER_CULLING_SHADER_HUAWEI: Self = + Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000); +} +#[doc = "Generated from 'VK_HUAWEI_cluster_culling_shader'"] +impl QueryPipelineStatisticFlags { + pub const CLUSTER_CULLING_SHADER_INVOCATIONS_HUAWEI: Self = Self(0b10_0000_0000_0000); +} +#[doc = "Generated from 'VK_HUAWEI_cluster_culling_shader'"] +impl ShaderStageFlags { + pub const CLUSTER_CULLING_HUAWEI: Self = Self(0b1000_0000_0000_0000_0000); +} +#[doc = "Generated from 'VK_HUAWEI_cluster_culling_shader'"] +impl StructureType { + pub const PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: Self = Self(1_000_404_000); + pub const PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: Self = Self(1_000_404_001); +} impl ExtBorderColorSwizzleFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_border_color_swizzle\0") @@ -18812,6 +19075,51 @@ impl StructureType { pub const DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR: Self = Self::DEVICE_BUFFER_MEMORY_REQUIREMENTS; pub const DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR: Self = Self::DEVICE_IMAGE_MEMORY_REQUIREMENTS; } +impl ArmShaderCorePropertiesFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_ARM_shader_core_properties\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct ArmShaderCorePropertiesFn {} +unsafe impl Send for ArmShaderCorePropertiesFn {} +unsafe impl Sync for ArmShaderCorePropertiesFn {} +impl ArmShaderCorePropertiesFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_ARM_shader_core_properties'"] +impl StructureType { + pub const PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: Self = Self(1_000_415_000); +} +impl ExtImageSlicedViewOf3dFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_image_sliced_view_of_3d\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct ExtImageSlicedViewOf3dFn {} +unsafe impl Send for ExtImageSlicedViewOf3dFn {} +unsafe impl Sync for ExtImageSlicedViewOf3dFn {} +impl ExtImageSlicedViewOf3dFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_EXT_image_sliced_view_of_3d'"] +impl StructureType { + pub const PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: Self = Self(1_000_418_000); + pub const IMAGE_VIEW_SLICED_CREATE_INFO_EXT: Self = Self(1_000_418_001); +} impl ValveDescriptorSetHostMappingFn { pub const NAME: &'static ::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_VALVE_descriptor_set_host_mapping\0") @@ -20764,3 +21072,53 @@ impl StructureType { pub const PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: Self = Self(1_000_497_000); pub const PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: Self = Self(1_000_497_001); } +impl ExtPipelineLibraryGroupHandlesFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"VK_EXT_pipeline_library_group_handles\0") + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct ExtPipelineLibraryGroupHandlesFn {} +unsafe impl Send for ExtPipelineLibraryGroupHandlesFn {} +unsafe impl Sync for ExtPipelineLibraryGroupHandlesFn {} +impl ExtPipelineLibraryGroupHandlesFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_EXT_pipeline_library_group_handles'"] +impl StructureType { + pub const PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: Self = + Self(1_000_498_000); +} +impl QcomMultiviewPerViewRenderAreasFn { + pub const NAME: &'static ::std::ffi::CStr = unsafe { + ::std::ffi::CStr::from_bytes_with_nul_unchecked( + b"VK_QCOM_multiview_per_view_render_areas\0", + ) + }; + pub const SPEC_VERSION: u32 = 1u32; +} +#[derive(Clone)] +pub struct QcomMultiviewPerViewRenderAreasFn {} +unsafe impl Send for QcomMultiviewPerViewRenderAreasFn {} +unsafe impl Sync for QcomMultiviewPerViewRenderAreasFn {} +impl QcomMultiviewPerViewRenderAreasFn { + pub fn load(mut _f: F) -> Self + where + F: FnMut(&::std::ffi::CStr) -> *const c_void, + { + Self {} + } +} +#[doc = "Generated from 'VK_QCOM_multiview_per_view_render_areas'"] +impl StructureType { + pub const PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: Self = + Self(1_000_510_000); + pub const MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: Self = + Self(1_000_510_001); +} diff --git a/ash/src/vk/native.rs b/ash/src/vk/native.rs index 02edfba..1a6b58d 100644 --- a/ash/src/vk/native.rs +++ b/ash/src/vk/native.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.61.0 */ +/* automatically generated by rust-bindgen 0.63.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -7050,42 +7050,48 @@ impl StdVideoEncodeH264ReferenceInfoFlags { #[repr(C)] #[repr(align(4))] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH264RefMgmtFlags { +pub struct StdVideoEncodeH264ReferenceListsInfoFlags { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } #[test] -fn bindgen_test_layout_StdVideoEncodeH264RefMgmtFlags() { +fn bindgen_test_layout_StdVideoEncodeH264ReferenceListsInfoFlags() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(StdVideoEncodeH264RefMgmtFlags)) + concat!( + "Size of: ", + stringify!(StdVideoEncodeH264ReferenceListsInfoFlags) + ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(StdVideoEncodeH264RefMgmtFlags)) + concat!( + "Alignment of ", + stringify!(StdVideoEncodeH264ReferenceListsInfoFlags) + ) ); } -impl StdVideoEncodeH264RefMgmtFlags { +impl StdVideoEncodeH264ReferenceListsInfoFlags { #[inline] - pub fn ref_pic_list_modification_l0_flag(&self) -> u32 { + pub fn ref_pic_list_modification_flag_l0(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_ref_pic_list_modification_l0_flag(&mut self, val: u32) { + pub fn set_ref_pic_list_modification_flag_l0(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn ref_pic_list_modification_l1_flag(&self) -> u32 { + pub fn ref_pic_list_modification_flag_l1(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } } #[inline] - pub fn set_ref_pic_list_modification_l1_flag(&mut self, val: u32) { + pub fn set_ref_pic_list_modification_flag_l1(&mut self, val: u32) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(1usize, 1u8, val as u64) @@ -7093,19 +7099,19 @@ impl StdVideoEncodeH264RefMgmtFlags { } #[inline] pub fn new_bitfield_1( - ref_pic_list_modification_l0_flag: u32, - ref_pic_list_modification_l1_flag: u32, + ref_pic_list_modification_flag_l0: u32, + ref_pic_list_modification_flag_l1: u32, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let ref_pic_list_modification_l0_flag: u32 = - unsafe { ::std::mem::transmute(ref_pic_list_modification_l0_flag) }; - ref_pic_list_modification_l0_flag as u64 + let ref_pic_list_modification_flag_l0: u32 = + unsafe { ::std::mem::transmute(ref_pic_list_modification_flag_l0) }; + ref_pic_list_modification_flag_l0 as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let ref_pic_list_modification_l1_flag: u32 = - unsafe { ::std::mem::transmute(ref_pic_list_modification_l1_flag) }; - ref_pic_list_modification_l1_flag as u64 + let ref_pic_list_modification_flag_l1: u32 = + unsafe { ::std::mem::transmute(ref_pic_list_modification_flag_l1) }; + ref_pic_list_modification_flag_l1 as u64 }); __bindgen_bitfield_unit } @@ -7255,34 +7261,39 @@ fn bindgen_test_layout_StdVideoEncodeH264RefPicMarkingEntry() { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH264RefMemMgmtCtrlOperations { - pub flags: StdVideoEncodeH264RefMgmtFlags, +pub struct StdVideoEncodeH264ReferenceListsInfo { + pub flags: StdVideoEncodeH264ReferenceListsInfoFlags, + pub refPicList0EntryCount: u8, + pub refPicList1EntryCount: u8, pub refList0ModOpCount: u8, - pub pRefList0ModOperations: *const StdVideoEncodeH264RefListModEntry, pub refList1ModOpCount: u8, - pub pRefList1ModOperations: *const StdVideoEncodeH264RefListModEntry, pub refPicMarkingOpCount: u8, + pub reserved1: [u8; 7usize], + pub pRefPicList0Entries: *const u8, + pub pRefPicList1Entries: *const u8, + pub pRefList0ModOperations: *const StdVideoEncodeH264RefListModEntry, + pub pRefList1ModOperations: *const StdVideoEncodeH264RefListModEntry, pub pRefPicMarkingOperations: *const StdVideoEncodeH264RefPicMarkingEntry, } #[test] -fn bindgen_test_layout_StdVideoEncodeH264RefMemMgmtCtrlOperations() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_StdVideoEncodeH264ReferenceListsInfo() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 48usize, + ::std::mem::size_of::(), + 56usize, concat!( "Size of: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations) + stringify!(StdVideoEncodeH264ReferenceListsInfo) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations) + stringify!(StdVideoEncodeH264ReferenceListsInfo) ) ); assert_eq!( @@ -7290,67 +7301,117 @@ fn bindgen_test_layout_StdVideoEncodeH264RefMemMgmtCtrlOperations() { 0usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), + stringify!(StdVideoEncodeH264ReferenceListsInfo), "::", stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).refList0ModOpCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).refPicList0EntryCount) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(refPicList0EntryCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).refPicList1EntryCount) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(refPicList1EntryCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).refList0ModOpCount) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), "::", stringify!(refList0ModOpCount) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRefList0ModOperations) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), - "::", - stringify!(pRefList0ModOperations) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).refList1ModOpCount) as usize - ptr as usize }, - 16usize, + 7usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), + stringify!(StdVideoEncodeH264ReferenceListsInfo), "::", stringify!(refList1ModOpCount) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRefList1ModOperations) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), - "::", - stringify!(pRefList1ModOperations) - ) - ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).refPicMarkingOpCount) as usize - ptr as usize }, - 32usize, + 8usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), + stringify!(StdVideoEncodeH264ReferenceListsInfo), "::", stringify!(refPicMarkingOpCount) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRefPicMarkingOperations) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 9usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefPicList0Entries) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(pRefPicList0Entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefPicList1Entries) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(pRefPicList1Entries) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefList0ModOperations) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(pRefList0ModOperations) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefList1ModOperations) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations), + stringify!(StdVideoEncodeH264ReferenceListsInfo), + "::", + stringify!(pRefList1ModOperations) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefPicMarkingOperations) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceListsInfo), "::", stringify!(pRefPicMarkingOperations) ) @@ -7362,6 +7423,7 @@ pub struct StdVideoEncodeH264PictureInfo { pub flags: StdVideoEncodeH264PictureInfoFlags, pub seq_parameter_set_id: u8, pub pic_parameter_set_id: u8, + pub reserved1: u16, pub pictureType: StdVideoH264PictureType, pub frame_num: u32, pub PicOrderCnt: i32, @@ -7411,6 +7473,16 @@ fn bindgen_test_layout_StdVideoEncodeH264PictureInfo() { stringify!(pic_parameter_set_id) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264PictureInfo), + "::", + stringify!(reserved1) + ) + ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pictureType) as usize - ptr as usize }, 8usize, @@ -7446,6 +7518,7 @@ fn bindgen_test_layout_StdVideoEncodeH264PictureInfo() { #[derive(Debug, Copy, Clone)] pub struct StdVideoEncodeH264ReferenceInfo { pub flags: StdVideoEncodeH264ReferenceInfoFlags, + pub pictureType: StdVideoH264PictureType, pub FrameNum: u32, pub PicOrderCnt: i32, pub long_term_pic_num: u16, @@ -7458,7 +7531,7 @@ fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16usize, + 20usize, concat!("Size of: ", stringify!(StdVideoEncodeH264ReferenceInfo)) ); assert_eq!( @@ -7477,8 +7550,18 @@ fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).FrameNum) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pictureType) as usize - ptr as usize }, 4usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264ReferenceInfo), + "::", + stringify!(pictureType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).FrameNum) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264ReferenceInfo), @@ -7488,7 +7571,7 @@ fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).PicOrderCnt) as usize - ptr as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264ReferenceInfo), @@ -7498,7 +7581,7 @@ fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).long_term_pic_num) as usize - ptr as usize }, - 12usize, + 16usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264ReferenceInfo), @@ -7508,7 +7591,7 @@ fn bindgen_test_layout_StdVideoEncodeH264ReferenceInfo() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).long_term_frame_idx) as usize - ptr as usize }, - 14usize, + 18usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH264ReferenceInfo), @@ -7530,6 +7613,8 @@ pub struct StdVideoEncodeH264SliceHeader { pub disable_deblocking_filter_idc: StdVideoH264DisableDeblockingFilterIdc, pub slice_alpha_c0_offset_div2: i8, pub slice_beta_offset_div2: i8, + pub reserved1: u16, + pub reserved2: u32, pub pWeightTable: *const StdVideoEncodeH264WeightTable, } #[test] @@ -7653,6 +7738,26 @@ fn bindgen_test_layout_StdVideoEncodeH264SliceHeader() { stringify!(slice_beta_offset_div2) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264SliceHeader), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH264SliceHeader), + "::", + stringify!(reserved2) + ) + ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pWeightTable) as usize - ptr as usize }, 32usize, @@ -8511,31 +8616,31 @@ fn bindgen_test_layout_StdVideoEncodeH265SliceSegmentHeader() { #[repr(C)] #[repr(align(4))] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH265ReferenceModificationFlags { +pub struct StdVideoEncodeH265ReferenceListsInfoFlags { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 3usize], } #[test] -fn bindgen_test_layout_StdVideoEncodeH265ReferenceModificationFlags() { +fn bindgen_test_layout_StdVideoEncodeH265ReferenceListsInfoFlags() { assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), 4usize, concat!( "Size of: ", - stringify!(StdVideoEncodeH265ReferenceModificationFlags) + stringify!(StdVideoEncodeH265ReferenceListsInfoFlags) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, concat!( "Alignment of ", - stringify!(StdVideoEncodeH265ReferenceModificationFlags) + stringify!(StdVideoEncodeH265ReferenceListsInfoFlags) ) ); } -impl StdVideoEncodeH265ReferenceModificationFlags { +impl StdVideoEncodeH265ReferenceListsInfoFlags { #[inline] pub fn ref_pic_list_modification_flag_l0(&self) -> u32 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } @@ -8579,32 +8684,35 @@ impl StdVideoEncodeH265ReferenceModificationFlags { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct StdVideoEncodeH265ReferenceModifications { - pub flags: StdVideoEncodeH265ReferenceModificationFlags, - pub referenceList0ModificationsCount: u8, - pub pReferenceList0Modifications: *const u8, - pub referenceList1ModificationsCount: u8, - pub pReferenceList1Modifications: *const u8, +pub struct StdVideoEncodeH265ReferenceListsInfo { + pub flags: StdVideoEncodeH265ReferenceListsInfoFlags, + pub num_ref_idx_l0_active_minus1: u8, + pub num_ref_idx_l1_active_minus1: u8, + pub reserved1: u16, + pub pRefPicList0Entries: *const u8, + pub pRefPicList1Entries: *const u8, + pub pRefList0Modifications: *const u8, + pub pRefList1Modifications: *const u8, } #[test] -fn bindgen_test_layout_StdVideoEncodeH265ReferenceModifications() { - const UNINIT: ::std::mem::MaybeUninit = +fn bindgen_test_layout_StdVideoEncodeH265ReferenceListsInfo() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 32usize, + ::std::mem::size_of::(), + 40usize, concat!( "Size of: ", - stringify!(StdVideoEncodeH265ReferenceModifications) + stringify!(StdVideoEncodeH265ReferenceListsInfo) ) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", - stringify!(StdVideoEncodeH265ReferenceModifications) + stringify!(StdVideoEncodeH265ReferenceListsInfo) ) ); assert_eq!( @@ -8612,57 +8720,83 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceModifications() { 0usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265ReferenceModifications), + stringify!(StdVideoEncodeH265ReferenceListsInfo), "::", stringify!(flags) ) ); assert_eq!( unsafe { - ::std::ptr::addr_of!((*ptr).referenceList0ModificationsCount) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).num_ref_idx_l0_active_minus1) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265ReferenceModifications), + stringify!(StdVideoEncodeH265ReferenceListsInfo), "::", - stringify!(referenceList0ModificationsCount) + stringify!(num_ref_idx_l0_active_minus1) ) ); assert_eq!( unsafe { - ::std::ptr::addr_of!((*ptr).pReferenceList0Modifications) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).num_ref_idx_l1_active_minus1) as usize - ptr as usize }, + 5usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265ReferenceListsInfo), + "::", + stringify!(num_ref_idx_l1_active_minus1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265ReferenceListsInfo), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefPicList0Entries) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265ReferenceModifications), + stringify!(StdVideoEncodeH265ReferenceListsInfo), "::", - stringify!(pReferenceList0Modifications) + stringify!(pRefPicList0Entries) ) ); assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).referenceList1ModificationsCount) as usize - ptr as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pRefPicList1Entries) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265ReferenceModifications), + stringify!(StdVideoEncodeH265ReferenceListsInfo), "::", - stringify!(referenceList1ModificationsCount) + stringify!(pRefPicList1Entries) ) ); assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).pReferenceList1Modifications) as usize - ptr as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pRefList0Modifications) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(StdVideoEncodeH265ReferenceModifications), + stringify!(StdVideoEncodeH265ReferenceListsInfo), "::", - stringify!(pReferenceList1Modifications) + stringify!(pRefList0Modifications) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pRefList1Modifications) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265ReferenceListsInfo), + "::", + stringify!(pRefList1Modifications) ) ); } @@ -8786,8 +8920,8 @@ pub struct StdVideoEncodeH265PictureInfo { pub sps_video_parameter_set_id: u8, pub pps_seq_parameter_set_id: u8, pub pps_pic_parameter_set_id: u8, - pub PicOrderCntVal: i32, pub TemporalId: u8, + pub PicOrderCntVal: i32, } #[test] fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { @@ -8796,7 +8930,7 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 20usize, + 16usize, concat!("Size of: ", stringify!(StdVideoEncodeH265PictureInfo)) ); assert_eq!( @@ -8854,6 +8988,16 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { stringify!(pps_pic_parameter_set_id) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).TemporalId) as usize - ptr as usize }, + 11usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265PictureInfo), + "::", + stringify!(TemporalId) + ) + ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).PicOrderCntVal) as usize - ptr as usize }, 12usize, @@ -8864,16 +9008,6 @@ fn bindgen_test_layout_StdVideoEncodeH265PictureInfo() { stringify!(PicOrderCntVal) ) ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).TemporalId) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(StdVideoEncodeH265PictureInfo), - "::", - stringify!(TemporalId) - ) - ); } #[repr(C)] #[repr(align(4))] @@ -8947,6 +9081,7 @@ impl StdVideoEncodeH265ReferenceInfoFlags { #[derive(Debug, Copy, Clone)] pub struct StdVideoEncodeH265ReferenceInfo { pub flags: StdVideoEncodeH265ReferenceInfoFlags, + pub PictureType: StdVideoH265PictureType, pub PicOrderCntVal: i32, pub TemporalId: u8, } @@ -8957,7 +9092,7 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 12usize, + 16usize, concat!("Size of: ", stringify!(StdVideoEncodeH265ReferenceInfo)) ); assert_eq!( @@ -8976,8 +9111,18 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).PicOrderCntVal) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).PictureType) as usize - ptr as usize }, 4usize, + concat!( + "Offset of field: ", + stringify!(StdVideoEncodeH265ReferenceInfo), + "::", + stringify!(PictureType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).PicOrderCntVal) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265ReferenceInfo), @@ -8987,7 +9132,7 @@ fn bindgen_test_layout_StdVideoEncodeH265ReferenceInfo() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).TemporalId) as usize - ptr as usize }, - 8usize, + 12usize, concat!( "Offset of field: ", stringify!(StdVideoEncodeH265ReferenceInfo), diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 13926e2..ec45261 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Maik Klein "] edition = "2021" [dependencies] -bindgen = "0.61" +bindgen = "0.63" heck = "0.4" itertools = "0.10" nom = "7.1" @@ -13,7 +13,7 @@ once_cell = "1.7" proc-macro2 = "1.0" quote = "1.0" regex = "1.4" -vk-parse = { version = "0.9", features = ["vkxml-convert"] } +vk-parse = { version = "0.10", features = ["vkxml-convert"] } vkxml = "0.3" [dependencies.syn] diff --git a/generator/Vulkan-Headers b/generator/Vulkan-Headers index 00671c6..fa204df 160000 --- a/generator/Vulkan-Headers +++ b/generator/Vulkan-Headers @@ -1 +1 @@ -Subproject commit 00671c64ba5c488ade22ad572a0ef81d5e64c803 +Subproject commit fa204df59c6caea6b9be3cf0754a88cd89056a87 diff --git a/generator/src/lib.rs b/generator/src/lib.rs index fdada63..5624bd2 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -26,6 +26,12 @@ use std::{ }; use syn::Ident; +const DESIRED_API: &str = "vulkan"; + +fn contains_desired_api(api: &str) -> bool { + api.split(',').any(|n| n == DESIRED_API) +} + macro_rules! get_variant { ($variant:path) => { |enum_| match enum_ { @@ -41,8 +47,6 @@ macro_rules! get_variant { }; } -const BACKWARDS_COMPATIBLE_ALIAS_COMMENT: &str = "Backwards-compatible alias containing a typo"; - pub trait ExtensionExt {} #[derive(Copy, Clone, Debug)] pub enum CType { @@ -311,17 +315,9 @@ pub trait ConstantExt { fn is_alias(&self) -> bool { false } - fn doc_attribute(&self) -> TokenStream { - assert_ne!( - self.notation(), - Some(BACKWARDS_COMPATIBLE_ALIAS_COMMENT), - "Backwards-compatible constants should not be emitted" - ); - match self.formatted_notation() { - Some(n) if n.starts_with("Alias") => quote!(#[deprecated = #n]), - Some(n) => quote!(#[doc = #n]), - None => quote!(), - } + fn is_deprecated(&self) -> bool; + fn doc_attribute(&self) -> Option { + self.formatted_notation().map(|n| quote!(#[doc = #n])) } } @@ -335,6 +331,9 @@ impl ConstantExt for vkxml::ExtensionEnum { fn notation(&self) -> Option<&str> { self.notation.as_deref() } + fn is_deprecated(&self) -> bool { + todo!() + } } impl ConstantExt for vk_parse::Enum { @@ -352,6 +351,9 @@ impl ConstantExt for vk_parse::Enum { fn is_alias(&self) -> bool { matches!(self.spec, vk_parse::EnumSpec::Alias { .. }) } + fn is_deprecated(&self) -> bool { + self.deprecated.is_some() + } } impl ConstantExt for vkxml::Constant { @@ -364,6 +366,9 @@ impl ConstantExt for vkxml::Constant { fn notation(&self) -> Option<&str> { self.notation.as_deref() } + fn is_deprecated(&self) -> bool { + todo!() + } } #[derive(Clone, Debug)] @@ -927,6 +932,7 @@ fn generate_function_pointers<'a>( let params: Vec<_> = cmd .params .iter() + .filter(|param| matches!(param.api.as_deref(), None | Some(DESIRED_API))) .map(|param| { let name = param.param_ident(); let ty = param.type_tokens(true); @@ -1072,6 +1078,10 @@ impl<'a> ConstantExt for ExtensionConstant<'a> { fn notation(&self) -> Option<&str> { self.notation } + fn is_deprecated(&self) -> bool { + // We won't create this struct if the extension constant was deprecated + false + } } pub fn generate_extension_constants<'a>( @@ -1083,8 +1093,12 @@ pub fn generate_extension_constants<'a>( ) -> TokenStream { let items = extension_items .iter() - .filter_map(get_variant!(vk_parse::ExtensionChild::Require { items })) - .flatten(); + .filter_map(get_variant!(vk_parse::ExtensionChild::Require { + api, + items + })) + .filter(|(api, _items)| matches!(api.as_deref(), None | Some(DESIRED_API))) + .flat_map(|(_api, items)| items); let mut extended_enums = BTreeMap::>::new(); @@ -1094,7 +1108,11 @@ pub fn generate_extension_constants<'a>( continue; } - if enum_.comment.as_deref() == Some(BACKWARDS_COMPATIBLE_ALIAS_COMMENT) { + if !matches!(enum_.api.as_deref(), None | Some(DESIRED_API)) { + continue; + } + + if enum_.deprecated.is_some() { continue; } @@ -1154,8 +1172,12 @@ pub fn generate_extension_commands<'a>( let mut aliases = HashMap::new(); let names = items .iter() - .filter_map(get_variant!(vk_parse::ExtensionChild::Require { items })) - .flatten() + .filter_map(get_variant!(vk_parse::ExtensionChild::Require { + api, + items + })) + .filter(|(api, _items)| matches!(api.as_deref(), None | Some(DESIRED_API))) + .flat_map(|(_api, items)| items) .filter_map(get_variant!(vk_parse::InterfaceItem::Command { name })); for name in names { if let Some(cmd) = cmd_map.get(name).copied() { @@ -1235,6 +1257,7 @@ pub fn generate_extension<'a>( } pub fn generate_define( define: &vk_parse::Type, + allowed_types: &HashSet<&str>, identifier_renames: &mut BTreeMap, ) -> TokenStream { let vk_parse::TypeSpec::Code(spec) = &define.spec else { @@ -1243,6 +1266,11 @@ pub fn generate_define( let [vk_parse::TypeCodeMarkup::Name(define_name), ..] = &spec.markup[..] else { return quote!(); }; + + if !allowed_types.contains(define_name.as_str()) { + return quote!(); + } + let name = constant_name(define_name); let ident = format_ident!("{}", name); @@ -1256,7 +1284,14 @@ pub fn generate_define( let deprecated = comment .and_then(|c| c.trim().strip_prefix("DEPRECATED: ")) - .map(|comment| (quote!(#[deprecated = #comment]))); + .map(|comment| quote!(#[deprecated = #comment])) + .or_else(|| match define.deprecated.as_ref()?.as_str() { + "true" => Some(quote!(#[deprecated])), + "aliased" => { + Some(quote!(#[deprecated = "an old name not following Vulkan conventions"])) + } + x => panic!("Unknown deprecation reason {}", x), + }); let (code, ident) = if let Some(parameters) = parameters { let params = parameters @@ -1424,7 +1459,7 @@ pub fn bitflags_impl_block( ) -> TokenStream { let variants = constants .iter() - .filter(|constant| constant.notation() != Some(BACKWARDS_COMPATIBLE_ALIAS_COMMENT)) + .filter(|constant| !constant.is_deprecated()) .map(|constant| { let variant_ident = constant.variant_ident(enum_name); let notation = constant.doc_attribute(); @@ -1462,7 +1497,7 @@ pub fn generate_enum<'a>( .children .iter() .filter_map(get_variant!(vk_parse::EnumsChild::Enum)) - .filter(|constant| constant.notation() != Some(BACKWARDS_COMPATIBLE_ALIAS_COMMENT)) + .filter(|constant| !constant.is_deprecated()) .collect_vec(); let mut values = Vec::with_capacity(constants.len()); @@ -1576,18 +1611,14 @@ pub fn generate_result(ident: Ident, enum_: &vk_parse::Enums) -> TokenStream { } fn is_static_array(field: &vkxml::Field) -> bool { - field - .array - .as_ref() - .map(|ty| matches!(ty, vkxml::ArrayType::Static)) - .unwrap_or(false) + matches!(field.array, Some(vkxml::ArrayType::Static)) } -pub fn derive_default(struct_: &vkxml::Struct, has_lifetime: bool) -> Option { +pub fn derive_default( + struct_: &vkxml::Struct, + members: &[(&vkxml::Field, Option)], + has_lifetime: bool, +) -> Option { let name = name_to_tokens(&struct_.name); - let members = struct_ - .elements - .iter() - .filter_map(get_variant!(vkxml::StructElement::Member)); let is_structure_type = |field: &vkxml::Field| field.basetype == "VkStructureType"; // These are also pointers, and therefor also don't implement Default. The spec @@ -1605,13 +1636,18 @@ pub fn derive_default(struct_: &vkxml::Struct, has_lifetime: bool) -> Option Option Self { + #allow_deprecated Self { #( #default_fields, @@ -1659,15 +1696,12 @@ pub fn derive_default(struct_: &vkxml::Struct, has_lifetime: bool) -> Option)], union_types: &HashSet<&str>, has_lifetime: bool, ) -> Option { let name = name_to_tokens(&struct_.name); - let members = struct_ - .elements - .iter() - .filter_map(get_variant!(vkxml::StructElement::Member)); - let contains_pfn = members.clone().any(|field| { + let contains_pfn = members.iter().any(|(field, _)| { field .name .as_ref() @@ -1675,15 +1709,15 @@ pub fn derive_debug( .unwrap_or(false) }); let contains_static_array = members - .clone() - .any(|x| is_static_array(x) && x.basetype == "char"); + .iter() + .any(|(x, _)| is_static_array(x) && x.basetype == "char"); let contains_union = members - .clone() - .any(|field| union_types.contains(field.basetype.as_str())); + .iter() + .any(|(field, _)| union_types.contains(field.basetype.as_str())); if !(contains_union || contains_static_array || contains_pfn) { return None; } - let debug_fields = members.clone().map(|field| { + let debug_fields = members.iter().map(|(field, _)| { let param_ident = field.param_ident(); let param_str = param_ident.to_string(); let debug_value = if is_static_array(field) && field.basetype == "char" { @@ -1724,6 +1758,7 @@ pub fn derive_debug( pub fn derive_setters( struct_: &vkxml::Struct, + members: &[(&vkxml::Field, Option)], root_structs: &HashSet, has_lifetimes: &HashSet, ) -> Option { @@ -1737,18 +1772,13 @@ pub fn derive_setters( let name = name_to_tokens(&struct_.name); - let members = struct_ - .elements - .iter() - .filter_map(get_variant!(vkxml::StructElement::Member)); - let next_field = members - .clone() - .find(|field| field.param_ident() == "p_next"); + .iter() + .find(|(field, _)| field.param_ident() == "p_next"); let structure_type_field = members - .clone() - .find(|field| field.param_ident() == "s_type"); + .iter() + .find(|(field, _)| field.param_ident() == "s_type"); // Must either have both, or none: assert_eq!(next_field.is_some(), structure_type_field.is_some()); @@ -1759,8 +1789,8 @@ pub fn derive_setters( ("VkDescriptorSetLayoutBinding", "pImmutableSamplers"), ]; let filter_members: Vec = members - .clone() - .filter_map(|field| { + .iter() + .filter_map(|(field, _)| { let field_name = field.name.as_ref().unwrap(); // Associated _count members @@ -1781,7 +1811,8 @@ pub fn derive_setters( }) .collect(); - let setters = members.clone().filter_map(|field| { + let setters = members.iter().filter_map(|(field, deprecated)| { + let deprecated = deprecated.as_ref().map(|d| quote!(#d #[allow(deprecated)])); let param_ident = field.param_ident(); let param_ty_tokens = field.safe_type_tokens(quote!('a), None); @@ -1841,6 +1872,7 @@ pub fn derive_setters( assert_eq!(field.size, None); return Some(quote!{ #[inline] + #deprecated pub fn #param_ident_short(mut self, #param_ident_short: &'a ::std::ffi::CStr) -> Self { self.#param_ident = #param_ident_short.as_ptr(); self @@ -1887,7 +1919,7 @@ pub fn derive_setters( let array_size_ident = format_ident!("{}", array_size.to_snake_case()); - let size_field = members.clone().find(|m| m.name.as_deref() == Some(array_size)).unwrap(); + let size_field = members.iter().map(|(m, _)| m).find(|m| m.name.as_deref() == Some(array_size)).unwrap(); let cast = if size_field.basetype == "size_t" { quote!() @@ -1902,6 +1934,7 @@ pub fn derive_setters( return Some(quote! { #[inline] + #deprecated pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self { #set_size_stmt self.#param_ident = #param_ident_short #ptr; @@ -1915,6 +1948,7 @@ pub fn derive_setters( if field.basetype == "VkBool32" { return Some(quote!{ #[inline] + #deprecated pub fn #param_ident_short(mut self, #param_ident_short: bool) -> Self { self.#param_ident = #param_ident_short.into(); self @@ -1935,6 +1969,7 @@ pub fn derive_setters( Some(quote!{ #[inline] + #deprecated pub fn #param_ident_short(mut self, #param_ident_short: #param_ty_tokens #lifetime) -> Self { self.#param_ident = #param_ident_short; self @@ -1948,7 +1983,7 @@ pub fn derive_setters( let root_struct_next_field = next_field.filter(|_| root_structs.contains(&name)); // We only implement a next methods for root structs with a `pnext` field. - let next_function = if let Some(next_field) = root_struct_next_field { + let next_function = if let Some((next_field, _)) = root_struct_next_field { assert_eq!(next_field.basetype, "void"); let mutability = if next_field.is_const { quote!(const) @@ -2005,7 +2040,7 @@ pub fn derive_setters( quote!(unsafe impl #extends for #name<'_> {}) }); - let impl_structure_type_trait = structure_type_field.map(|s_type| { + let impl_structure_type_trait = structure_type_field.map(|(s_type, _)| { let value = s_type .type_enums .as_deref() @@ -2049,11 +2084,17 @@ pub fn manual_derives(struct_: &vkxml::Struct) -> TokenStream { } pub fn generate_struct( struct_: &vkxml::Struct, + vk_parse_types: &HashMap, root_structs: &HashSet, union_types: &HashSet<&str>, has_lifetimes: &HashSet, ) -> TokenStream { let name = name_to_tokens(&struct_.name); + let vk_parse_struct = vk_parse_types[&struct_.name]; + let vk_parse::TypeSpec::Members(vk_parse_members) = &vk_parse_struct.spec else { + panic!() + }; + if &struct_.name == "VkTransformMatrixKHR" { return quote! { #[repr(C)] @@ -2123,9 +2164,31 @@ pub fn generate_struct( let members = struct_ .elements .iter() - .filter_map(get_variant!(vkxml::StructElement::Member)); + .filter_map(get_variant!(vkxml::StructElement::Member)) + .zip( + vk_parse_members + .iter() + .filter_map(get_variant!(vk_parse::TypeMember::Definition)), + ) + .filter(|(_, vk_parse_field)| { + matches!(vk_parse_field.api.as_deref(), None | Some(DESIRED_API)) + }) + .map(|(field, vk_parse_field)| { + let deprecation = vk_parse_field + .deprecated + .as_ref() + .map(|deprecated| match deprecated.as_str() { + "true" => quote!(#[deprecated]), + "ignored" => { + quote!(#[deprecated = "functionality described by this member no longer operates"]) + } + x => panic!("Unknown deprecation reason {}", x), + }); + (field, deprecation) + }) + .collect::>(); - let params = members.clone().map(|field| { + let params = members.iter().map(|(field, deprecation)| { let param_ident = field.param_ident(); let param_ty_tokens = if field.basetype == struct_.name { let pointer = field @@ -2140,7 +2203,8 @@ pub fn generate_struct( let ty = field.type_tokens(false); quote!(#ty #lifetime) }; - quote! {pub #param_ident: #param_ty_tokens} + + quote!(#deprecation pub #param_ident: #param_ty_tokens) }); let has_lifetime = has_lifetimes.contains(&name); @@ -2149,9 +2213,9 @@ pub fn generate_struct( false => (quote!(), quote!()), }; - let debug_tokens = derive_debug(struct_, union_types, has_lifetime); - let default_tokens = derive_default(struct_, has_lifetime); - let setter_tokens = derive_setters(struct_, root_structs, has_lifetimes); + let debug_tokens = derive_debug(struct_, &members, union_types, has_lifetime); + let default_tokens = derive_default(struct_, &members, has_lifetime); + let setter_tokens = derive_setters(struct_, &members, root_structs, has_lifetimes); let manual_derive_tokens = manual_derives(struct_); let dbg_str = if debug_tokens.is_none() { quote!(#[cfg_attr(feature = "debug", derive(Debug))]) @@ -2257,49 +2321,90 @@ fn generate_union(union: &vkxml::Union, has_lifetimes: &HashSet) -> Token } } /// Root structs are all structs that are extended by other structs. -pub fn root_structs(definitions: &[&vkxml::DefinitionsElement]) -> HashSet { - let mut root_structs = HashSet::new(); +pub fn root_structs( + definitions: &[&vk_parse::Type], + allowed_types: &HashSet<&str>, +) -> HashSet { // Loop over all structs and collect their extends - for definition in definitions { - if let vkxml::DefinitionsElement::Struct(ref struct_) = definition { - if let Some(extends) = &struct_.extends { - root_structs.extend(extends.split(',').map(name_to_tokens)); - } - }; - } - root_structs + definitions + .iter() + .filter(|type_| { + type_ + .name + .as_ref() + .map_or(false, |name| allowed_types.contains(name.as_str())) + }) + .filter_map(|type_| type_.structextends.as_ref()) + .flat_map(|e| e.split(',')) + .map(name_to_tokens) + .collect() } pub fn generate_definition_vk_parse( definition: &vk_parse::Type, + allowed_types: &HashSet<&str>, identifier_renames: &mut BTreeMap, ) -> Option { + if let Some(api) = &definition.api { + if api != DESIRED_API { + return None; + } + } + match definition.category.as_deref() { - Some("define") => Some(generate_define(definition, identifier_renames)), + Some("define") => Some(generate_define( + definition, + allowed_types, + identifier_renames, + )), _ => None, } } +#[allow(clippy::too_many_arguments)] pub fn generate_definition( definition: &vkxml::DefinitionsElement, + allowed_types: &HashSet<&str>, union_types: &HashSet<&str>, root_structs: &HashSet, has_lifetimes: &HashSet, + vk_parse_types: &HashMap, bitflags_cache: &mut HashSet, const_values: &mut BTreeMap, ) -> Option { match *definition { - vkxml::DefinitionsElement::Typedef(ref typedef) => Some(generate_typedef(typedef)), - vkxml::DefinitionsElement::Struct(ref struct_) => Some(generate_struct( - struct_, - root_structs, - union_types, - has_lifetimes, - )), - vkxml::DefinitionsElement::Bitmask(ref mask) => { + vkxml::DefinitionsElement::Typedef(ref typedef) + if allowed_types.contains(typedef.name.as_str()) => + { + Some(generate_typedef(typedef)) + } + vkxml::DefinitionsElement::Struct(ref struct_) + if allowed_types.contains(struct_.name.as_str()) => + { + Some(generate_struct( + struct_, + vk_parse_types, + root_structs, + union_types, + has_lifetimes, + )) + } + vkxml::DefinitionsElement::Bitmask(ref mask) + if allowed_types.contains(mask.name.as_str()) => + { generate_bitmask(mask, bitflags_cache, const_values) } - vkxml::DefinitionsElement::Handle(ref handle) => generate_handle(handle), - vkxml::DefinitionsElement::FuncPtr(ref fp) => Some(generate_funcptr(fp)), - vkxml::DefinitionsElement::Union(ref union) => Some(generate_union(union, has_lifetimes)), + vkxml::DefinitionsElement::Handle(ref handle) + if allowed_types.contains(handle.name.as_str()) => + { + generate_handle(handle) + } + vkxml::DefinitionsElement::FuncPtr(ref fp) if allowed_types.contains(fp.name.as_str()) => { + Some(generate_funcptr(fp)) + } + vkxml::DefinitionsElement::Union(ref union) + if allowed_types.contains(union.name.as_str()) => + { + Some(generate_union(union, has_lifetimes)) + } _ => None, } } @@ -2308,6 +2413,10 @@ pub fn generate_feature<'a>( commands: &CommandMap<'a>, fn_cache: &mut HashSet<&'a str>, ) -> TokenStream { + if !contains_desired_api(&feature.api) { + return quote!(); + } + let (static_commands, entry_commands, device_commands, instance_commands) = feature .elements .iter() @@ -2399,6 +2508,7 @@ pub fn generate_feature_extension<'a>( .0 .iter() .filter_map(get_variant!(vk_parse::RegistryChild::Feature)) + .filter(|feature| contains_desired_api(&feature.api)) .map(|feature| { generate_extension_constants( &feature.name, @@ -2551,6 +2661,7 @@ pub fn extract_native_types(registry: &vk_parse::Registry) -> (Vec<(String, Stri } pub fn generate_aliases_of_types( types: &vk_parse::Types, + allowed_types: &HashSet<&str>, has_lifetimes: &HashSet, ty_cache: &mut HashSet, ) -> TokenStream { @@ -2560,6 +2671,9 @@ pub fn generate_aliases_of_types( .filter_map(get_variant!(vk_parse::TypesChild::Type)) .filter_map(|ty| { let name = ty.name.as_ref()?; + if !allowed_types.contains(name.as_str()) { + return None; + } let alias = ty.alias.as_ref()?; let name_ident = name_to_tokens(name); if !ty_cache.insert(name_ident.clone()) { @@ -2582,31 +2696,27 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { use std::fs::File; use std::io::Write; let (spec2, _errors) = vk_parse::parse_file(&vk_xml).expect("Invalid xml file"); - let extensions: &Vec = spec2 + let extensions: Vec<&vk_parse::Extension> = spec2 .0 .iter() .find_map(get_variant!(vk_parse::RegistryChild::Extensions)) - .map(|ext| &ext.children) - .expect("extension"); + .expect("extension") + .children + .iter() + .filter(|e| { + if let Some(supported) = &e.supported { + contains_desired_api(supported) || + // VK_ANDROID_native_buffer is for internal use only, but types defined elsewhere + // reference enum extension constants. Exempt the extension from this check until + // types are properly folded in with their extension (where applicable). + e.name == "VK_ANDROID_native_buffer" + } else { + true + } + }) + .collect(); let spec = vk_parse::parse_file_as_vkxml(&vk_xml).expect("Invalid xml file."); - let cmd_aliases: HashMap = spec2 - .0 - .iter() - .filter_map(get_variant!(vk_parse::RegistryChild::Commands)) - .flat_map(|cmds| &cmds.children) - .filter_map(get_variant!(vk_parse::Command::Alias { name, alias })) - .map(|(name, alias)| (name.to_string(), alias.to_string())) - .collect(); - - let commands: CommandMap<'_> = spec2 - .0 - .iter() - .filter_map(get_variant!(vk_parse::RegistryChild::Commands)) - .flat_map(|cmds| &cmds.children) - .filter_map(get_variant!(vk_parse::Command::Definition)) - .map(|cmd| (cmd.proto.name.clone(), cmd)) - .collect(); let features: Vec<&vkxml::Feature> = spec .elements @@ -2629,6 +2739,53 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { .flat_map(|constants| &constants.elements) .collect(); + let features_children = spec2 + .0 + .iter() + .filter_map(get_variant!(vk_parse::RegistryChild::Feature)) + .filter(|feature| contains_desired_api(&feature.api)) + .flat_map(|features| &features.children); + + let extension_children = extensions.iter().flat_map(|extension| &extension.children); + + let (required_types, required_commands) = features_children + .chain(extension_children) + .filter_map(get_variant!(vk_parse::FeatureChild::Require { api, items })) + .filter(|(api, _items)| matches!(api.as_deref(), None | Some(DESIRED_API))) + .flat_map(|(_api, items)| items) + .fold((HashSet::new(), HashSet::new()), |mut acc, elem| { + match elem { + vk_parse::InterfaceItem::Type { name, .. } => { + acc.0.insert(name.as_str()); + } + vk_parse::InterfaceItem::Command { name, .. } => { + acc.1.insert(name.as_str()); + } + _ => {} + }; + acc + }); + + let commands: CommandMap<'_> = spec2 + .0 + .iter() + .filter_map(get_variant!(vk_parse::RegistryChild::Commands)) + .flat_map(|cmds| &cmds.children) + .filter_map(get_variant!(vk_parse::Command::Definition)) + .filter(|cmd| required_commands.contains(&cmd.proto.name.as_str())) + .map(|cmd| (cmd.proto.name.clone(), cmd)) + .collect(); + + let cmd_aliases: HashMap = spec2 + .0 + .iter() + .filter_map(get_variant!(vk_parse::RegistryChild::Commands)) + .flat_map(|cmds| &cmds.children) + .filter_map(get_variant!(vk_parse::Command::Alias { name, alias })) + .filter(|(name, _alias)| required_commands.contains(name.as_str())) + .map(|(name, alias)| (name.to_string(), alias.to_string())) + .collect(); + let mut fn_cache = HashSet::new(); let mut bitflags_cache = HashSet::new(); let mut const_cache = HashSet::new(); @@ -2640,6 +2797,11 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { .iter() .filter_map(get_variant!(vk_parse::RegistryChild::Enums)) .filter(|enums| enums.kind.is_some()) + .filter(|enums| { + enums.name.as_ref().map_or(true, |n| { + required_types.contains(n.replace("FlagBits", "Flags").as_str()) + }) + }) .map(|e| generate_enum(e, &mut const_cache, &mut const_values, &mut bitflags_cache)) .fold((Vec::new(), Vec::new()), |mut acc, elem| { match elem { @@ -2658,16 +2820,6 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { let extension_code = extensions .iter() - .filter(|e| { - // Note that there will be multiple Vulkan API variants in the future, communicated - // through the supported= attribute: - // https://github.com/KhronosGroup/Vulkan-Docs/issues/1549#issuecomment-855831740 - e.supported.as_deref() != Some("disabled") || - // VK_ANDROID_native_buffer is for internal use only, but types defined elsewhere - // reference enum extension constants. Exempt the extension from this check until - // types are properly folded in with their extension (where applicable). - e.name == "VK_ANDROID_native_buffer" - }) .filter_map(|ext| { generate_extension( ext, @@ -2718,7 +2870,7 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { _ => continue, }; } - let vk_parse_definitions: Vec<_> = spec2 + let vk_parse_types = spec2 .0 .iter() .filter_map(get_variant!(vk_parse::RegistryChild::Types)) @@ -2727,18 +2879,30 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { .iter() .filter_map(get_variant!(vk_parse::TypesChild::Type)) }) - .filter_map(|def| generate_definition_vk_parse(def, &mut identifier_renames)) + .collect::>(); + let vk_parse_definitions: Vec<_> = vk_parse_types + .iter() + .filter_map(|def| { + generate_definition_vk_parse(def, &required_types, &mut identifier_renames) + }) .collect(); - let root_structs = root_structs(&definitions); + let root_structs = root_structs(&vk_parse_types, &required_types); + + let vk_parse_types = vk_parse_types + .into_iter() + .filter_map(|t| t.name.clone().map(|n| (n, t))) + .collect::>(); let definition_code: Vec<_> = vk_parse_definitions .into_iter() .chain(definitions.into_iter().filter_map(|def| { generate_definition( def, + &required_types, &union_types, &root_structs, &has_lifetimes, + &vk_parse_types, &mut bitflags_cache, &mut const_values, ) @@ -2750,7 +2914,7 @@ pub fn write_source_code>(vk_headers_dir: &Path, src_dir: P) { .0 .iter() .filter_map(get_variant!(vk_parse::RegistryChild::Types)) - .map(|ty| generate_aliases_of_types(ty, &has_lifetimes, &mut ty_cache)) + .map(|ty| generate_aliases_of_types(ty, &required_types, &has_lifetimes, &mut ty_cache)) .collect(); let feature_code: Vec<_> = features