1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! The [`PNextChainable`] trait — generated implementations of this trait
//! identify every Vulkan struct that can be linked into a `pNext` chain.
//!
//! Every Vulkan struct whose first two fields are
//! `sType: VkStructureType` followed by `pNext: *mut c_void` gets a
//! generated `unsafe impl PNextChainable for VkFoo` in the raw bindings.
//! The trait carries the `VkStructureType` value the Vulkan spec assigns
//! to that struct and exposes raw-pointer casts to the common
//! [`VkBaseOutStructure`] head so that generic chain-walking code in
//! [`crate::safe::pnext`] can stitch them together.
//!
//! Users should never need to implement this trait by hand — the
//! code generator emits one impl per qualifying struct in `vk.xml`.
use ;
/// Marker + helper trait for Vulkan structs that can participate in a
/// `pNext` chain.
///
/// # Safety
///
/// Implementors must be `#[repr(C)]` with:
///
/// 1. `sType: VkStructureType` as the first field (offset 0).
/// 2. `pNext: *mut c_void` as the second field (immediately after
/// `sType`, so that a pointer to the struct can be cast to
/// [`*mut VkBaseOutStructure`] without violating layout rules).
///
/// [`STRUCTURE_TYPE`](Self::STRUCTURE_TYPE) must be the exact
/// `VkStructureType` enumerant the Vulkan spec requires for this struct
/// — driver behaviour when sType disagrees is undefined.
pub unsafe