Update Vulkan-Headers to 1.2.191; drop Video enum-variant edgecases (#463)

* Update Vulkan-Headers to 1.2.187; drop Video enum-variant edgecases

* Update Vulkan-Headers to 1.2.188

* generator: Improve support for pointers to static-sized arrays

Vulkan 1.2.188 removed the only occurence of `ename:`, which was our
heuristic to find a type that's a pointer to a static-sized array.  It
is now replaced with a "normal" `latexmath:` expression, but should
still be dealt with appropriately.

Note that all `latexmath:` conditions have been removed, as these fields
should not be silently omitted.  As of this Vulkan version only 3 exist,
and all have their own edge-case.

* Revert "Remove upstream-fixed vk_platform.h header path fallback"

This reverts commit 43dee26ec04dfd3871da8a11b624eaf9fbd16f3a.

Upstream is reverting back to inconsistent paths in [this commit] to
counter unintentional header `#include` changes on the C-side:
https://github.com/KhronosGroup/Vulkan-Docs/issues/1573

[this commit]: 8bde11cbd7

* generator: Remove unnecessary `-Iinclude/vulkan` directory

Every `#include` path (except `"vk_platform.h"`, see previous commit) is
relative to the `include/` directory or the current file, and does not
look for a path relative to `include/vulkan/`.

* Update Vulkan-Headers to 1.2.189

* Update Vulkan-Headers to 1.2.190

* Update Vulkan-Headers to 1.2.191
This commit is contained in:
Marijn Suijten 2021-09-08 11:26:58 +02:00 committed by GitHub
parent 56bbf839a4
commit 19c5d453a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 846 additions and 171 deletions

View file

@ -256,6 +256,12 @@ impl FenceCreateFlags {
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreCreateFlagBits.html>"]
pub struct SemaphoreCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SemaphoreCreateFlags, 0b0, Flags);
impl SemaphoreCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFormatFeatureFlagBits.html>"]
pub struct FormatFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(FormatFeatureFlags, 0b1_1111_1111_1111, Flags);
@ -857,9 +863,10 @@ pub struct GeometryInstanceFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(GeometryInstanceFlagsKHR, 0b1111, Flags);
impl GeometryInstanceFlagsKHR {
pub const TRIANGLE_FACING_CULL_DISABLE: Self = Self(0b1);
pub const TRIANGLE_FRONT_COUNTERCLOCKWISE: Self = Self(0b10);
pub const TRIANGLE_FLIP_FACING: Self = Self(0b10);
pub const FORCE_OPAQUE: Self = Self(0b100);
pub const FORCE_NO_OPAQUE: Self = Self(0b1000);
pub const TRIANGLE_FRONT_COUNTERCLOCKWISE: Self = Self::TRIANGLE_FLIP_FACING;
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -1085,10 +1092,10 @@ impl VideoComponentBitDepthFlagsKHR {
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCapabilitiesFlagBitsKHR.html>"]
pub struct VideoCapabilitiesFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(VideoCapabilitiesFlagsKHR, 0b11, Flags);
impl VideoCapabilitiesFlagsKHR {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCapabilityFlagBitsKHR.html>"]
pub struct VideoCapabilityFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(VideoCapabilityFlagsKHR, 0b11, Flags);
impl VideoCapabilityFlagsKHR {
pub const PROTECTED_CONTENT: Self = Self(0b1);
pub const SEPARATE_REFERENCE_IMAGES: Self = Self(0b10);
}
@ -1107,20 +1114,19 @@ impl VideoSessionCreateFlagsKHR {
pub struct VideoCodingQualityPresetFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(VideoCodingQualityPresetFlagsKHR, 0b111, Flags);
impl VideoCodingQualityPresetFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const NORMAL: Self = Self(0b1);
pub const POWER: Self = Self(0b10);
pub const QUALITY: Self = Self(0b100);
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH264FieldLayoutFlagBitsEXT.html>"]
pub struct VideoDecodeH264FieldLayoutFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoDecodeH264FieldLayoutFlagsEXT, 0b11, Flags);
impl VideoDecodeH264FieldLayoutFlagsEXT {
pub const PROGRESSIVE_PICTURES_ONLY: Self = Self(0);
pub const LINE_INTERLACED_PLANE: Self = Self(0b1);
pub const SEPARATE_INTERLACED_PLANE: Self = Self(0b10);
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH264PictureLayoutFlagBitsEXT.html>"]
pub struct VideoDecodeH264PictureLayoutFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoDecodeH264PictureLayoutFlagsEXT, 0b11, Flags);
impl VideoDecodeH264PictureLayoutFlagsEXT {
pub const PROGRESSIVE: Self = Self(0);
pub const INTERLACED_INTERLEAVED_LINES: Self = Self(0b1);
pub const INTERLACED_SEPARATE_PLANES: Self = Self(0b10);
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -1170,10 +1176,10 @@ impl VideoEncodeRateControlModeFlagsKHR {
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264CapabilitiesFlagBitsEXT.html>"]
pub struct VideoEncodeH264CapabilitiesFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH264CapabilitiesFlagsEXT, 0b111_1111_1111, Flags);
impl VideoEncodeH264CapabilitiesFlagsEXT {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264CapabilityFlagBitsEXT.html>"]
pub struct VideoEncodeH264CapabilityFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH264CapabilityFlagsEXT, 0b111_1111_1111, Flags);
impl VideoEncodeH264CapabilityFlagsEXT {
pub const CABAC: Self = Self(0b1);
pub const CAVLC: Self = Self(0b10);
pub const WEIGHTED_BI_PRED_IMPLICIT: Self = Self(0b100);

View file

@ -353,6 +353,7 @@ impl fmt::Debug for AttachmentLoadOp {
Self::LOAD => Some("LOAD"),
Self::CLEAR => Some("CLEAR"),
Self::DONT_CARE => Some("DONT_CARE"),
Self::NONE_EXT => Some("NONE_EXT"),
_ => None,
};
if let Some(x) = name {
@ -367,7 +368,7 @@ impl fmt::Debug for AttachmentStoreOp {
let name = match *self {
Self::STORE => Some("STORE"),
Self::DONT_CARE => Some("DONT_CARE"),
Self::NONE_QCOM => Some("NONE_QCOM"),
Self::NONE_EXT => Some("NONE_EXT"),
_ => None,
};
if let Some(x) = name {
@ -1324,6 +1325,7 @@ impl fmt::Debug for DriverId {
Self::MOLTENVK => Some("MOLTENVK"),
Self::COREAVI_PROPRIETARY => Some("COREAVI_PROPRIETARY"),
Self::JUICE_PROPRIETARY => Some("JUICE_PROPRIETARY"),
Self::VERISILICON_PROPRIETARY => Some("VERISILICON_PROPRIETARY"),
_ => None,
};
if let Some(x) = name {
@ -2031,8 +2033,8 @@ impl fmt::Debug for GeometryInstanceFlagsKHR {
"TRIANGLE_FACING_CULL_DISABLE",
),
(
GeometryInstanceFlagsKHR::TRIANGLE_FRONT_COUNTERCLOCKWISE.0,
"TRIANGLE_FRONT_COUNTERCLOCKWISE",
GeometryInstanceFlagsKHR::TRIANGLE_FLIP_FACING.0,
"TRIANGLE_FLIP_FACING",
),
(GeometryInstanceFlagsKHR::FORCE_OPAQUE.0, "FORCE_OPAQUE"),
(
@ -3572,6 +3574,7 @@ impl fmt::Debug for SamplerCreateFlags {
SamplerCreateFlags::SUBSAMPLED_COARSE_RECONSTRUCTION_EXT.0,
"SUBSAMPLED_COARSE_RECONSTRUCTION_EXT",
),
(SamplerCreateFlags::RESERVED_2_EXT.0, "RESERVED_2_EXT"),
];
debug_flags(f, KNOWN, self.0)
}
@ -4684,6 +4687,12 @@ impl fmt::Debug for StructureType {
Self::COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV => {
Some("COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV")
}
Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR => {
Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR")
}
Self::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR => {
Some("PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR")
}
Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT")
}
@ -4829,6 +4838,9 @@ impl fmt::Debug for StructureType {
Some("VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT")
}
Self::PHYSICAL_DEVICE_DRM_PROPERTIES_EXT => Some("PHYSICAL_DEVICE_DRM_PROPERTIES_EXT"),
Self::PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT")
}
Self::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA")
}
@ -4882,6 +4894,9 @@ impl fmt::Debug for StructureType {
Self::PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT => {
Some("PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT")
}
Self::PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT")
}
Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => {
Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES")
}
@ -5419,15 +5434,15 @@ impl fmt::Debug for VideoBeginCodingFlagsKHR {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoCapabilitiesFlagsKHR {
impl fmt::Debug for VideoCapabilityFlagsKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
VideoCapabilitiesFlagsKHR::PROTECTED_CONTENT.0,
VideoCapabilityFlagsKHR::PROTECTED_CONTENT.0,
"PROTECTED_CONTENT",
),
(
VideoCapabilitiesFlagsKHR::SEPARATE_REFERENCE_IMAGES.0,
VideoCapabilityFlagsKHR::SEPARATE_REFERENCE_IMAGES.0,
"SEPARATE_REFERENCE_IMAGES",
),
];
@ -5478,7 +5493,6 @@ impl fmt::Debug for VideoCodingControlFlagsKHR {
impl fmt::Debug for VideoCodingQualityPresetFlagsKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(VideoCodingQualityPresetFlagsKHR::DEFAULT.0, "DEFAULT"),
(VideoCodingQualityPresetFlagsKHR::NORMAL.0, "NORMAL"),
(VideoCodingQualityPresetFlagsKHR::POWER.0, "POWER"),
(VideoCodingQualityPresetFlagsKHR::QUALITY.0, "QUALITY"),
@ -5512,20 +5526,20 @@ impl fmt::Debug for VideoDecodeH264CreateFlagsEXT {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoDecodeH264FieldLayoutFlagsEXT {
impl fmt::Debug for VideoDecodeH264PictureLayoutFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
VideoDecodeH264FieldLayoutFlagsEXT::PROGRESSIVE_PICTURES_ONLY.0,
"PROGRESSIVE_PICTURES_ONLY",
VideoDecodeH264PictureLayoutFlagsEXT::PROGRESSIVE.0,
"PROGRESSIVE",
),
(
VideoDecodeH264FieldLayoutFlagsEXT::LINE_INTERLACED_PLANE.0,
"LINE_INTERLACED_PLANE",
VideoDecodeH264PictureLayoutFlagsEXT::INTERLACED_INTERLEAVED_LINES.0,
"INTERLACED_INTERLEAVED_LINES",
),
(
VideoDecodeH264FieldLayoutFlagsEXT::SEPARATE_INTERLACED_PLANE.0,
"SEPARATE_INTERLACED_PLANE",
VideoDecodeH264PictureLayoutFlagsEXT::INTERLACED_SEPARATE_PLANES.0,
"INTERLACED_SEPARATE_PLANES",
),
];
debug_flags(f, KNOWN, self.0)
@ -5546,45 +5560,45 @@ impl fmt::Debug for VideoEncodeFlagsKHR {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH264CapabilitiesFlagsEXT {
impl fmt::Debug for VideoEncodeH264CapabilityFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(VideoEncodeH264CapabilitiesFlagsEXT::CABAC.0, "CABAC"),
(VideoEncodeH264CapabilitiesFlagsEXT::CAVLC.0, "CAVLC"),
(VideoEncodeH264CapabilityFlagsEXT::CABAC.0, "CABAC"),
(VideoEncodeH264CapabilityFlagsEXT::CAVLC.0, "CAVLC"),
(
VideoEncodeH264CapabilitiesFlagsEXT::WEIGHTED_BI_PRED_IMPLICIT.0,
VideoEncodeH264CapabilityFlagsEXT::WEIGHTED_BI_PRED_IMPLICIT.0,
"WEIGHTED_BI_PRED_IMPLICIT",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::TRANSFORM_8X8.0,
VideoEncodeH264CapabilityFlagsEXT::TRANSFORM_8X8.0,
"TRANSFORM_8X8",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::CHROMA_QP_OFFSET.0,
VideoEncodeH264CapabilityFlagsEXT::CHROMA_QP_OFFSET.0,
"CHROMA_QP_OFFSET",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::SECOND_CHROMA_QP_OFFSET.0,
VideoEncodeH264CapabilityFlagsEXT::SECOND_CHROMA_QP_OFFSET.0,
"SECOND_CHROMA_QP_OFFSET",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_DISABLED.0,
VideoEncodeH264CapabilityFlagsEXT::DEBLOCKING_FILTER_DISABLED.0,
"DEBLOCKING_FILTER_DISABLED",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_ENABLED.0,
VideoEncodeH264CapabilityFlagsEXT::DEBLOCKING_FILTER_ENABLED.0,
"DEBLOCKING_FILTER_ENABLED",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_PARTIAL.0,
VideoEncodeH264CapabilityFlagsEXT::DEBLOCKING_FILTER_PARTIAL.0,
"DEBLOCKING_FILTER_PARTIAL",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::MULTIPLE_SLICE_PER_FRAME.0,
VideoEncodeH264CapabilityFlagsEXT::MULTIPLE_SLICE_PER_FRAME.0,
"MULTIPLE_SLICE_PER_FRAME",
),
(
VideoEncodeH264CapabilitiesFlagsEXT::EVENLY_DISTRIBUTED_SLICE_SIZE.0,
VideoEncodeH264CapabilityFlagsEXT::EVENLY_DISTRIBUTED_SLICE_SIZE.0,
"EVENLY_DISTRIBUTED_SLICE_SIZE",
),
];

View file

@ -53,7 +53,7 @@ pub const API_VERSION_1_0: u32 = make_api_version(0, 1, 0, 0);
pub const API_VERSION_1_1: u32 = make_api_version(0, 1, 1, 0);
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_1_2.html>"]
pub const API_VERSION_1_2: u32 = make_api_version(0, 1, 2, 0);
pub const HEADER_VERSION: u32 = 186u32;
pub const HEADER_VERSION: u32 = 191u32;
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_HEADER_VERSION_COMPLETE.html>"]
pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 2, HEADER_VERSION);
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampleMask.html>"]
@ -135,11 +135,6 @@ pub struct DeviceCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DeviceCreateFlags, 0b0, Flags);
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreCreateFlags.html>"]
pub struct SemaphoreCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SemaphoreCreateFlags, 0b0, Flags);
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryMapFlags.html>"]
pub struct MemoryMapFlags(pub(crate) Flags);
vk_bitflags_wrapped!(MemoryMapFlags, 0b0, Flags);
@ -34259,6 +34254,69 @@ impl<'a> MemoryPriorityAllocateInfoEXTBuilder<'a> {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.html>"]
pub struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub pageable_device_local_memory: Bool32,
}
impl ::std::default::Default for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
fn default() -> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
s_type: StructureType::PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT,
p_next: ::std::ptr::null_mut(),
pageable_device_local_memory: Bool32::default(),
}
}
}
impl PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
pub fn builder<'a>() -> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> {
PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder {
inner: PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> {
inner: PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT,
marker: ::std::marker::PhantomData<&'a ()>,
}
unsafe impl ExtendsPhysicalDeviceFeatures2
for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'_>
{
}
unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {}
unsafe impl ExtendsDeviceCreateInfo
for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'_>
{
}
unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {}
impl<'a> ::std::ops::Deref for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> {
type Target = PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXTBuilder<'a> {
pub fn pageable_device_local_memory(mut self, pageable_device_local_memory: bool) -> Self {
self.inner.pageable_device_local_memory = pageable_device_local_memory.into();
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
#[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
#[doc = r" so references to builders can be passed directly to Vulkan functions."]
pub fn build(self) -> PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceBufferDeviceAddressFeatures.html>"]
pub struct PhysicalDeviceBufferDeviceAddressFeatures {
pub s_type: StructureType,
@ -37463,6 +37521,85 @@ impl<'a> AttachmentReferenceStencilLayoutBuilder<'a> {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.html>"]
pub struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub primitive_topology_list_restart: Bool32,
pub primitive_topology_patch_list_restart: Bool32,
}
impl ::std::default::Default for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
fn default() -> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
s_type: StructureType::PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT,
p_next: ::std::ptr::null_mut(),
primitive_topology_list_restart: Bool32::default(),
primitive_topology_patch_list_restart: Bool32::default(),
}
}
}
impl PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
pub fn builder<'a>() -> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> {
PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder {
inner: PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> {
inner: PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT,
marker: ::std::marker::PhantomData<&'a ()>,
}
unsafe impl ExtendsPhysicalDeviceFeatures2
for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'_>
{
}
unsafe impl ExtendsPhysicalDeviceFeatures2
for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT
{
}
unsafe impl ExtendsDeviceCreateInfo
for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'_>
{
}
unsafe impl ExtendsDeviceCreateInfo for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {}
impl<'a> ::std::ops::Deref for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> {
type Target = PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXTBuilder<'a> {
pub fn primitive_topology_list_restart(
mut self,
primitive_topology_list_restart: bool,
) -> Self {
self.inner.primitive_topology_list_restart = primitive_topology_list_restart.into();
self
}
pub fn primitive_topology_patch_list_restart(
mut self,
primitive_topology_patch_list_restart: bool,
) -> Self {
self.inner.primitive_topology_patch_list_restart =
primitive_topology_patch_list_restart.into();
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
#[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
#[doc = r" so references to builders can be passed directly to Vulkan functions."]
pub fn build(self) -> PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAttachmentDescriptionStencilLayout.html>"]
pub struct AttachmentDescriptionStencilLayout {
pub s_type: StructureType,
@ -41623,7 +41760,7 @@ impl<'a> AccelerationStructureDeviceAddressInfoKHRBuilder<'a> {
pub struct AccelerationStructureVersionInfoKHR {
pub s_type: StructureType,
pub p_next: *const c_void,
pub p_version_data: *const u8,
pub p_version_data: *const [u8; 2 * UUID_SIZE],
}
impl ::std::default::Default for AccelerationStructureVersionInfoKHR {
fn default() -> AccelerationStructureVersionInfoKHR {
@ -41660,7 +41797,7 @@ impl<'a> ::std::ops::DerefMut for AccelerationStructureVersionInfoKHRBuilder<'a>
}
impl<'a> AccelerationStructureVersionInfoKHRBuilder<'a> {
pub fn version_data(mut self, version_data: &'a [u8; 2 * UUID_SIZE]) -> Self {
self.inner.p_version_data = version_data.as_ptr();
self.inner.p_version_data = version_data as *const [u8; 2 * UUID_SIZE];
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
@ -46693,7 +46830,7 @@ impl<'a> VideoProfileKHRBuilder<'a> {
pub struct VideoCapabilitiesKHR {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub capability_flags: VideoCapabilitiesFlagsKHR,
pub capability_flags: VideoCapabilityFlagsKHR,
pub min_bitstream_buffer_offset_alignment: DeviceSize,
pub min_bitstream_buffer_size_alignment: DeviceSize,
pub video_picture_extent_granularity: Extent2D,
@ -46707,7 +46844,7 @@ impl ::std::default::Default for VideoCapabilitiesKHR {
VideoCapabilitiesKHR {
s_type: StructureType::VIDEO_CAPABILITIES_KHR,
p_next: ::std::ptr::null_mut(),
capability_flags: VideoCapabilitiesFlagsKHR::default(),
capability_flags: VideoCapabilityFlagsKHR::default(),
min_bitstream_buffer_offset_alignment: DeviceSize::default(),
min_bitstream_buffer_size_alignment: DeviceSize::default(),
video_picture_extent_granularity: Extent2D::default(),
@ -46744,7 +46881,7 @@ impl<'a> ::std::ops::DerefMut for VideoCapabilitiesKHRBuilder<'a> {
}
}
impl<'a> VideoCapabilitiesKHRBuilder<'a> {
pub fn capability_flags(mut self, capability_flags: VideoCapabilitiesFlagsKHR) -> Self {
pub fn capability_flags(mut self, capability_flags: VideoCapabilityFlagsKHR) -> Self {
self.inner.capability_flags = capability_flags;
self
}
@ -47213,7 +47350,7 @@ pub struct VideoDecodeH264ProfileEXT {
pub s_type: StructureType,
pub p_next: *const c_void,
pub std_profile_idc: StdVideoH264ProfileIdc,
pub field_layout: VideoDecodeH264FieldLayoutFlagsEXT,
pub picture_layout: VideoDecodeH264PictureLayoutFlagsEXT,
}
impl ::std::default::Default for VideoDecodeH264ProfileEXT {
fn default() -> VideoDecodeH264ProfileEXT {
@ -47221,7 +47358,7 @@ impl ::std::default::Default for VideoDecodeH264ProfileEXT {
s_type: StructureType::VIDEO_DECODE_H264_PROFILE_EXT,
p_next: ::std::ptr::null(),
std_profile_idc: StdVideoH264ProfileIdc::default(),
field_layout: VideoDecodeH264FieldLayoutFlagsEXT::default(),
picture_layout: VideoDecodeH264PictureLayoutFlagsEXT::default(),
}
}
}
@ -47256,8 +47393,8 @@ impl<'a> VideoDecodeH264ProfileEXTBuilder<'a> {
self.inner.std_profile_idc = std_profile_idc;
self
}
pub fn field_layout(mut self, field_layout: VideoDecodeH264FieldLayoutFlagsEXT) -> Self {
self.inner.field_layout = field_layout;
pub fn picture_layout(mut self, picture_layout: VideoDecodeH264PictureLayoutFlagsEXT) -> Self {
self.inner.picture_layout = picture_layout;
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
@ -48883,7 +49020,7 @@ impl<'a> VideoEncodeRateControlInfoKHRBuilder<'a> {
pub struct VideoEncodeH264CapabilitiesEXT {
pub s_type: StructureType,
pub p_next: *const c_void,
pub flags: VideoEncodeH264CapabilitiesFlagsEXT,
pub flags: VideoEncodeH264CapabilityFlagsEXT,
pub input_mode_flags: VideoEncodeH264InputModeFlagsEXT,
pub output_mode_flags: VideoEncodeH264OutputModeFlagsEXT,
pub min_picture_size_in_mbs: Extent2D,
@ -48900,7 +49037,7 @@ impl ::std::default::Default for VideoEncodeH264CapabilitiesEXT {
VideoEncodeH264CapabilitiesEXT {
s_type: StructureType::VIDEO_ENCODE_H264_CAPABILITIES_EXT,
p_next: ::std::ptr::null(),
flags: VideoEncodeH264CapabilitiesFlagsEXT::default(),
flags: VideoEncodeH264CapabilityFlagsEXT::default(),
input_mode_flags: VideoEncodeH264InputModeFlagsEXT::default(),
output_mode_flags: VideoEncodeH264OutputModeFlagsEXT::default(),
min_picture_size_in_mbs: Extent2D::default(),
@ -48941,7 +49078,7 @@ impl<'a> ::std::ops::DerefMut for VideoEncodeH264CapabilitiesEXTBuilder<'a> {
}
}
impl<'a> VideoEncodeH264CapabilitiesEXTBuilder<'a> {
pub fn flags(mut self, flags: VideoEncodeH264CapabilitiesFlagsEXT) -> Self {
pub fn flags(mut self, flags: VideoEncodeH264CapabilityFlagsEXT) -> Self {
self.inner.flags = flags;
self
}
@ -50218,6 +50355,412 @@ impl<'a> CuLaunchInfoNVXBuilder<'a> {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR.html>"]
pub struct PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub shader_integer_dot_product: Bool32,
}
impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
fn default() -> PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
s_type: StructureType::PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR,
p_next: ::std::ptr::null_mut(),
shader_integer_dot_product: Bool32::default(),
}
}
}
impl PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> {
PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder {
inner: PhysicalDeviceShaderIntegerDotProductFeaturesKHR::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> {
inner: PhysicalDeviceShaderIntegerDotProductFeaturesKHR,
marker: ::std::marker::PhantomData<&'a ()>,
}
unsafe impl ExtendsPhysicalDeviceFeatures2
for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'_>
{
}
unsafe impl ExtendsPhysicalDeviceFeatures2 for PhysicalDeviceShaderIntegerDotProductFeaturesKHR {}
unsafe impl ExtendsDeviceCreateInfo
for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'_>
{
}
unsafe impl ExtendsDeviceCreateInfo for PhysicalDeviceShaderIntegerDotProductFeaturesKHR {}
impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> {
type Target = PhysicalDeviceShaderIntegerDotProductFeaturesKHR;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> PhysicalDeviceShaderIntegerDotProductFeaturesKHRBuilder<'a> {
pub fn shader_integer_dot_product(mut self, shader_integer_dot_product: bool) -> Self {
self.inner.shader_integer_dot_product = shader_integer_dot_product.into();
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
#[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
#[doc = r" so references to builders can be passed directly to Vulkan functions."]
pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductFeaturesKHR {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR.html>"]
pub struct PhysicalDeviceShaderIntegerDotProductPropertiesKHR {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub integer_dot_product8_bit_unsigned_accelerated: Bool32,
pub integer_dot_product8_bit_signed_accelerated: Bool32,
pub integer_dot_product8_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product4x8_bit_packed_unsigned_accelerated: Bool32,
pub integer_dot_product4x8_bit_packed_signed_accelerated: Bool32,
pub integer_dot_product4x8_bit_packed_mixed_signedness_accelerated: Bool32,
pub integer_dot_product16_bit_unsigned_accelerated: Bool32,
pub integer_dot_product16_bit_signed_accelerated: Bool32,
pub integer_dot_product16_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product32_bit_unsigned_accelerated: Bool32,
pub integer_dot_product32_bit_signed_accelerated: Bool32,
pub integer_dot_product32_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product64_bit_unsigned_accelerated: Bool32,
pub integer_dot_product64_bit_signed_accelerated: Bool32,
pub integer_dot_product64_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating8_bit_signed_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated:
Bool32,
pub integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating16_bit_signed_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating32_bit_signed_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating64_bit_signed_accelerated: Bool32,
pub integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated: Bool32,
}
impl ::std::default::Default for PhysicalDeviceShaderIntegerDotProductPropertiesKHR {
fn default() -> PhysicalDeviceShaderIntegerDotProductPropertiesKHR {
PhysicalDeviceShaderIntegerDotProductPropertiesKHR { s_type : StructureType :: PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR , p_next : :: std :: ptr :: null_mut () , integer_dot_product8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product64_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_signed_accelerated : Bool32 :: default () , integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated : Bool32 :: default () }
}
}
impl PhysicalDeviceShaderIntegerDotProductPropertiesKHR {
pub fn builder<'a>() -> PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> {
PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder {
inner: PhysicalDeviceShaderIntegerDotProductPropertiesKHR::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> {
inner: PhysicalDeviceShaderIntegerDotProductPropertiesKHR,
marker: ::std::marker::PhantomData<&'a ()>,
}
unsafe impl ExtendsPhysicalDeviceProperties2
for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'_>
{
}
unsafe impl ExtendsPhysicalDeviceProperties2
for PhysicalDeviceShaderIntegerDotProductPropertiesKHR
{
}
impl<'a> ::std::ops::Deref for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> {
type Target = PhysicalDeviceShaderIntegerDotProductPropertiesKHR;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> PhysicalDeviceShaderIntegerDotProductPropertiesKHRBuilder<'a> {
pub fn integer_dot_product8_bit_unsigned_accelerated(
mut self,
integer_dot_product8_bit_unsigned_accelerated: bool,
) -> Self {
self.inner.integer_dot_product8_bit_unsigned_accelerated =
integer_dot_product8_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product8_bit_signed_accelerated(
mut self,
integer_dot_product8_bit_signed_accelerated: bool,
) -> Self {
self.inner.integer_dot_product8_bit_signed_accelerated =
integer_dot_product8_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product8_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product8_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product8_bit_mixed_signedness_accelerated =
integer_dot_product8_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product4x8_bit_packed_unsigned_accelerated(
mut self,
integer_dot_product4x8_bit_packed_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product4x8_bit_packed_unsigned_accelerated =
integer_dot_product4x8_bit_packed_unsigned_accelerated.into();
self
}
pub fn integer_dot_product4x8_bit_packed_signed_accelerated(
mut self,
integer_dot_product4x8_bit_packed_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product4x8_bit_packed_signed_accelerated =
integer_dot_product4x8_bit_packed_signed_accelerated.into();
self
}
pub fn integer_dot_product4x8_bit_packed_mixed_signedness_accelerated(
mut self,
integer_dot_product4x8_bit_packed_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product4x8_bit_packed_mixed_signedness_accelerated =
integer_dot_product4x8_bit_packed_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product16_bit_unsigned_accelerated(
mut self,
integer_dot_product16_bit_unsigned_accelerated: bool,
) -> Self {
self.inner.integer_dot_product16_bit_unsigned_accelerated =
integer_dot_product16_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product16_bit_signed_accelerated(
mut self,
integer_dot_product16_bit_signed_accelerated: bool,
) -> Self {
self.inner.integer_dot_product16_bit_signed_accelerated =
integer_dot_product16_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product16_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product16_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product16_bit_mixed_signedness_accelerated =
integer_dot_product16_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product32_bit_unsigned_accelerated(
mut self,
integer_dot_product32_bit_unsigned_accelerated: bool,
) -> Self {
self.inner.integer_dot_product32_bit_unsigned_accelerated =
integer_dot_product32_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product32_bit_signed_accelerated(
mut self,
integer_dot_product32_bit_signed_accelerated: bool,
) -> Self {
self.inner.integer_dot_product32_bit_signed_accelerated =
integer_dot_product32_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product32_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product32_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product32_bit_mixed_signedness_accelerated =
integer_dot_product32_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product64_bit_unsigned_accelerated(
mut self,
integer_dot_product64_bit_unsigned_accelerated: bool,
) -> Self {
self.inner.integer_dot_product64_bit_unsigned_accelerated =
integer_dot_product64_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product64_bit_signed_accelerated(
mut self,
integer_dot_product64_bit_signed_accelerated: bool,
) -> Self {
self.inner.integer_dot_product64_bit_signed_accelerated =
integer_dot_product64_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product64_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product64_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product64_bit_mixed_signedness_accelerated =
integer_dot_product64_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated(
mut self,
integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated =
integer_dot_product_accumulating_saturating8_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating8_bit_signed_accelerated(
mut self,
integer_dot_product_accumulating_saturating8_bit_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating8_bit_signed_accelerated =
integer_dot_product_accumulating_saturating8_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated =
integer_dot_product_accumulating_saturating8_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated(
mut self,
integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated =
integer_dot_product_accumulating_saturating4x8_bit_packed_unsigned_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated(
mut self,
integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated =
integer_dot_product_accumulating_saturating4x8_bit_packed_signed_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated(
mut self,
integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated : bool,
) -> Self {
self . inner . integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated = integer_dot_product_accumulating_saturating4x8_bit_packed_mixed_signedness_accelerated . into () ;
self
}
pub fn integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated(
mut self,
integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated =
integer_dot_product_accumulating_saturating16_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating16_bit_signed_accelerated(
mut self,
integer_dot_product_accumulating_saturating16_bit_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating16_bit_signed_accelerated =
integer_dot_product_accumulating_saturating16_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated =
integer_dot_product_accumulating_saturating16_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated(
mut self,
integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated =
integer_dot_product_accumulating_saturating32_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating32_bit_signed_accelerated(
mut self,
integer_dot_product_accumulating_saturating32_bit_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating32_bit_signed_accelerated =
integer_dot_product_accumulating_saturating32_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated =
integer_dot_product_accumulating_saturating32_bit_mixed_signedness_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated(
mut self,
integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated =
integer_dot_product_accumulating_saturating64_bit_unsigned_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating64_bit_signed_accelerated(
mut self,
integer_dot_product_accumulating_saturating64_bit_signed_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating64_bit_signed_accelerated =
integer_dot_product_accumulating_saturating64_bit_signed_accelerated.into();
self
}
pub fn integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated(
mut self,
integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated: bool,
) -> Self {
self.inner
.integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated =
integer_dot_product_accumulating_saturating64_bit_mixed_signedness_accelerated.into();
self
}
#[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
#[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
#[doc = r" so references to builders can be passed directly to Vulkan functions."]
pub fn build(self) -> PhysicalDeviceShaderIntegerDotProductPropertiesKHR {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceDrmPropertiesEXT.html>"]
pub struct PhysicalDeviceDrmPropertiesEXT {
pub s_type: StructureType,

View file

@ -1655,6 +1655,8 @@ impl DriverId {
pub const COREAVI_PROPRIETARY: Self = Self(15);
#[doc = "Juice Technologies, Inc."]
pub const JUICE_PROPRIETARY: Self = Self(16);
#[doc = "Verisilicon, Inc."]
pub const VERISILICON_PROPRIETARY: Self = Self(17);
}
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]

View file

@ -2398,7 +2398,7 @@ impl KhrVideoQueueFn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_video_queue\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 1u32;
pub const SPEC_VERSION: u32 = 2u32;
}
#[allow(non_camel_case_types)]
pub type PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR = unsafe extern "system" fn(
@ -4072,7 +4072,7 @@ impl ExtVideoEncodeH264Fn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_video_encode_h264\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 1u32;
pub const SPEC_VERSION: u32 = 2u32;
}
#[derive(Clone)]
pub struct ExtVideoEncodeH264Fn {}
@ -4150,7 +4150,7 @@ impl ExtVideoDecodeH264Fn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_video_decode_h264\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 1u32;
pub const SPEC_VERSION: u32 = 3u32;
}
#[derive(Clone)]
pub struct ExtVideoDecodeH264Fn {}
@ -11198,7 +11198,7 @@ impl KhrAccelerationStructureFn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_acceleration_structure\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 11u32;
pub const SPEC_VERSION: u32 = 12u32;
}
#[allow(non_camel_case_types)]
pub type PFN_vkCreateAccelerationStructureKHR = unsafe extern "system" fn(
@ -20415,25 +20415,33 @@ impl KhrExtension280Fn {
KhrExtension280Fn {}
}
}
impl ArmExtension281Fn {
impl KhrShaderIntegerDotProductFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_ARM_extension_281\0")
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_shader_integer_dot_product\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
pub const SPEC_VERSION: u32 = 1u32;
}
#[derive(Clone)]
pub struct ArmExtension281Fn {}
unsafe impl Send for ArmExtension281Fn {}
unsafe impl Sync for ArmExtension281Fn {}
impl ArmExtension281Fn {
pub struct KhrShaderIntegerDotProductFn {}
unsafe impl Send for KhrShaderIntegerDotProductFn {}
unsafe impl Sync for KhrShaderIntegerDotProductFn {}
impl KhrShaderIntegerDotProductFn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ArmExtension281Fn {}
KhrShaderIntegerDotProductFn {}
}
}
#[doc = "Generated from 'VK_KHR_shader_integer_dot_product'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: Self = Self(1_000_280_000);
}
#[doc = "Generated from 'VK_KHR_shader_integer_dot_product'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: Self = Self(1_000_280_001);
}
impl ExtTexelBufferAlignmentFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_texel_buffer_alignment\0")
@ -21434,7 +21442,7 @@ impl QcomRenderPassStoreOpsFn {
}
#[doc = "Generated from 'VK_QCOM_render_pass_store_ops'"]
impl AttachmentStoreOp {
pub const NONE_QCOM: Self = Self(1_000_301_000);
pub const NONE_QCOM: Self = Self::NONE_EXT;
}
impl QcomExtension303Fn {
pub fn name() -> &'static ::std::ffi::CStr {
@ -23527,24 +23535,30 @@ impl ExtVertexAttributeAliasingFn {
ExtVertexAttributeAliasingFn {}
}
}
impl ExtExtension357Fn {
impl ExtPrimitiveTopologyListRestartFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_357\0")
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_primitive_topology_list_restart\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 1u32;
}
#[derive(Clone)]
pub struct ExtExtension357Fn {}
unsafe impl Send for ExtExtension357Fn {}
unsafe impl Sync for ExtExtension357Fn {}
impl ExtExtension357Fn {
pub struct ExtPrimitiveTopologyListRestartFn {}
unsafe impl Send for ExtPrimitiveTopologyListRestartFn {}
unsafe impl Sync for ExtPrimitiveTopologyListRestartFn {}
impl ExtPrimitiveTopologyListRestartFn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension357Fn {}
ExtPrimitiveTopologyListRestartFn {}
}
}
#[doc = "Generated from 'VK_EXT_primitive_topology_list_restart'"]
impl StructureType {
pub const PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: Self =
Self(1_000_356_000);
}
impl KhrExtension358Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_extension_358\0")
@ -23569,6 +23583,7 @@ impl ExtExtension359Fn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_359\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
#[derive(Clone)]
pub struct ExtExtension359Fn {}
@ -23587,6 +23602,7 @@ impl ExtExtension360Fn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_360\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
#[derive(Clone)]
pub struct ExtExtension360Fn {}
@ -23605,6 +23621,7 @@ impl KhrExtension361Fn {
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_extension_361\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
#[derive(Clone)]
pub struct KhrExtension361Fn {}
@ -25220,25 +25237,33 @@ impl JuiceExtension400Fn {
JuiceExtension400Fn {}
}
}
impl KhrExtension401Fn {
impl ExtLoadStoreOpNoneFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_KHR_extension_401\0")
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_load_store_op_none\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
pub const SPEC_VERSION: u32 = 1u32;
}
#[derive(Clone)]
pub struct KhrExtension401Fn {}
unsafe impl Send for KhrExtension401Fn {}
unsafe impl Sync for KhrExtension401Fn {}
impl KhrExtension401Fn {
pub struct ExtLoadStoreOpNoneFn {}
unsafe impl Send for ExtLoadStoreOpNoneFn {}
unsafe impl Sync for ExtLoadStoreOpNoneFn {}
impl ExtLoadStoreOpNoneFn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
KhrExtension401Fn {}
ExtLoadStoreOpNoneFn {}
}
}
#[doc = "Generated from 'VK_EXT_load_store_op_none'"]
impl AttachmentLoadOp {
pub const NONE_EXT: Self = Self(1_000_400_000);
}
#[doc = "Generated from 'VK_EXT_load_store_op_none'"]
impl AttachmentStoreOp {
pub const NONE_EXT: Self = Self(1_000_301_000);
}
impl FbExtension402Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_FB_extension_402\0")
@ -25448,24 +25473,64 @@ impl NvExtension412Fn {
NvExtension412Fn {}
}
}
impl NvExtension413Fn {
impl ExtPageableDeviceLocalMemoryFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_NV_extension_413\0")
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_pageable_device_local_memory\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
pub const SPEC_VERSION: u32 = 1u32;
}
#[allow(non_camel_case_types)]
pub type PFN_vkSetDeviceMemoryPriorityEXT =
unsafe extern "system" fn(device: Device, memory: DeviceMemory, priority: f32);
#[derive(Clone)]
pub struct NvExtension413Fn {}
unsafe impl Send for NvExtension413Fn {}
unsafe impl Sync for NvExtension413Fn {}
impl NvExtension413Fn {
pub struct ExtPageableDeviceLocalMemoryFn {
pub set_device_memory_priority_ext: PFN_vkSetDeviceMemoryPriorityEXT,
}
unsafe impl Send for ExtPageableDeviceLocalMemoryFn {}
unsafe impl Sync for ExtPageableDeviceLocalMemoryFn {}
impl ExtPageableDeviceLocalMemoryFn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
NvExtension413Fn {}
ExtPageableDeviceLocalMemoryFn {
set_device_memory_priority_ext: unsafe {
unsafe extern "system" fn set_device_memory_priority_ext(
_device: Device,
_memory: DeviceMemory,
_priority: f32,
) {
panic!(concat!(
"Unable to load ",
stringify!(set_device_memory_priority_ext)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkSetDeviceMemoryPriorityEXT\0",
);
let val = _f(cname);
if val.is_null() {
set_device_memory_priority_ext
} else {
::std::mem::transmute(val)
}
},
}
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetDeviceMemoryPriorityEXT.html>"]
pub unsafe fn set_device_memory_priority_ext(
&self,
device: Device,
memory: DeviceMemory,
priority: f32,
) {
(self.set_device_memory_priority_ext)(device, memory, priority)
}
}
#[doc = "Generated from 'VK_EXT_pageable_device_local_memory'"]
impl StructureType {
pub const PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: Self = Self(1_000_412_000);
}
impl NvExtension414Fn {
pub fn name() -> &'static ::std::ffi::CStr {
@ -25619,3 +25684,45 @@ impl KhrExtension421Fn {
KhrExtension421Fn {}
}
}
impl ExtExtension422Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_422\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
#[derive(Clone)]
pub struct ExtExtension422Fn {}
unsafe impl Send for ExtExtension422Fn {}
unsafe impl Sync for ExtExtension422Fn {}
impl ExtExtension422Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension422Fn {}
}
}
impl ExtDisableCubeMapWrapFn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_disable_cube_map_wrap\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
#[derive(Clone)]
pub struct ExtDisableCubeMapWrapFn {}
unsafe impl Send for ExtDisableCubeMapWrapFn {}
unsafe impl Sync for ExtDisableCubeMapWrapFn {}
impl ExtDisableCubeMapWrapFn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtDisableCubeMapWrapFn {}
}
}
#[doc = "Generated from 'VK_EXT_disable_cube_map_wrap'"]
impl SamplerCreateFlags {
pub const RESERVED_2_EXT: Self = Self(0b100);
}

@ -1 +1 @@
Subproject commit b8c57b0a09f7324fec5a7c363f5e26ff4d5a3222
Subproject commit 4fee3efc189c83ccd26a9cd8265185c98458c94d

View file

@ -671,6 +671,10 @@ pub trait FieldExt {
/// Whether this is C's `void` type (not to be mistaken with a void _pointer_!)
fn is_void(&self) -> bool;
/// Exceptions for pointers to static-sized arrays,
/// `vk.xml` does not annotate this.
fn is_pointer_to_static_sized_array(&self) -> bool;
}
pub trait ToTokens {
@ -856,7 +860,7 @@ impl FieldExt for vkxml::Field {
.expect("Should have size");
// Make sure we also rename the constant, that is
// used inside the static array
let size: TokenStream = constant_name(size).parse().unwrap();
let size = convert_c_expression(size, &BTreeMap::new());
// arrays in c are always passed as a pointer
if is_ffi_param {
quote!(*const [#ty; #size])
@ -866,7 +870,13 @@ impl FieldExt for vkxml::Field {
}
_ => {
let pointer = self.reference.as_ref().map(|r| r.to_tokens(self.is_const));
quote!(#pointer #ty)
if self.is_pointer_to_static_sized_array() {
let size = self.c_size.as_ref().expect("Should have c_size");
let size = convert_c_expression(size, &BTreeMap::new());
quote!(#pointer [#ty; #size])
} else {
quote!(#pointer #ty)
}
}
}
}
@ -874,6 +884,11 @@ impl FieldExt for vkxml::Field {
fn is_void(&self) -> bool {
self.basetype == "void" && self.reference.is_none()
}
fn is_pointer_to_static_sized_array(&self) -> bool {
matches!(self.array, Some(vkxml::ArrayType::Dynamic))
&& self.name.as_deref() == Some("pVersionData")
}
}
pub type CommandMap<'a> = HashMap<vkxml::Identifier, &'a vkxml::Command>;
@ -1394,14 +1409,6 @@ pub fn variant_ident(enum_name: &str, variant_name: &str) -> Ident {
.unwrap_or_else(|| {
if enum_name == "VkResult" || is_enum_variant_with_typo(variant_name) {
variant_name.strip_prefix("VK").unwrap()
} else if variant_name == "VK_VIDEO_DECODE_H264_PROGRESSIVE_PICTURES_ONLY" {
// https://github.com/KhronosGroup/Vulkan-Docs/issues/1531
"_PROGRESSIVE_PICTURES_ONLY"
} else if struct_name == "VK_VIDEO_ENCODE_H264_CAPABILITIES" {
// https://github.com/KhronosGroup/Vulkan-Docs/issues/1531
variant_name
.strip_prefix("VK_VIDEO_ENCODE_H264_CAPABILITY")
.unwrap()
} else {
panic!(
"Failed to strip {} prefix from enum variant {}",
@ -1777,21 +1784,21 @@ pub fn derive_debug(
}
pub fn derive_setters(
_struct: &vkxml::Struct,
struct_: &vkxml::Struct,
root_structs: &HashSet<Ident, impl BuildHasher>,
) -> Option<TokenStream> {
if &_struct.name == "VkBaseInStructure"
|| &_struct.name == "VkBaseOutStructure"
|| &_struct.name == "VkTransformMatrixKHR"
|| &_struct.name == "VkAccelerationStructureInstanceKHR"
if &struct_.name == "VkBaseInStructure"
|| &struct_.name == "VkBaseOutStructure"
|| &struct_.name == "VkTransformMatrixKHR"
|| &struct_.name == "VkAccelerationStructureInstanceKHR"
{
return None;
}
let name = name_to_tokens(&_struct.name);
let name_builder = name_to_tokens(&(_struct.name.clone() + "Builder"));
let name = name_to_tokens(&struct_.name);
let name_builder = name_to_tokens(&(struct_.name.clone() + "Builder"));
let members = _struct.elements.iter().filter_map(|elem| match *elem {
let members = struct_.elements.iter().filter_map(|elem| match *elem {
vkxml::StructElement::Member(ref field) => Some(field),
_ => None,
});
@ -1811,17 +1818,16 @@ pub fn derive_setters(
// Associated _count members
if field.array.is_some() {
if let Some(ref array_size) = field.size {
if !array_size.starts_with("latexmath")
&& !nofilter_count_members
.iter()
.any(|&n| n == (_struct.name.clone() + "." + field_name))
if !nofilter_count_members
.iter()
.any(|&n| n == (struct_.name.clone() + "." + field_name))
{
return Some((*array_size).clone());
}
}
}
// VkShaderModuleCreateInfo requiers a custom setter
// VkShaderModuleCreateInfo requires a custom setter
if field_name == "codeSize" {
return Some(field_name.clone());
}
@ -1846,7 +1852,7 @@ pub fn derive_setters(
let param_ident_short = format_ident!("{}", &param_ident_short);
if let Some(name) = field.name.as_ref() {
// Fiter
// Filter
if filter_members.iter().any(|n| *n == *name) {
return None;
}
@ -1906,49 +1912,47 @@ pub fn derive_setters(
if matches!(field.array, Some(vkxml::ArrayType::Dynamic)) {
if let Some(ref array_size) = field.size {
if !array_size.starts_with("latexmath") {
let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a));
let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a));
let mut ptr = if field.is_const {
quote!(.as_ptr())
} else {
quote!(.as_mut_ptr())
};
let mut ptr = if field.is_const {
quote!(.as_ptr())
} else {
quote!(.as_mut_ptr())
};
// Interpret void array as byte array
if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) {
let mutable = if field.is_const { quote!(const) } else { quote!(mut) };
// Interpret void array as byte array
if field.basetype == "void" && matches!(field.reference, Some(vkxml::ReferenceType::Pointer)) {
let mutable = if field.is_const { quote!(const) } else { quote!(mut) };
slice_param_ty_tokens = quote!([u8]);
ptr = quote!(#ptr as *#mutable c_void);
};
slice_param_ty_tokens = quote!([u8]);
ptr = quote!(#ptr as *#mutable c_void);
};
let mutable = if field.is_const { quote!() } else { quote!(mut) };
let set_size_stmt = if field.is_pointer_to_static_sized_array() {
// this is a pointer to a piece of memory with statically known size.
let array_size = field.c_size.as_ref().unwrap();
let c_size = convert_c_expression(array_size, &BTreeMap::new());
let inner_type = field.inner_type_tokens();
let mutable = if field.is_const { quote!(const) } else { quote!(mut) };
// Apply some heuristics to determine whether the size is an expression.
// If so, this is a pointer to a piece of memory with statically known size.
let set_size_stmt = if array_size.contains("ename:") || array_size.contains('*') {
// c_size should contain the same minus `ename:`-prefixed identifiers
let array_size = field.c_size.as_ref().unwrap_or(array_size);
let c_size = convert_c_expression(array_size, &BTreeMap::new());
let inner_type = field.inner_type_tokens();
slice_param_ty_tokens = quote!([#inner_type; #c_size]);
ptr = quote!(as *#mutable #slice_param_ty_tokens);
slice_param_ty_tokens = quote!([#inner_type; #c_size]);
quote!()
} else {
let array_size_ident = format_ident!("{}", array_size.to_snake_case().as_str());
quote!(self.inner.#array_size_ident = #param_ident_short.len() as _;)
};
quote!()
} else {
let array_size_ident = format_ident!("{}", array_size.to_snake_case().as_str());
quote!(self.inner.#array_size_ident = #param_ident_short.len() as _;)
};
let mutable = if field.is_const { quote!() } else { quote!(mut) };
return Some(quote! {
pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self {
#set_size_stmt
self.inner.#param_ident = #param_ident_short#ptr;
self
}
});
}
return Some(quote! {
pub fn #param_ident_short(mut self, #param_ident_short: &'a #mutable #slice_param_ty_tokens) -> Self {
#set_size_stmt
self.inner.#param_ident = #param_ident_short#ptr;
self
}
});
}
}
}
@ -2021,7 +2025,7 @@ pub fn derive_setters(
};
// If the struct extends something we need to implement the traits.
let impl_extend_trait = _struct
let impl_extend_trait = struct_
.extends
.iter()
.flat_map(|extends| extends.split(','))
@ -2964,23 +2968,22 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
let vk_include = vk_headers_dir.join("include");
let mut bindings = bindgen::Builder::default()
.clang_arg(format!(
"-I{}",
vk_include.to_str().expect("Valid UTF8 string")
))
.clang_arg(format!(
"-I{}",
vk_include
.join("vulkan")
.to_str()
.expect("Valid UTF8 string")
));
let mut bindings = bindgen::Builder::default().clang_arg(format!(
"-I{}",
vk_include.to_str().expect("Valid UTF8 string")
));
let (header_includes, header_types) = extract_native_types(&spec2);
for (_name, path) in header_includes {
bindings = bindings.header(vk_include.join(path).to_str().expect("Valid UTF8 string"));
let path = if path == "vk_platform.h" {
// Fix broken path, https://github.com/KhronosGroup/Vulkan-Docs/pull/1538
// Reintroduced in: https://github.com/KhronosGroup/Vulkan-Docs/issues/1573
vk_include.join("vulkan").join(path)
} else {
vk_include.join(path)
};
bindings = bindings.header(path.to_str().expect("Valid UTF8 string"));
}
for typ in header_types {