| 1 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 2 | #[cfg_attr(target_arch = "spirv", repr(simd))] |
| 3 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 4 | pub struct XYrust-analyzer cargo glam 0.19.0 core/storage/XY#<T> { |
| 5 | pub xrust-analyzer cargo glam 0.19.0 core/storage/XY#x.: T, |
| 6 | pub yrust-analyzer cargo glam 0.19.0 core/storage/XY#y.: T, |
| 7 | } |
| 8 | |
| 9 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 10 | #[cfg_attr(target_arch = "spirv", repr(simd))] |
| 11 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 12 | pub struct XYZrust-analyzer cargo glam 0.19.0 core/storage/XYZ#<T> { |
| 13 | pub xrust-analyzer cargo glam 0.19.0 core/storage/XYZ#x.: T, |
| 14 | pub yrust-analyzer cargo glam 0.19.0 core/storage/XYZ#y.: T, |
| 15 | pub zrust-analyzer cargo glam 0.19.0 core/storage/XYZ#z.: T, |
| 16 | } |
| 17 | |
| 18 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 19 | #[cfg_attr(target_arch = "spirv", repr(simd))] |
| 20 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 21 | pub struct XYZWrust-analyzer cargo glam 0.19.0 core/storage/XYZW#<T> { |
| 22 | pub xrust-analyzer cargo glam 0.19.0 core/storage/XYZW#x.: T, |
| 23 | pub yrust-analyzer cargo glam 0.19.0 core/storage/XYZW#y.: T, |
| 24 | pub zrust-analyzer cargo glam 0.19.0 core/storage/XYZW#z.: T, |
| 25 | pub wrust-analyzer cargo glam 0.19.0 core/storage/XYZW#w.: T, |
| 26 | } |
| 27 | |
| 28 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 29 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 30 | pub struct Columns2rust-analyzer cargo glam 0.19.0 core/storage/Columns2#<V> { |
| 31 | pub x_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns2#x_axis.: V, |
| 32 | pub y_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns2#y_axis.: V, |
| 33 | } |
| 34 | |
| 35 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 36 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 37 | pub struct Columns3rust-analyzer cargo glam 0.19.0 core/storage/Columns3#<V> { |
| 38 | pub x_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns3#x_axis.: V, |
| 39 | pub y_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns3#y_axis.: V, |
| 40 | pub z_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns3#z_axis.: V, |
| 41 | } |
| 42 | |
| 43 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 44 | #[cfg_attr(not(target_arch = "spirv"), repr(C))] |
| 45 | pub struct Columns4rust-analyzer cargo glam 0.19.0 core/storage/Columns4#<V> { |
| 46 | pub x_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns4#x_axis.: V, |
| 47 | pub y_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns4#y_axis.: V, |
| 48 | pub z_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns4#z_axis.: V, |
| 49 | pub w_axisrust-analyzer cargo glam 0.19.0 core/storage/Columns4#w_axis.: V, |
| 50 | } |
| 51 | |
| 52 | /// Ths XYZF32A16 is used for the Vec3A type, that is a 16 btye aligned XYZ<f32> type. |
| 53 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 54 | #[cfg_attr(target_arch = "spirv", repr(simd))] |
| 55 | #[cfg_attr(not(target_arch = "spirv"), repr(align(16), C))] |
| 56 | pub struct XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16# { |
| 57 | pub xrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#x.: f32, |
| 58 | pub yrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#y.: f32, |
| 59 | pub zrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#z.: f32, |
| 60 | } |
| 61 | |
| 62 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<XYZWrust-analyzer cargo glam 0.19.0 core/storage/XYZW#<f32>> for XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16# { |
| 63 | #[inline(always)] |
| 64 | fn fromrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZW<f32>>`]from().(v: XYZWrust-analyzer cargo glam 0.19.0 core/storage/XYZW#<f32>) -> Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZW<f32>>`] { |
| 65 | Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZW<f32>>`] { |
| 66 | xrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#x.: v.xrust-analyzer cargo glam 0.19.0 core/storage/XYZW#x., |
| 67 | yrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#y.: v.yrust-analyzer cargo glam 0.19.0 core/storage/XYZW#y., |
| 68 | zrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#z.: v.zrust-analyzer cargo glam 0.19.0 core/storage/XYZW#z., |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<XYZrust-analyzer cargo glam 0.19.0 core/storage/XYZ#<f32>> for XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16# { |
| 74 | #[inline(always)] |
| 75 | fn fromrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZ<f32>>`]from().(v: XYZrust-analyzer cargo glam 0.19.0 core/storage/XYZ#<f32>) -> Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZ<f32>>`] { |
| 76 | Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[XYZF32A16][`From<XYZ<f32>>`] { |
| 77 | xrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#x.: v.xrust-analyzer cargo glam 0.19.0 core/storage/XYZ#x., |
| 78 | yrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#y.: v.yrust-analyzer cargo glam 0.19.0 core/storage/XYZ#y., |
| 79 | zrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#z.: v.zrust-analyzer cargo glam 0.19.0 core/storage/XYZ#z., |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#> for XYZrust-analyzer cargo glam 0.19.0 core/storage/XYZ#<f32> { |
| 85 | #[inline(always)] |
| 86 | fn fromrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XYZ<f32>`][`From<XYZF32A16>`]from().(v: XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#) -> Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XYZ<f32>`][`From<XYZF32A16>`] { |
| 87 | Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XYZ<f32>`][`From<XYZF32A16>`] { |
| 88 | xrust-analyzer cargo glam 0.19.0 core/storage/XYZ#x.: v.xrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#x., |
| 89 | yrust-analyzer cargo glam 0.19.0 core/storage/XYZ#y.: v.yrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#y., |
| 90 | zrust-analyzer cargo glam 0.19.0 core/storage/XYZ#z.: v.zrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#z., |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#> for XYrust-analyzer cargo glam 0.19.0 core/storage/XY#<f32> { |
| 96 | #[inline(always)] |
| 97 | fn fromrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XY<f32>`][`From<XYZF32A16>`]from().(v: XYZF32A16rust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#) -> Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XY<f32>`][`From<XYZF32A16>`] { |
| 98 | Selfrust-analyzer cargo glam 0.19.0 core/storage/impl#[`XY<f32>`][`From<XYZF32A16>`] { xrust-analyzer cargo glam 0.19.0 core/storage/XY#x.: v.xrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#x., yrust-analyzer cargo glam 0.19.0 core/storage/XY#y.: v.yrust-analyzer cargo glam 0.19.0 core/storage/XYZF32A16#y. } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:)] |
| 103 | #[repr(align(16))] |
| 104 | pub(craterust-analyzer cargo glam 0.19.0 crate/) struct Align16rust-analyzer cargo glam 0.19.0 core/storage/Align16#<T>(pub T); |
| 105 | |
| 106 | impl<T> Align16rust-analyzer cargo glam 0.19.0 core/storage/Align16#<T> { |
| 107 | #[allow(dead_code)] |
| 108 | pub fn as_ptrrust-analyzer cargo glam 0.19.0 core/storage/impl#[`Align16<T>`]as_ptr().(&self) -> *const T { |
| 109 | &self.0rust-analyzer cargo glam 0.19.0 core/storage/Align16#0. |
| 110 | } |
| 111 | |
| 112 | #[allow(dead_code)] |
| 113 | pub fn as_mut_ptrrust-analyzer cargo glam 0.19.0 core/storage/impl#[`Align16<T>`]as_mut_ptr().(&mut self) -> *mut T { |
| 114 | &mut self.0rust-analyzer cargo glam 0.19.0 core/storage/Align16#0. |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | #[test] |
| 119 | fn test_align16() { |
| 120 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/, ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/}; |
| 121 | let mut a = Align16rust-analyzer cargo glam 0.19.0 core/storage/Align16#::<f32>(1.0); |
| 122 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(mem::align_of_val(&a), 16); |
| 123 | unsafe { |
| 124 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ptr::read(a.as_ptr()).to_bits(), f32::to_bits(1.0)); |
| 125 | ptr::write(a.as_mut_ptr(), -1.0); |
| 126 | } |
| 127 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(a.0.to_bits(), f32::to_bits(-1.0)); |
| 128 | } |