Update Vulkan-Headers to 1.3.244 (#697)

* Update Vulkan-Headers to 1.3.239

* Update Vulkan-Headers to 1.3.240

* Upgrade to `bindgen 0.63` and `vk-parse 0.9`

Updates cause no semantic changes in usage nor generated output.

* generator: Support new `deprecated` attribute

* Update Vulkan-Headers to 1.3.241

* generator: Emit `#[deprecated]` annotation for type members (struct fields)

* Update Vulkan-Headers to 1.3.242

* Update Vulkan-Headers to 1.3.243

* Update Vulkan-Headers to 1.3.244
This commit is contained in:
Marijn Suijten 2023-03-21 07:19:17 +01:00 committed by GitHub
parent 61b7415156
commit a9fbc7147b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1689 additions and 797 deletions

View file

@ -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)

View file

@ -1,6 +1,6 @@
[package]
name = "ash"
version = "0.37.0+1.3.238"
version = "0.37.0+1.3.244"
authors = [
"Maik Klein <maikklein@googlemail.com>",
"Benjamin Saunders <ben.e.saunders@gmail.com>",

View file

@ -1280,13 +1280,23 @@ impl VideoEncodeCapabilityFlagsKHR {
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeFeedbackFlagBitsKHR.html>"]
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 = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeRateControlModeFlagBitsKHR.html>"]
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 = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeH264InputModeFlagBitsEXT.html>"]
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 = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeH264OutputModeFlagBitsEXT.html>"]
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 = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeH265InputModeFlagBitsEXT.html>"]
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 = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkVideoEncodeH265OutputModeFlagBitsEXT.html>"]
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)]

View file

@ -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"),
];

View file

@ -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;

File diff suppressed because it is too large Load diff

View file

@ -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"),

View file

@ -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<F>(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<F>(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<F>(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<F>(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<F>(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<F>(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<F>(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);
}

View file

@ -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::<StdVideoEncodeH264RefMgmtFlags>(),
::std::mem::size_of::<StdVideoEncodeH264ReferenceListsInfoFlags>(),
4usize,
concat!("Size of: ", stringify!(StdVideoEncodeH264RefMgmtFlags))
concat!(
"Size of: ",
stringify!(StdVideoEncodeH264ReferenceListsInfoFlags)
)
);
assert_eq!(
::std::mem::align_of::<StdVideoEncodeH264RefMgmtFlags>(),
::std::mem::align_of::<StdVideoEncodeH264ReferenceListsInfoFlags>(),
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<StdVideoEncodeH264RefMemMgmtCtrlOperations> =
fn bindgen_test_layout_StdVideoEncodeH264ReferenceListsInfo() {
const UNINIT: ::std::mem::MaybeUninit<StdVideoEncodeH264ReferenceListsInfo> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<StdVideoEncodeH264RefMemMgmtCtrlOperations>(),
48usize,
::std::mem::size_of::<StdVideoEncodeH264ReferenceListsInfo>(),
56usize,
concat!(
"Size of: ",
stringify!(StdVideoEncodeH264RefMemMgmtCtrlOperations)
stringify!(StdVideoEncodeH264ReferenceListsInfo)
)
);
assert_eq!(
::std::mem::align_of::<StdVideoEncodeH264RefMemMgmtCtrlOperations>(),
::std::mem::align_of::<StdVideoEncodeH264ReferenceListsInfo>(),
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::<StdVideoEncodeH264ReferenceInfo>(),
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::<StdVideoEncodeH265ReferenceModificationFlags>(),
::std::mem::size_of::<StdVideoEncodeH265ReferenceListsInfoFlags>(),
4usize,
concat!(
"Size of: ",
stringify!(StdVideoEncodeH265ReferenceModificationFlags)
stringify!(StdVideoEncodeH265ReferenceListsInfoFlags)
)
);
assert_eq!(
::std::mem::align_of::<StdVideoEncodeH265ReferenceModificationFlags>(),
::std::mem::align_of::<StdVideoEncodeH265ReferenceListsInfoFlags>(),
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<StdVideoEncodeH265ReferenceModifications> =
fn bindgen_test_layout_StdVideoEncodeH265ReferenceListsInfo() {
const UNINIT: ::std::mem::MaybeUninit<StdVideoEncodeH265ReferenceListsInfo> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<StdVideoEncodeH265ReferenceModifications>(),
32usize,
::std::mem::size_of::<StdVideoEncodeH265ReferenceListsInfo>(),
40usize,
concat!(
"Size of: ",
stringify!(StdVideoEncodeH265ReferenceModifications)
stringify!(StdVideoEncodeH265ReferenceListsInfo)
)
);
assert_eq!(
::std::mem::align_of::<StdVideoEncodeH265ReferenceModifications>(),
::std::mem::align_of::<StdVideoEncodeH265ReferenceListsInfo>(),
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::<StdVideoEncodeH265PictureInfo>(),
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::<StdVideoEncodeH265ReferenceInfo>(),
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),

View file

@ -5,7 +5,7 @@ authors = ["Maik Klein <maikklein@googlemail.com>"]
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]

@ -1 +1 @@
Subproject commit 00671c64ba5c488ade22ad572a0ef81d5e64c803
Subproject commit fa204df59c6caea6b9be3cf0754a88cd89056a87

View file

@ -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<TokenStream> {
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::<String, Vec<ExtensionConstant>>::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<String, Ident>,
) -> 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<TokenStream> {
pub fn derive_default(
struct_: &vkxml::Struct,
members: &[(&vkxml::Field, Option<TokenStream>)],
has_lifetime: bool,
) -> Option<TokenStream> {
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<Tok
"MTLSharedEvent_id",
"MTLTexture_id",
];
let contains_ptr = members.clone().any(|field| field.reference.is_some());
let contains_structure_type = members.clone().any(is_structure_type);
let contains_static_array = members.clone().any(is_static_array);
let contains_ptr = members
.iter()
.cloned()
.any(|(field, _)| field.reference.is_some());
let contains_structure_type = members.iter().map(|(f, _)| *f).any(is_structure_type);
let contains_static_array = members.iter().map(|(f, _)| *f).any(is_static_array);
let contains_deprecated = members.iter().any(|(_, d)| d.is_some());
let allow_deprecated = contains_deprecated.then(|| quote!(#[allow(deprecated)]));
if !(contains_ptr || contains_structure_type || contains_static_array) {
return None;
};
let default_fields = members.clone().map(|field| {
let default_fields = members.iter().map(|(field, _)| {
let param_ident = field.param_ident();
if is_structure_type(field) {
if field.type_enums.is_some() {
@ -1646,6 +1682,7 @@ pub fn derive_default(struct_: &vkxml::Struct, has_lifetime: bool) -> Option<Tok
impl ::std::default::Default for #name #lifetime {
#[inline]
fn default() -> Self {
#allow_deprecated
Self {
#(
#default_fields,
@ -1659,15 +1696,12 @@ pub fn derive_default(struct_: &vkxml::Struct, has_lifetime: bool) -> Option<Tok
}
pub fn derive_debug(
struct_: &vkxml::Struct,
members: &[(&vkxml::Field, Option<TokenStream>)],
union_types: &HashSet<&str>,
has_lifetime: bool,
) -> Option<TokenStream> {
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<TokenStream>)],
root_structs: &HashSet<Ident>,
has_lifetimes: &HashSet<Ident>,
) -> Option<TokenStream> {
@ -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<String> = 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<String, &vk_parse::Type>,
root_structs: &HashSet<Ident>,
union_types: &HashSet<&str>,
has_lifetimes: &HashSet<Ident>,
) -> 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::<Vec<_>>();
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<Ident>) -> Token
}
}
/// Root structs are all structs that are extended by other structs.
pub fn root_structs(definitions: &[&vkxml::DefinitionsElement]) -> HashSet<Ident> {
let mut root_structs = HashSet::new();
pub fn root_structs(
definitions: &[&vk_parse::Type],
allowed_types: &HashSet<&str>,
) -> HashSet<Ident> {
// 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<String, Ident>,
) -> Option<TokenStream> {
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<Ident>,
has_lifetimes: &HashSet<Ident>,
vk_parse_types: &HashMap<String, &vk_parse::Type>,
bitflags_cache: &mut HashSet<Ident>,
const_values: &mut BTreeMap<Ident, ConstantTypeInfo>,
) -> Option<TokenStream> {
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<Ident>,
ty_cache: &mut HashSet<Ident>,
) -> 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<P: AsRef<Path>>(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<vk_parse::Extension> = 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<String, String> = 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<P: AsRef<Path>>(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<String, String> = 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<P: AsRef<Path>>(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<P: AsRef<Path>>(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<P: AsRef<Path>>(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<P: AsRef<Path>>(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::<Vec<_>>();
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::<HashMap<_, _>>();
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<P: AsRef<Path>>(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