summaryrefslogtreecommitdiffstats
path: root/third_party/rust/ash/src/vk.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/ash/src/vk.rs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.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.rs52
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;
+}