Update Vulkan-Headers to 1.2.174 (#429)

* 1.2.171 new types

* generator: Keep platform_types checked in to git only

This static content is better kept in the platform_types.rs file only,
where it can be edited directly.

(Perhaps we should be more clear about generated versus manual files
 within the ash crate, by storing generated outputs in an auto/
 module/subdirectory that is reexported, like glib and friends?)

* Update Vulkan-Headers to 12.171

* Update Vulkan-Headers to 12.172

* Update Vulkan-Headers to 12.173

* Update Vulkan-Headers to 12.174

* generator: Generalize C number parsing

Co-authored-by: caradhras11@gmail.com <caradhras11@gmail.com>
This commit is contained in:
Marijn Suijten 2021-05-11 00:00:55 +02:00 committed by GitHub
parent 28b6253748
commit 498b8d81a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1003 additions and 125 deletions

View file

@ -143,9 +143,6 @@ impl fmt::Debug for AccessFlags {
(AccessFlags::HOST_WRITE.0, "HOST_WRITE"), (AccessFlags::HOST_WRITE.0, "HOST_WRITE"),
(AccessFlags::MEMORY_READ.0, "MEMORY_READ"), (AccessFlags::MEMORY_READ.0, "MEMORY_READ"),
(AccessFlags::MEMORY_WRITE.0, "MEMORY_WRITE"), (AccessFlags::MEMORY_WRITE.0, "MEMORY_WRITE"),
(AccessFlags::RESERVED_30_KHR.0, "RESERVED_30_KHR"),
(AccessFlags::RESERVED_28_KHR.0, "RESERVED_28_KHR"),
(AccessFlags::RESERVED_29_KHR.0, "RESERVED_29_KHR"),
( (
AccessFlags::TRANSFORM_FEEDBACK_WRITE_EXT.0, AccessFlags::TRANSFORM_FEEDBACK_WRITE_EXT.0,
"TRANSFORM_FEEDBACK_WRITE_EXT", "TRANSFORM_FEEDBACK_WRITE_EXT",
@ -249,6 +246,10 @@ impl fmt::Debug for AccessFlags2KHR {
AccessFlags2KHR::SHADER_STORAGE_WRITE.0, AccessFlags2KHR::SHADER_STORAGE_WRITE.0,
"SHADER_STORAGE_WRITE", "SHADER_STORAGE_WRITE",
), ),
(AccessFlags2KHR::RESERVED_READ_35.0, "RESERVED_READ_35"),
(AccessFlags2KHR::RESERVED_WRITE_36.0, "RESERVED_WRITE_36"),
(AccessFlags2KHR::RESERVED_READ_37.0, "RESERVED_READ_37"),
(AccessFlags2KHR::RESERVED_WRITE_38.0, "RESERVED_WRITE_38"),
( (
AccessFlags2KHR::TRANSFORM_FEEDBACK_WRITE_EXT.0, AccessFlags2KHR::TRANSFORM_FEEDBACK_WRITE_EXT.0,
"TRANSFORM_FEEDBACK_WRITE_EXT", "TRANSFORM_FEEDBACK_WRITE_EXT",
@ -1430,6 +1431,10 @@ impl fmt::Debug for ExternalMemoryHandleTypeFlags {
ExternalMemoryHandleTypeFlags::HOST_MAPPED_FOREIGN_MEMORY_EXT.0, ExternalMemoryHandleTypeFlags::HOST_MAPPED_FOREIGN_MEMORY_EXT.0,
"HOST_MAPPED_FOREIGN_MEMORY_EXT", "HOST_MAPPED_FOREIGN_MEMORY_EXT",
), ),
(
ExternalMemoryHandleTypeFlags::ZIRCON_VMO_FUCHSIA.0,
"ZIRCON_VMO_FUCHSIA",
),
]; ];
debug_flags(f, KNOWN, self.0) debug_flags(f, KNOWN, self.0)
} }
@ -1483,6 +1488,10 @@ impl fmt::Debug for ExternalSemaphoreHandleTypeFlags {
"D3D12_FENCE", "D3D12_FENCE",
), ),
(ExternalSemaphoreHandleTypeFlags::SYNC_FD.0, "SYNC_FD"), (ExternalSemaphoreHandleTypeFlags::SYNC_FD.0, "SYNC_FD"),
(
ExternalSemaphoreHandleTypeFlags::ZIRCON_EVENT_FUCHSIA.0,
"ZIRCON_EVENT_FUCHSIA",
),
( (
ExternalSemaphoreHandleTypeFlags::RESERVED_5_NV.0, ExternalSemaphoreHandleTypeFlags::RESERVED_5_NV.0,
"RESERVED_5_NV", "RESERVED_5_NV",
@ -2895,8 +2904,6 @@ impl fmt::Debug for PipelineStageFlags {
(PipelineStageFlags::HOST.0, "HOST"), (PipelineStageFlags::HOST.0, "HOST"),
(PipelineStageFlags::ALL_GRAPHICS.0, "ALL_GRAPHICS"), (PipelineStageFlags::ALL_GRAPHICS.0, "ALL_GRAPHICS"),
(PipelineStageFlags::ALL_COMMANDS.0, "ALL_COMMANDS"), (PipelineStageFlags::ALL_COMMANDS.0, "ALL_COMMANDS"),
(PipelineStageFlags::RESERVED_27_KHR.0, "RESERVED_27_KHR"),
(PipelineStageFlags::RESERVED_26_KHR.0, "RESERVED_26_KHR"),
( (
PipelineStageFlags::TRANSFORM_FEEDBACK_EXT.0, PipelineStageFlags::TRANSFORM_FEEDBACK_EXT.0,
"TRANSFORM_FEEDBACK_EXT", "TRANSFORM_FEEDBACK_EXT",
@ -2981,6 +2988,8 @@ impl fmt::Debug for PipelineStageFlags2KHR {
PipelineStageFlags2KHR::PRE_RASTERIZATION_SHADERS.0, PipelineStageFlags2KHR::PRE_RASTERIZATION_SHADERS.0,
"PRE_RASTERIZATION_SHADERS", "PRE_RASTERIZATION_SHADERS",
), ),
(PipelineStageFlags2KHR::RESERVED_26.0, "RESERVED_26"),
(PipelineStageFlags2KHR::RESERVED_27.0, "RESERVED_27"),
( (
PipelineStageFlags2KHR::TRANSFORM_FEEDBACK_EXT.0, PipelineStageFlags2KHR::TRANSFORM_FEEDBACK_EXT.0,
"TRANSFORM_FEEDBACK_EXT", "TRANSFORM_FEEDBACK_EXT",
@ -3487,6 +3496,12 @@ impl fmt::Debug for ScopeNV {
} }
} }
} }
impl fmt::Debug for ScreenSurfaceCreateFlagsQNX {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for SemaphoreCreateFlags { impl fmt::Debug for SemaphoreCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[]; const KNOWN: &[(Flags, &str)] = &[];
@ -4522,6 +4537,21 @@ impl fmt::Debug for StructureType {
Self::MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE => { Self::MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE => {
Some("MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE") Some("MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE")
} }
Self::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA")
}
Self::MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA => {
Some("MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA")
}
Self::MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
}
Self::IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA")
}
Self::SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
}
Self::SCREEN_SURFACE_CREATE_INFO_QNX => Some("SCREEN_SURFACE_CREATE_INFO_QNX"), Self::SCREEN_SURFACE_CREATE_INFO_QNX => Some("SCREEN_SURFACE_CREATE_INFO_QNX"),
Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => { Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => {
Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES") Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES")

View file

@ -14,8 +14,8 @@ pub const ATTACHMENT_UNUSED: u32 = !0;
pub const TRUE: Bool32 = 1; pub const TRUE: Bool32 = 1;
pub const FALSE: Bool32 = 0; pub const FALSE: Bool32 = 0;
pub const QUEUE_FAMILY_IGNORED: u32 = !0; pub const QUEUE_FAMILY_IGNORED: u32 = !0;
pub const QUEUE_FAMILY_EXTERNAL: u32 = !0 - 1; pub const QUEUE_FAMILY_EXTERNAL: u32 = !1;
pub const QUEUE_FAMILY_FOREIGN_EXT: u32 = !0 - 2; pub const QUEUE_FAMILY_FOREIGN_EXT: u32 = !2;
pub const SUBPASS_EXTERNAL: u32 = !0; pub const SUBPASS_EXTERNAL: u32 = !0;
pub const MAX_DEVICE_GROUP_SIZE: usize = 32; pub const MAX_DEVICE_GROUP_SIZE: usize = 32;
pub const MAX_DRIVER_NAME_SIZE: usize = 256; pub const MAX_DRIVER_NAME_SIZE: usize = 256;

View file

@ -9,7 +9,7 @@ use std::os::raw::*;
pub const API_VERSION_1_0: u32 = crate::vk::make_version(1, 0, 0); pub const API_VERSION_1_0: u32 = crate::vk::make_version(1, 0, 0);
pub const API_VERSION_1_1: u32 = crate::vk::make_version(1, 1, 0); pub const API_VERSION_1_1: u32 = crate::vk::make_version(1, 1, 0);
pub const API_VERSION_1_2: u32 = crate::vk::make_version(1, 2, 0); pub const API_VERSION_1_2: u32 = crate::vk::make_version(1, 2, 0);
pub const HEADER_VERSION: u32 = 170u32; pub const HEADER_VERSION: u32 = 174u32;
pub const HEADER_VERSION_COMPLETE: u32 = crate::vk::make_version(1, 2, HEADER_VERSION); pub const HEADER_VERSION_COMPLETE: u32 = crate::vk::make_version(1, 2, HEADER_VERSION);
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampleMask.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampleMask.html>"]
pub type SampleMask = u32; pub type SampleMask = u32;
@ -190,6 +190,11 @@ pub struct HeadlessSurfaceCreateFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(HeadlessSurfaceCreateFlagsEXT, 0b0, Flags); vk_bitflags_wrapped!(HeadlessSurfaceCreateFlagsEXT, 0b0, Flags);
#[repr(transparent)] #[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkScreenSurfaceCreateFlagsQNX.html>"]
pub struct ScreenSurfaceCreateFlagsQNX(pub(crate) Flags);
vk_bitflags_wrapped!(ScreenSurfaceCreateFlagsQNX, 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/VkCommandPoolTrimFlags.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandPoolTrimFlags.html>"]
pub struct CommandPoolTrimFlags(pub(crate) Flags); pub struct CommandPoolTrimFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandPoolTrimFlags, 0b0, Flags); vk_bitflags_wrapped!(CommandPoolTrimFlags, 0b0, Flags);
@ -10914,6 +10919,86 @@ impl<'a> StreamDescriptorSurfaceCreateInfoGGPBuilder<'a> {
} }
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkScreenSurfaceCreateInfoQNX.html>"]
pub struct ScreenSurfaceCreateInfoQNX {
pub s_type: StructureType,
pub p_next: *const c_void,
pub flags: ScreenSurfaceCreateFlagsQNX,
pub context: *mut _screen_context,
pub window: *mut _screen_window,
}
impl ::std::default::Default for ScreenSurfaceCreateInfoQNX {
fn default() -> ScreenSurfaceCreateInfoQNX {
ScreenSurfaceCreateInfoQNX {
s_type: StructureType::SCREEN_SURFACE_CREATE_INFO_QNX,
p_next: ::std::ptr::null(),
flags: ScreenSurfaceCreateFlagsQNX::default(),
context: ::std::ptr::null_mut(),
window: ::std::ptr::null_mut(),
}
}
}
impl ScreenSurfaceCreateInfoQNX {
pub fn builder<'a>() -> ScreenSurfaceCreateInfoQNXBuilder<'a> {
ScreenSurfaceCreateInfoQNXBuilder {
inner: ScreenSurfaceCreateInfoQNX::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct ScreenSurfaceCreateInfoQNXBuilder<'a> {
inner: ScreenSurfaceCreateInfoQNX,
marker: ::std::marker::PhantomData<&'a ()>,
}
pub unsafe trait ExtendsScreenSurfaceCreateInfoQNX {}
impl<'a> ::std::ops::Deref for ScreenSurfaceCreateInfoQNXBuilder<'a> {
type Target = ScreenSurfaceCreateInfoQNX;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for ScreenSurfaceCreateInfoQNXBuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> ScreenSurfaceCreateInfoQNXBuilder<'a> {
pub fn flags(mut self, flags: ScreenSurfaceCreateFlagsQNX) -> Self {
self.inner.flags = flags;
self
}
pub fn context(mut self, context: &'a mut _screen_context) -> Self {
self.inner.context = context;
self
}
pub fn window(mut self, window: &'a mut _screen_window) -> Self {
self.inner.window = window;
self
}
#[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
#[doc = r" method only exists on structs that can be passed to a function directly. Only"]
#[doc = r" valid extension structs can be pushed into the chain."]
#[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
#[doc = r" chain will look like `A -> D -> B -> C`."]
pub fn push_next<T: ExtendsScreenSurfaceCreateInfoQNX>(mut self, next: &'a mut T) -> Self {
unsafe {
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
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) -> ScreenSurfaceCreateInfoQNX {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, Hash)] #[derive(Copy, Clone, Default, Debug, PartialEq, Eq, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSurfaceFormatKHR.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSurfaceFormatKHR.html>"]
pub struct SurfaceFormatKHR { pub struct SurfaceFormatKHR {
@ -15312,6 +15397,215 @@ impl<'a> ExportMemoryWin32HandleInfoKHRBuilder<'a> {
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImportMemoryZirconHandleInfoFUCHSIA.html>"]
pub struct ImportMemoryZirconHandleInfoFUCHSIA {
pub s_type: StructureType,
pub p_next: *const c_void,
pub handle_type: ExternalMemoryHandleTypeFlags,
pub handle: zx_handle_t,
}
impl ::std::default::Default for ImportMemoryZirconHandleInfoFUCHSIA {
fn default() -> ImportMemoryZirconHandleInfoFUCHSIA {
ImportMemoryZirconHandleInfoFUCHSIA {
s_type: StructureType::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA,
p_next: ::std::ptr::null(),
handle_type: ExternalMemoryHandleTypeFlags::default(),
handle: zx_handle_t::default(),
}
}
}
impl ImportMemoryZirconHandleInfoFUCHSIA {
pub fn builder<'a>() -> ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> {
ImportMemoryZirconHandleInfoFUCHSIABuilder {
inner: ImportMemoryZirconHandleInfoFUCHSIA::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> {
inner: ImportMemoryZirconHandleInfoFUCHSIA,
marker: ::std::marker::PhantomData<&'a ()>,
}
unsafe impl ExtendsMemoryAllocateInfo for ImportMemoryZirconHandleInfoFUCHSIABuilder<'_> {}
unsafe impl ExtendsMemoryAllocateInfo for ImportMemoryZirconHandleInfoFUCHSIA {}
impl<'a> ::std::ops::Deref for ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> {
type Target = ImportMemoryZirconHandleInfoFUCHSIA;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> ImportMemoryZirconHandleInfoFUCHSIABuilder<'a> {
pub fn handle_type(mut self, handle_type: ExternalMemoryHandleTypeFlags) -> Self {
self.inner.handle_type = handle_type;
self
}
pub fn handle(mut self, handle: zx_handle_t) -> Self {
self.inner.handle = handle;
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) -> ImportMemoryZirconHandleInfoFUCHSIA {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryZirconHandlePropertiesFUCHSIA.html>"]
pub struct MemoryZirconHandlePropertiesFUCHSIA {
pub s_type: StructureType,
pub p_next: *mut c_void,
pub memory_type_bits: u32,
}
impl ::std::default::Default for MemoryZirconHandlePropertiesFUCHSIA {
fn default() -> MemoryZirconHandlePropertiesFUCHSIA {
MemoryZirconHandlePropertiesFUCHSIA {
s_type: StructureType::MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA,
p_next: ::std::ptr::null_mut(),
memory_type_bits: u32::default(),
}
}
}
impl MemoryZirconHandlePropertiesFUCHSIA {
pub fn builder<'a>() -> MemoryZirconHandlePropertiesFUCHSIABuilder<'a> {
MemoryZirconHandlePropertiesFUCHSIABuilder {
inner: MemoryZirconHandlePropertiesFUCHSIA::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct MemoryZirconHandlePropertiesFUCHSIABuilder<'a> {
inner: MemoryZirconHandlePropertiesFUCHSIA,
marker: ::std::marker::PhantomData<&'a ()>,
}
pub unsafe trait ExtendsMemoryZirconHandlePropertiesFUCHSIA {}
impl<'a> ::std::ops::Deref for MemoryZirconHandlePropertiesFUCHSIABuilder<'a> {
type Target = MemoryZirconHandlePropertiesFUCHSIA;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for MemoryZirconHandlePropertiesFUCHSIABuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> MemoryZirconHandlePropertiesFUCHSIABuilder<'a> {
pub fn memory_type_bits(mut self, memory_type_bits: u32) -> Self {
self.inner.memory_type_bits = memory_type_bits;
self
}
#[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
#[doc = r" method only exists on structs that can be passed to a function directly. Only"]
#[doc = r" valid extension structs can be pushed into the chain."]
#[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
#[doc = r" chain will look like `A -> D -> B -> C`."]
pub fn push_next<T: ExtendsMemoryZirconHandlePropertiesFUCHSIA>(
mut self,
next: &'a mut T,
) -> Self {
unsafe {
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
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) -> MemoryZirconHandlePropertiesFUCHSIA {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryGetZirconHandleInfoFUCHSIA.html>"]
pub struct MemoryGetZirconHandleInfoFUCHSIA {
pub s_type: StructureType,
pub p_next: *const c_void,
pub memory: DeviceMemory,
pub handle_type: ExternalMemoryHandleTypeFlags,
}
impl ::std::default::Default for MemoryGetZirconHandleInfoFUCHSIA {
fn default() -> MemoryGetZirconHandleInfoFUCHSIA {
MemoryGetZirconHandleInfoFUCHSIA {
s_type: StructureType::MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA,
p_next: ::std::ptr::null(),
memory: DeviceMemory::default(),
handle_type: ExternalMemoryHandleTypeFlags::default(),
}
}
}
impl MemoryGetZirconHandleInfoFUCHSIA {
pub fn builder<'a>() -> MemoryGetZirconHandleInfoFUCHSIABuilder<'a> {
MemoryGetZirconHandleInfoFUCHSIABuilder {
inner: MemoryGetZirconHandleInfoFUCHSIA::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct MemoryGetZirconHandleInfoFUCHSIABuilder<'a> {
inner: MemoryGetZirconHandleInfoFUCHSIA,
marker: ::std::marker::PhantomData<&'a ()>,
}
pub unsafe trait ExtendsMemoryGetZirconHandleInfoFUCHSIA {}
impl<'a> ::std::ops::Deref for MemoryGetZirconHandleInfoFUCHSIABuilder<'a> {
type Target = MemoryGetZirconHandleInfoFUCHSIA;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for MemoryGetZirconHandleInfoFUCHSIABuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> MemoryGetZirconHandleInfoFUCHSIABuilder<'a> {
pub fn memory(mut self, memory: DeviceMemory) -> Self {
self.inner.memory = memory;
self
}
pub fn handle_type(mut self, handle_type: ExternalMemoryHandleTypeFlags) -> Self {
self.inner.handle_type = handle_type;
self
}
#[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
#[doc = r" method only exists on structs that can be passed to a function directly. Only"]
#[doc = r" valid extension structs can be pushed into the chain."]
#[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
#[doc = r" chain will look like `A -> D -> B -> C`."]
pub fn push_next<T: ExtendsMemoryGetZirconHandleInfoFUCHSIA>(
mut self,
next: &'a mut T,
) -> Self {
unsafe {
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
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) -> MemoryGetZirconHandleInfoFUCHSIA {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryWin32HandlePropertiesKHR.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryWin32HandlePropertiesKHR.html>"]
pub struct MemoryWin32HandlePropertiesKHR { pub struct MemoryWin32HandlePropertiesKHR {
pub s_type: StructureType, pub s_type: StructureType,
@ -16425,6 +16719,172 @@ impl<'a> SemaphoreGetFdInfoKHRBuilder<'a> {
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImportSemaphoreZirconHandleInfoFUCHSIA.html>"]
pub struct ImportSemaphoreZirconHandleInfoFUCHSIA {
pub s_type: StructureType,
pub p_next: *const c_void,
pub semaphore: Semaphore,
pub flags: SemaphoreImportFlags,
pub handle_type: ExternalSemaphoreHandleTypeFlags,
pub zircon_handle: zx_handle_t,
}
impl ::std::default::Default for ImportSemaphoreZirconHandleInfoFUCHSIA {
fn default() -> ImportSemaphoreZirconHandleInfoFUCHSIA {
ImportSemaphoreZirconHandleInfoFUCHSIA {
s_type: StructureType::IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA,
p_next: ::std::ptr::null(),
semaphore: Semaphore::default(),
flags: SemaphoreImportFlags::default(),
handle_type: ExternalSemaphoreHandleTypeFlags::default(),
zircon_handle: zx_handle_t::default(),
}
}
}
impl ImportSemaphoreZirconHandleInfoFUCHSIA {
pub fn builder<'a>() -> ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> {
ImportSemaphoreZirconHandleInfoFUCHSIABuilder {
inner: ImportSemaphoreZirconHandleInfoFUCHSIA::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> {
inner: ImportSemaphoreZirconHandleInfoFUCHSIA,
marker: ::std::marker::PhantomData<&'a ()>,
}
pub unsafe trait ExtendsImportSemaphoreZirconHandleInfoFUCHSIA {}
impl<'a> ::std::ops::Deref for ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> {
type Target = ImportSemaphoreZirconHandleInfoFUCHSIA;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> ImportSemaphoreZirconHandleInfoFUCHSIABuilder<'a> {
pub fn semaphore(mut self, semaphore: Semaphore) -> Self {
self.inner.semaphore = semaphore;
self
}
pub fn flags(mut self, flags: SemaphoreImportFlags) -> Self {
self.inner.flags = flags;
self
}
pub fn handle_type(mut self, handle_type: ExternalSemaphoreHandleTypeFlags) -> Self {
self.inner.handle_type = handle_type;
self
}
pub fn zircon_handle(mut self, zircon_handle: zx_handle_t) -> Self {
self.inner.zircon_handle = zircon_handle;
self
}
#[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
#[doc = r" method only exists on structs that can be passed to a function directly. Only"]
#[doc = r" valid extension structs can be pushed into the chain."]
#[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
#[doc = r" chain will look like `A -> D -> B -> C`."]
pub fn push_next<T: ExtendsImportSemaphoreZirconHandleInfoFUCHSIA>(
mut self,
next: &'a mut T,
) -> Self {
unsafe {
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
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) -> ImportSemaphoreZirconHandleInfoFUCHSIA {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreGetZirconHandleInfoFUCHSIA.html>"]
pub struct SemaphoreGetZirconHandleInfoFUCHSIA {
pub s_type: StructureType,
pub p_next: *const c_void,
pub semaphore: Semaphore,
pub handle_type: ExternalSemaphoreHandleTypeFlags,
}
impl ::std::default::Default for SemaphoreGetZirconHandleInfoFUCHSIA {
fn default() -> SemaphoreGetZirconHandleInfoFUCHSIA {
SemaphoreGetZirconHandleInfoFUCHSIA {
s_type: StructureType::SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA,
p_next: ::std::ptr::null(),
semaphore: Semaphore::default(),
handle_type: ExternalSemaphoreHandleTypeFlags::default(),
}
}
}
impl SemaphoreGetZirconHandleInfoFUCHSIA {
pub fn builder<'a>() -> SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> {
SemaphoreGetZirconHandleInfoFUCHSIABuilder {
inner: SemaphoreGetZirconHandleInfoFUCHSIA::default(),
marker: ::std::marker::PhantomData,
}
}
}
#[repr(transparent)]
pub struct SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> {
inner: SemaphoreGetZirconHandleInfoFUCHSIA,
marker: ::std::marker::PhantomData<&'a ()>,
}
pub unsafe trait ExtendsSemaphoreGetZirconHandleInfoFUCHSIA {}
impl<'a> ::std::ops::Deref for SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> {
type Target = SemaphoreGetZirconHandleInfoFUCHSIA;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl<'a> ::std::ops::DerefMut for SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl<'a> SemaphoreGetZirconHandleInfoFUCHSIABuilder<'a> {
pub fn semaphore(mut self, semaphore: Semaphore) -> Self {
self.inner.semaphore = semaphore;
self
}
pub fn handle_type(mut self, handle_type: ExternalSemaphoreHandleTypeFlags) -> Self {
self.inner.handle_type = handle_type;
self
}
#[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
#[doc = r" method only exists on structs that can be passed to a function directly. Only"]
#[doc = r" valid extension structs can be pushed into the chain."]
#[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
#[doc = r" chain will look like `A -> D -> B -> C`."]
pub fn push_next<T: ExtendsSemaphoreGetZirconHandleInfoFUCHSIA>(
mut self,
next: &'a mut T,
) -> Self {
unsafe {
let next_ptr = next as *mut T as *mut BaseOutStructure;
let last_next = ptr_chain_iter(next).last().unwrap();
(*last_next).p_next = self.inner.p_next as _;
self.inner.p_next = next_ptr as _;
}
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) -> SemaphoreGetZirconHandleInfoFUCHSIA {
self.inner
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceExternalFenceInfo.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceExternalFenceInfo.html>"]
pub struct PhysicalDeviceExternalFenceInfo { pub struct PhysicalDeviceExternalFenceInfo {
pub s_type: StructureType, pub s_type: StructureType,

View file

@ -2763,12 +2763,16 @@ impl QueueFlags {
pub const RESERVED_6_KHR: Self = Self(0b100_0000); pub const RESERVED_6_KHR: Self = Self(0b100_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_24'"] #[doc = "Generated from 'VK_AMD_extension_24'"]
impl PipelineStageFlags { impl PipelineStageFlags2KHR {
pub const RESERVED_27_KHR: Self = Self(0b1000_0000_0000_0000_0000_0000_0000); pub const RESERVED_26: Self = Self(0b100_0000_0000_0000_0000_0000_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_24'"] #[doc = "Generated from 'VK_AMD_extension_24'"]
impl AccessFlags { impl AccessFlags2KHR {
pub const RESERVED_30_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000); pub const RESERVED_READ_35: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_AMD_extension_24'"]
impl AccessFlags2KHR {
pub const RESERVED_WRITE_36: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_24'"] #[doc = "Generated from 'VK_AMD_extension_24'"]
impl BufferUsageFlags { impl BufferUsageFlags {
@ -2830,16 +2834,16 @@ impl QueueFlags {
pub const RESERVED_5_KHR: Self = Self(0b10_0000); pub const RESERVED_5_KHR: Self = Self(0b10_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_25'"] #[doc = "Generated from 'VK_AMD_extension_25'"]
impl PipelineStageFlags { impl PipelineStageFlags2KHR {
pub const RESERVED_26_KHR: Self = Self(0b100_0000_0000_0000_0000_0000_0000); pub const RESERVED_27: Self = Self(0b1000_0000_0000_0000_0000_0000_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_25'"] #[doc = "Generated from 'VK_AMD_extension_25'"]
impl AccessFlags { impl AccessFlags2KHR {
pub const RESERVED_28_KHR: Self = Self(0b1_0000_0000_0000_0000_0000_0000_0000); pub const RESERVED_READ_37: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000_0000_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_25'"] #[doc = "Generated from 'VK_AMD_extension_25'"]
impl AccessFlags { impl AccessFlags2KHR {
pub const RESERVED_29_KHR: Self = Self(0b10_0000_0000_0000_0000_0000_0000_0000); pub const RESERVED_WRITE_38: Self = Self(0b100_0000_0000_0000_0000_0000_0000_0000_0000_0000);
} }
#[doc = "Generated from 'VK_AMD_extension_25'"] #[doc = "Generated from 'VK_AMD_extension_25'"]
impl BufferUsageFlags { impl BufferUsageFlags {
@ -25419,51 +25423,263 @@ impl FuchsiaExtension364Fn {
FuchsiaExtension364Fn {} FuchsiaExtension364Fn {}
} }
} }
impl FuchsiaExtension365Fn { impl FuchsiaExternalMemoryFn {
pub fn name() -> &'static ::std::ffi::CStr { pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_FUCHSIA_extension_365\0") ::std::ffi::CStr::from_bytes_with_nul(b"VK_FUCHSIA_external_memory\0")
.expect("Wrong extension string") .expect("Wrong extension string")
} }
pub const SPEC_VERSION: u32 = 0u32; pub const SPEC_VERSION: u32 = 1u32;
} }
pub struct FuchsiaExtension365Fn {} #[allow(non_camel_case_types)]
unsafe impl Send for FuchsiaExtension365Fn {} pub type PFN_vkGetMemoryZirconHandleFUCHSIA = extern "system" fn(
unsafe impl Sync for FuchsiaExtension365Fn {} device: Device,
impl ::std::clone::Clone for FuchsiaExtension365Fn { p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result;
#[allow(non_camel_case_types)]
pub type PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA = extern "system" fn(
device: Device,
handle_type: ExternalMemoryHandleTypeFlags,
zircon_handle: zx_handle_t,
p_memory_zircon_handle_properties: *mut MemoryZirconHandlePropertiesFUCHSIA,
) -> Result;
pub struct FuchsiaExternalMemoryFn {
pub get_memory_zircon_handle_fuchsia: extern "system" fn(
device: Device,
p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result,
pub get_memory_zircon_handle_properties_fuchsia: extern "system" fn(
device: Device,
handle_type: ExternalMemoryHandleTypeFlags,
zircon_handle: zx_handle_t,
p_memory_zircon_handle_properties: *mut MemoryZirconHandlePropertiesFUCHSIA,
) -> Result,
}
unsafe impl Send for FuchsiaExternalMemoryFn {}
unsafe impl Sync for FuchsiaExternalMemoryFn {}
impl ::std::clone::Clone for FuchsiaExternalMemoryFn {
fn clone(&self) -> Self { fn clone(&self) -> Self {
FuchsiaExtension365Fn {} FuchsiaExternalMemoryFn {
get_memory_zircon_handle_fuchsia: self.get_memory_zircon_handle_fuchsia,
get_memory_zircon_handle_properties_fuchsia: self
.get_memory_zircon_handle_properties_fuchsia,
}
} }
} }
impl FuchsiaExtension365Fn { impl FuchsiaExternalMemoryFn {
pub fn load<F>(mut _f: F) -> Self pub fn load<F>(mut _f: F) -> Self
where where
F: FnMut(&::std::ffi::CStr) -> *const c_void, F: FnMut(&::std::ffi::CStr) -> *const c_void,
{ {
FuchsiaExtension365Fn {} FuchsiaExternalMemoryFn {
get_memory_zircon_handle_fuchsia: unsafe {
extern "system" fn get_memory_zircon_handle_fuchsia(
_device: Device,
_p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA,
_p_zircon_handle: *mut zx_handle_t,
) -> Result {
panic!(concat!(
"Unable to load ",
stringify!(get_memory_zircon_handle_fuchsia)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkGetMemoryZirconHandleFUCHSIA\0",
);
let val = _f(cname);
if val.is_null() {
get_memory_zircon_handle_fuchsia
} else {
::std::mem::transmute(val)
}
},
get_memory_zircon_handle_properties_fuchsia: unsafe {
extern "system" fn get_memory_zircon_handle_properties_fuchsia(
_device: Device,
_handle_type: ExternalMemoryHandleTypeFlags,
_zircon_handle: zx_handle_t,
_p_memory_zircon_handle_properties: *mut MemoryZirconHandlePropertiesFUCHSIA,
) -> Result {
panic!(concat!(
"Unable to load ",
stringify!(get_memory_zircon_handle_properties_fuchsia)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkGetMemoryZirconHandlePropertiesFUCHSIA\0",
);
let val = _f(cname);
if val.is_null() {
get_memory_zircon_handle_properties_fuchsia
} else {
::std::mem::transmute(val)
}
},
}
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetMemoryZirconHandleFUCHSIA.html>"]
pub unsafe fn get_memory_zircon_handle_fuchsia(
&self,
device: Device,
p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result {
(self.get_memory_zircon_handle_fuchsia)(device, p_get_zircon_handle_info, p_zircon_handle)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetMemoryZirconHandlePropertiesFUCHSIA.html>"]
pub unsafe fn get_memory_zircon_handle_properties_fuchsia(
&self,
device: Device,
handle_type: ExternalMemoryHandleTypeFlags,
zircon_handle: zx_handle_t,
p_memory_zircon_handle_properties: *mut MemoryZirconHandlePropertiesFUCHSIA,
) -> Result {
(self.get_memory_zircon_handle_properties_fuchsia)(
device,
handle_type,
zircon_handle,
p_memory_zircon_handle_properties,
)
} }
} }
impl FuchsiaExtension366Fn { #[doc = "Generated from 'VK_FUCHSIA_external_memory'"]
impl StructureType {
pub const IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_364_000);
}
#[doc = "Generated from 'VK_FUCHSIA_external_memory'"]
impl StructureType {
pub const MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA: Self = Self(1_000_364_001);
}
#[doc = "Generated from 'VK_FUCHSIA_external_memory'"]
impl StructureType {
pub const MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_364_002);
}
#[doc = "Generated from 'VK_FUCHSIA_external_memory'"]
impl ExternalMemoryHandleTypeFlags {
pub const ZIRCON_VMO_FUCHSIA: Self = Self(0b1000_0000_0000);
}
impl FuchsiaExternalSemaphoreFn {
pub fn name() -> &'static ::std::ffi::CStr { pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_FUCHSIA_extension_366\0") ::std::ffi::CStr::from_bytes_with_nul(b"VK_FUCHSIA_external_semaphore\0")
.expect("Wrong extension string") .expect("Wrong extension string")
} }
pub const SPEC_VERSION: u32 = 0u32; pub const SPEC_VERSION: u32 = 1u32;
} }
pub struct FuchsiaExtension366Fn {} #[allow(non_camel_case_types)]
unsafe impl Send for FuchsiaExtension366Fn {} pub type PFN_vkImportSemaphoreZirconHandleFUCHSIA = extern "system" fn(
unsafe impl Sync for FuchsiaExtension366Fn {} device: Device,
impl ::std::clone::Clone for FuchsiaExtension366Fn { p_import_semaphore_zircon_handle_info: *const ImportSemaphoreZirconHandleInfoFUCHSIA,
) -> Result;
#[allow(non_camel_case_types)]
pub type PFN_vkGetSemaphoreZirconHandleFUCHSIA = extern "system" fn(
device: Device,
p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result;
pub struct FuchsiaExternalSemaphoreFn {
pub import_semaphore_zircon_handle_fuchsia: extern "system" fn(
device: Device,
p_import_semaphore_zircon_handle_info: *const ImportSemaphoreZirconHandleInfoFUCHSIA,
) -> Result,
pub get_semaphore_zircon_handle_fuchsia: extern "system" fn(
device: Device,
p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result,
}
unsafe impl Send for FuchsiaExternalSemaphoreFn {}
unsafe impl Sync for FuchsiaExternalSemaphoreFn {}
impl ::std::clone::Clone for FuchsiaExternalSemaphoreFn {
fn clone(&self) -> Self { fn clone(&self) -> Self {
FuchsiaExtension366Fn {} FuchsiaExternalSemaphoreFn {
import_semaphore_zircon_handle_fuchsia: self.import_semaphore_zircon_handle_fuchsia,
get_semaphore_zircon_handle_fuchsia: self.get_semaphore_zircon_handle_fuchsia,
}
} }
} }
impl FuchsiaExtension366Fn { impl FuchsiaExternalSemaphoreFn {
pub fn load<F>(mut _f: F) -> Self pub fn load<F>(mut _f: F) -> Self
where where
F: FnMut(&::std::ffi::CStr) -> *const c_void, F: FnMut(&::std::ffi::CStr) -> *const c_void,
{ {
FuchsiaExtension366Fn {} FuchsiaExternalSemaphoreFn {
import_semaphore_zircon_handle_fuchsia: unsafe {
extern "system" fn import_semaphore_zircon_handle_fuchsia(
_device: Device,
_p_import_semaphore_zircon_handle_info : * const ImportSemaphoreZirconHandleInfoFUCHSIA,
) -> Result {
panic!(concat!(
"Unable to load ",
stringify!(import_semaphore_zircon_handle_fuchsia)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkImportSemaphoreZirconHandleFUCHSIA\0",
);
let val = _f(cname);
if val.is_null() {
import_semaphore_zircon_handle_fuchsia
} else {
::std::mem::transmute(val)
}
},
get_semaphore_zircon_handle_fuchsia: unsafe {
extern "system" fn get_semaphore_zircon_handle_fuchsia(
_device: Device,
_p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA,
_p_zircon_handle: *mut zx_handle_t,
) -> Result {
panic!(concat!(
"Unable to load ",
stringify!(get_semaphore_zircon_handle_fuchsia)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkGetSemaphoreZirconHandleFUCHSIA\0",
);
let val = _f(cname);
if val.is_null() {
get_semaphore_zircon_handle_fuchsia
} else {
::std::mem::transmute(val)
}
},
}
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkImportSemaphoreZirconHandleFUCHSIA.html>"]
pub unsafe fn import_semaphore_zircon_handle_fuchsia(
&self,
device: Device,
p_import_semaphore_zircon_handle_info: *const ImportSemaphoreZirconHandleInfoFUCHSIA,
) -> Result {
(self.import_semaphore_zircon_handle_fuchsia)(device, p_import_semaphore_zircon_handle_info)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreZirconHandleFUCHSIA.html>"]
pub unsafe fn get_semaphore_zircon_handle_fuchsia(
&self,
device: Device,
p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA,
p_zircon_handle: *mut zx_handle_t,
) -> Result {
(self.get_semaphore_zircon_handle_fuchsia)(
device,
p_get_zircon_handle_info,
p_zircon_handle,
)
}
}
#[doc = "Generated from 'VK_FUCHSIA_external_semaphore'"]
impl StructureType {
pub const IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_365_000);
}
#[doc = "Generated from 'VK_FUCHSIA_external_semaphore'"]
impl StructureType {
pub const SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA: Self = Self(1_000_365_001);
}
#[doc = "Generated from 'VK_FUCHSIA_external_semaphore'"]
impl ExternalSemaphoreHandleTypeFlags {
pub const ZIRCON_EVENT_FUCHSIA: Self = Self(0b1000_0000);
} }
impl FuchsiaExtension367Fn { impl FuchsiaExtension367Fn {
pub fn name() -> &'static ::std::ffi::CStr { pub fn name() -> &'static ::std::ffi::CStr {
@ -25776,12 +25992,41 @@ impl QnxScreenSurfaceFn {
} }
pub const SPEC_VERSION: u32 = 1u32; pub const SPEC_VERSION: u32 = 1u32;
} }
pub struct QnxScreenSurfaceFn {} #[allow(non_camel_case_types)]
pub type PFN_vkCreateScreenSurfaceQNX = extern "system" fn(
instance: Instance,
p_create_info: *const ScreenSurfaceCreateInfoQNX,
p_allocator: *const AllocationCallbacks,
p_surface: *mut SurfaceKHR,
) -> Result;
#[allow(non_camel_case_types)]
pub type PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX = extern "system" fn(
physical_device: PhysicalDevice,
queue_family_index: u32,
window: *mut _screen_window,
) -> Bool32;
pub struct QnxScreenSurfaceFn {
pub create_screen_surface_qnx: extern "system" fn(
instance: Instance,
p_create_info: *const ScreenSurfaceCreateInfoQNX,
p_allocator: *const AllocationCallbacks,
p_surface: *mut SurfaceKHR,
) -> Result,
pub get_physical_device_screen_presentation_support_qnx: extern "system" fn(
physical_device: PhysicalDevice,
queue_family_index: u32,
window: *mut _screen_window,
) -> Bool32,
}
unsafe impl Send for QnxScreenSurfaceFn {} unsafe impl Send for QnxScreenSurfaceFn {}
unsafe impl Sync for QnxScreenSurfaceFn {} unsafe impl Sync for QnxScreenSurfaceFn {}
impl ::std::clone::Clone for QnxScreenSurfaceFn { impl ::std::clone::Clone for QnxScreenSurfaceFn {
fn clone(&self) -> Self { fn clone(&self) -> Self {
QnxScreenSurfaceFn {} QnxScreenSurfaceFn {
create_screen_surface_qnx: self.create_screen_surface_qnx,
get_physical_device_screen_presentation_support_qnx: self
.get_physical_device_screen_presentation_support_qnx,
}
} }
} }
impl QnxScreenSurfaceFn { impl QnxScreenSurfaceFn {
@ -25789,7 +26034,73 @@ impl QnxScreenSurfaceFn {
where where
F: FnMut(&::std::ffi::CStr) -> *const c_void, F: FnMut(&::std::ffi::CStr) -> *const c_void,
{ {
QnxScreenSurfaceFn {} QnxScreenSurfaceFn {
create_screen_surface_qnx: unsafe {
extern "system" fn create_screen_surface_qnx(
_instance: Instance,
_p_create_info: *const ScreenSurfaceCreateInfoQNX,
_p_allocator: *const AllocationCallbacks,
_p_surface: *mut SurfaceKHR,
) -> Result {
panic!(concat!(
"Unable to load ",
stringify!(create_screen_surface_qnx)
))
}
let cname =
::std::ffi::CStr::from_bytes_with_nul_unchecked(b"vkCreateScreenSurfaceQNX\0");
let val = _f(cname);
if val.is_null() {
create_screen_surface_qnx
} else {
::std::mem::transmute(val)
}
},
get_physical_device_screen_presentation_support_qnx: unsafe {
extern "system" fn get_physical_device_screen_presentation_support_qnx(
_physical_device: PhysicalDevice,
_queue_family_index: u32,
_window: *mut _screen_window,
) -> Bool32 {
panic!(concat!(
"Unable to load ",
stringify!(get_physical_device_screen_presentation_support_qnx)
))
}
let cname = ::std::ffi::CStr::from_bytes_with_nul_unchecked(
b"vkGetPhysicalDeviceScreenPresentationSupportQNX\0",
);
let val = _f(cname);
if val.is_null() {
get_physical_device_screen_presentation_support_qnx
} else {
::std::mem::transmute(val)
}
},
}
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateScreenSurfaceQNX.html>"]
pub unsafe fn create_screen_surface_qnx(
&self,
instance: Instance,
p_create_info: *const ScreenSurfaceCreateInfoQNX,
p_allocator: *const AllocationCallbacks,
p_surface: *mut SurfaceKHR,
) -> Result {
(self.create_screen_surface_qnx)(instance, p_create_info, p_allocator, p_surface)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceScreenPresentationSupportQNX.html>"]
pub unsafe fn get_physical_device_screen_presentation_support_qnx(
&self,
physical_device: PhysicalDevice,
queue_family_index: u32,
window: *mut _screen_window,
) -> Bool32 {
(self.get_physical_device_screen_presentation_support_qnx)(
physical_device,
queue_family_index,
window,
)
} }
} }
#[doc = "Generated from 'VK_QNX_screen_surface'"] #[doc = "Generated from 'VK_QNX_screen_surface'"]
@ -25980,3 +26291,118 @@ impl KhrExtension387Fn {
KhrExtension387Fn {} KhrExtension387Fn {}
} }
} }
impl ExtExtension388Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_388\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
pub struct ExtExtension388Fn {}
unsafe impl Send for ExtExtension388Fn {}
unsafe impl Sync for ExtExtension388Fn {}
impl ::std::clone::Clone for ExtExtension388Fn {
fn clone(&self) -> Self {
ExtExtension388Fn {}
}
}
impl ExtExtension388Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension388Fn {}
}
}
impl ExtExtension389Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_389\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
pub struct ExtExtension389Fn {}
unsafe impl Send for ExtExtension389Fn {}
unsafe impl Sync for ExtExtension389Fn {}
impl ::std::clone::Clone for ExtExtension389Fn {
fn clone(&self) -> Self {
ExtExtension389Fn {}
}
}
impl ExtExtension389Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension389Fn {}
}
}
impl ExtExtension390Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_390\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
pub struct ExtExtension390Fn {}
unsafe impl Send for ExtExtension390Fn {}
unsafe impl Sync for ExtExtension390Fn {}
impl ::std::clone::Clone for ExtExtension390Fn {
fn clone(&self) -> Self {
ExtExtension390Fn {}
}
}
impl ExtExtension390Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension390Fn {}
}
}
impl ExtExtension391Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_391\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
pub struct ExtExtension391Fn {}
unsafe impl Send for ExtExtension391Fn {}
unsafe impl Sync for ExtExtension391Fn {}
impl ::std::clone::Clone for ExtExtension391Fn {
fn clone(&self) -> Self {
ExtExtension391Fn {}
}
}
impl ExtExtension391Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension391Fn {}
}
}
impl ExtExtension392Fn {
pub fn name() -> &'static ::std::ffi::CStr {
::std::ffi::CStr::from_bytes_with_nul(b"VK_EXT_extension_392\0")
.expect("Wrong extension string")
}
pub const SPEC_VERSION: u32 = 0u32;
}
pub struct ExtExtension392Fn {}
unsafe impl Send for ExtExtension392Fn {}
unsafe impl Sync for ExtExtension392Fn {}
impl ::std::clone::Clone for ExtExtension392Fn {
fn clone(&self) -> Self {
ExtExtension392Fn {}
}
}
impl ExtExtension392Fn {
pub fn load<F>(mut _f: F) -> Self
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
ExtExtension392Fn {}
}
}

View file

@ -24,10 +24,19 @@ pub type LPCWSTR = *const u16;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub type zx_handle_t = u32; pub type zx_handle_t = u32;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub type _screen_context = c_void;
#[allow(non_camel_case_types)]
pub type _screen_window = c_void;
// FIXME: Platform specific types that should come from a library id:0
// typedefs are only here so that the code compiles for now
#[allow(non_camel_case_types)]
pub type SECURITY_ATTRIBUTES = (); pub type SECURITY_ATTRIBUTES = ();
// Opaque types
pub type ANativeWindow = c_void; pub type ANativeWindow = c_void;
pub type AHardwareBuffer = c_void; pub type AHardwareBuffer = c_void;
pub type CAMetalLayer = c_void; pub type CAMetalLayer = c_void;
// This definition is behind an NDA with a best effort guess from
// https://github.com/google/gapid/commit/22aafebec4638c6aaa77667096bca30f6e842d95#diff-ab3ab4a7d89b4fc8a344ff4e9332865f268ea1669ee379c1b516a954ecc2e7a6R20-R21
pub type GgpStreamDescriptor = u32; pub type GgpStreamDescriptor = u32;
pub type GgpFrameToken = u64; pub type GgpFrameToken = u64;
pub type IDirectFB = c_void; pub type IDirectFB = c_void;

@ -1 +1 @@
Subproject commit 1d99b835ec3cd5a7fb2f2a2dd9a615ee2d1f0101 Subproject commit e1d8c4931d8e4b6c4a8e633c163ed3aa82d6ac1c

View file

@ -2,7 +2,10 @@
use heck::{CamelCase, ShoutySnakeCase, SnakeCase}; use heck::{CamelCase, ShoutySnakeCase, SnakeCase};
use itertools::Itertools; use itertools::Itertools;
use nom::{alt, char, do_parse, map, named, opt, tag, take_while1, terminated}; use nom::{
alt, character::complete::digit1, delimited, do_parse, map, named, one_of, opt, pair, preceded,
tag, terminated,
};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree}; use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
use quote::*; use quote::*;
@ -39,46 +42,49 @@ impl quote::ToTokens for CType {
named!(ctype<&str, CType>, named!(ctype<&str, CType>,
alt!( alt!(
tag!("ULL") => { |_| CType::U64 } | tag!("ULL") => { |_| CType::U64 } |
tag!("U") => { |_| CType::U32 } tag!("U") => { |_| CType::U32 }
) )
); );
named!(cexpr<&str, (CType, String)>, named!(cexpr<&str, (CType, String)>,
alt!( alt!(
map!(cfloat, |f| (CType::Float, format!("{:.2}", f))) | map!(cfloat, |f| (CType::Float, format!("{:.2}", f))) |
inverse_number inverse_number
) )
);
named!(decimal_number<&str, (CType, String)>,
do_parse!(
num: digit1 >>
typ: ctype >>
((typ, num.to_string()))
)
); );
named!(inverse_number<&str, (CType, String)>, named!(inverse_number<&str, (CType, String)>,
do_parse!( map!(
tag!("(")>> delimited!(
tag!("~") >> tag!("("),
s: take_while1!(|c: char| c.is_digit(10)) >> pair!(
ctype: ctype >> preceded!(tag!("~"), decimal_number),
minus_num: opt!( opt!(preceded!(tag!("-"), digit1))
do_parse!( ),
tag!("-") >> tag!(")")
n: take_while1!(|c: char| c.is_digit(10)) >> ),
(n) |((ctyp, num), minus_num)| {
) let expr = if let Some(minus) = minus_num {
) >> format!("!{}-{}", num, minus)
tag!(")") >>
(
{
let expr = if let Some(minus) = minus_num {
format!("!{}-{}", s, minus)
}
else{
format!("!{}", s)
};
(ctype, expr)
} }
) else{
format!("!{}", num)
};
(ctyp, expr)
}
) )
); );
named!(cfloat<&str, f32>, named!(cfloat<&str, f32>,
terminated!(nom::number::complete::float, char!('f')) terminated!(nom::number::complete::float, one_of!("fF"))
); );
fn khronos_link<S: Display + ?Sized>(name: &S) -> Literal { fn khronos_link<S: Display + ?Sized>(name: &S) -> Literal {
@ -344,49 +350,6 @@ fn is_opaque_type(ty: &str) -> bool {
) )
} }
pub fn platform_specific_types() -> TokenStream {
quote! {
pub type RROutput = c_ulong;
pub type VisualID = c_uint;
pub type Display = *const c_void;
pub type Window = c_ulong;
#[allow(non_camel_case_types)]
pub type xcb_connection_t = c_void;
#[allow(non_camel_case_types)]
pub type xcb_window_t = u32;
#[allow(non_camel_case_types)]
pub type xcb_visualid_t = u32;
pub type MirConnection = *const c_void;
pub type MirSurface = *const c_void;
pub type HINSTANCE = *const c_void;
pub type HWND = *const c_void;
#[allow(non_camel_case_types)]
pub type wl_display = c_void;
#[allow(non_camel_case_types)]
pub type wl_surface = c_void;
pub type HANDLE = *mut c_void;
pub type HMONITOR = HANDLE;
pub type DWORD = c_ulong;
pub type LPCWSTR = *const u16;
#[allow(non_camel_case_types)]
pub type zx_handle_t = u32;
// FIXME: Platform specific types that should come from a library id:0
// typedefs are only here so that the code compiles for now
#[allow(non_camel_case_types)]
pub type SECURITY_ATTRIBUTES = ();
// Opaque types
pub type ANativeWindow = c_void;
pub type AHardwareBuffer = c_void;
pub type CAMetalLayer = c_void;
// This definition is behind an NDA with a best effort guess from
// https://github.com/google/gapid/commit/22aafebec4638c6aaa77667096bca30f6e842d95#diff-ab3ab4a7d89b4fc8a344ff4e9332865f268ea1669ee379c1b516a954ecc2e7a6R20-R21
pub type GgpStreamDescriptor = u32;
pub type GgpFrameToken = u64;
pub type IDirectFB = c_void;
pub type IDirectFBSurface = c_void;
}
}
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub enum ConstVal { pub enum ConstVal {
U32(u32), U32(u32),
@ -2652,7 +2615,6 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
let handle_nondispatchable_macro = handle_nondispatchable_macro(); let handle_nondispatchable_macro = handle_nondispatchable_macro();
let define_handle_macro = define_handle_macro(); let define_handle_macro = define_handle_macro();
let version_macros = vk_version_macros(); let version_macros = vk_version_macros();
let platform_specific_types = platform_specific_types();
let ptr_chain_code = quote! { let ptr_chain_code = quote! {
/// Iterates through the pointer chain. Includes the item that is passed into the function. /// Iterates through the pointer chain. Includes the item that is passed into the function.
@ -2691,8 +2653,6 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
let mut vk_features_file = File::create(vk_dir.join("features.rs")).expect("vk/features.rs"); let mut vk_features_file = File::create(vk_dir.join("features.rs")).expect("vk/features.rs");
let mut vk_definitions_file = let mut vk_definitions_file =
File::create(vk_dir.join("definitions.rs")).expect("vk/definitions.rs"); File::create(vk_dir.join("definitions.rs")).expect("vk/definitions.rs");
let mut vk_platform_types_file =
File::create(vk_dir.join("platform_types.rs")).expect("vk/platform_types.rs");
let mut vk_enums_file = File::create(vk_dir.join("enums.rs")).expect("vk/enums.rs"); let mut vk_enums_file = File::create(vk_dir.join("enums.rs")).expect("vk/enums.rs");
let mut vk_bitflags_file = File::create(vk_dir.join("bitflags.rs")).expect("vk/bitflags.rs"); let mut vk_bitflags_file = File::create(vk_dir.join("bitflags.rs")).expect("vk/bitflags.rs");
let mut vk_constants_file = File::create(vk_dir.join("constants.rs")).expect("vk/constants.rs"); let mut vk_constants_file = File::create(vk_dir.join("constants.rs")).expect("vk/constants.rs");
@ -2770,11 +2730,6 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
#(#aliases)* #(#aliases)*
}; };
let platform_types_code = quote! {
use std::os::raw::*;
#platform_specific_types
};
// These are defined outside of `quote!` because rustfmt doesn't seem // These are defined outside of `quote!` because rustfmt doesn't seem
// to format them correctly when they contain extra spaces. // to format them correctly when they contain extra spaces.
let vk_rs_clippy_lints = r#" let vk_rs_clippy_lints = r#"
@ -2816,8 +2771,6 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
}; };
write!(&mut vk_macros_file, "{}", macros_code).expect("Unable to write vk/macros.rs"); write!(&mut vk_macros_file, "{}", macros_code).expect("Unable to write vk/macros.rs");
write!(&mut vk_platform_types_file, "{}", platform_types_code)
.expect("Unable to write to vk/platform_types.rs");
write!(&mut vk_features_file, "{}", feature_code).expect("Unable to write vk/features.rs"); write!(&mut vk_features_file, "{}", feature_code).expect("Unable to write vk/features.rs");
write!(&mut vk_definitions_file, "{}", definition_code) write!(&mut vk_definitions_file, "{}", definition_code)
.expect("Unable to write vk/definitions.rs"); .expect("Unable to write vk/definitions.rs");