ash/
vk.rs

1#![allow(
2    clippy::too_many_arguments,
3    clippy::cognitive_complexity,
4    clippy::wrong_self_convention
5)]
6#[macro_use]
7mod macros;
8pub use macros::*;
9mod aliases;
10pub use aliases::*;
11mod bitflags;
12pub use bitflags::*;
13#[cfg(feature = "debug")]
14mod const_debugs;
15mod constants;
16pub use constants::*;
17mod definitions;
18pub use definitions::*;
19mod enums;
20pub use enums::*;
21mod extensions;
22pub use extensions::*;
23mod feature_extensions;
24pub use feature_extensions::*;
25mod features;
26pub use features::*;
27mod prelude;
28pub use prelude::*;
29/// Native bindings from Vulkan headers, generated by bindgen
30#[allow(clippy::useless_transmute, nonstandard_style)]
31pub mod native;
32mod platform_types;
33pub use platform_types::*;
34/// Iterates through the pointer chain. Includes the item that is passed into the function.
35/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field.
36pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> {
37    let ptr = <*mut T>::cast::<BaseOutStructure>(ptr);
38    (0..).scan(ptr, |p_ptr, _| {
39        if p_ptr.is_null() {
40            return None;
41        }
42        let n_ptr = (**p_ptr).p_next;
43        let old = *p_ptr;
44        *p_ptr = n_ptr;
45        Some(old)
46    })
47}
48pub trait Handle {
49    const TYPE: ObjectType;
50    fn as_raw(self) -> u64;
51    fn from_raw(_: u64) -> Self;
52}