diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/ash/src/vk.rs | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
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 | 43 |
1 files changed, 43 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..b6f4ef4fe0 --- /dev/null +++ b/third_party/rust/ash/src/vk.rs @@ -0,0 +1,43 @@ +#![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::*; +mod const_debugs; +pub(crate) use 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 platform_types; +pub use platform_types::*; +#[doc = r" Iterates through the pointer chain. Includes the item that is passed into the function."] +#[doc = r" Stops at the last `BaseOutStructure` that has a null `p_next` field."] +pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> { + let ptr: *mut BaseOutStructure = ptr as *mut T as _; + (0..).scan(ptr, |p_ptr, _| { + if p_ptr.is_null() { + return None; + } + let n_ptr = (**p_ptr).p_next as *mut BaseOutStructure; + 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; +} |