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(nonstandard_style)]
31#[allow(deref_nullptr)]
32#[allow(trivial_casts, trivial_numeric_casts)]
33pub mod native;
34mod platform_types;
35pub use platform_types::*;
36/// Iterates through the pointer chain. Includes the item that is passed into the function.
37/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field.
38pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> {
39    let ptr = <*mut T>::cast::<BaseOutStructure>(ptr);
40    (0..).scan(ptr, |p_ptr, _| {
41        if p_ptr.is_null() {
42            return None;
43        }
44        let n_ptr = (**p_ptr).p_next;
45        let old = *p_ptr;
46        *p_ptr = n_ptr;
47        Some(old)
48    })
49}
50pub trait Handle {
51    const TYPE: ObjectType;
52    fn as_raw(self) -> u64;
53    fn from_raw(_: u64) -> Self;
54}