diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /third_party/rust/ash/src/vk.rs | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/ash/src/vk.rs')
-rw-r--r-- | third_party/rust/ash/src/vk.rs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/third_party/rust/ash/src/vk.rs b/third_party/rust/ash/src/vk.rs new file mode 100644 index 0000000000..02a5e9c627 --- /dev/null +++ b/third_party/rust/ash/src/vk.rs @@ -0,0 +1,52 @@ +#![allow( + clippy::too_many_arguments, + clippy::cognitive_complexity, + clippy::wrong_self_convention +)] +#[macro_use] +mod macros; +pub use macros::*; +mod aliases; +pub use aliases::*; +mod bitflags; +pub use bitflags::*; +#[cfg(feature = "debug")] +mod const_debugs; +mod constants; +pub use constants::*; +mod definitions; +pub use definitions::*; +mod enums; +pub use enums::*; +mod extensions; +pub use extensions::*; +mod feature_extensions; +pub use feature_extensions::*; +mod features; +pub use features::*; +mod prelude; +pub use prelude::*; +/// Native bindings from Vulkan headers, generated by bindgen +#[allow(clippy::useless_transmute, nonstandard_style)] +pub mod native; +mod platform_types; +pub use platform_types::*; +/// Iterates through the pointer chain. Includes the item that is passed into the function. +/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field. +pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> { + let ptr = <*mut T>::cast::<BaseOutStructure>(ptr); + (0..).scan(ptr, |p_ptr, _| { + if p_ptr.is_null() { + return None; + } + let n_ptr = (**p_ptr).p_next; + let old = *p_ptr; + *p_ptr = n_ptr; + Some(old) + }) +} +pub trait Handle { + const TYPE: ObjectType; + fn as_raw(self) -> u64; + fn from_raw(_: u64) -> Self; +} |