@@ -27,43 +27,7 @@ use super::{
2727 mesh:: Mesh ,
2828 RenderContext ,
2929} ;
30-
31- /// Marker trait for types that are safe to reinterpret as raw bytes.
32- ///
33- /// This trait is required by `Buffer::write_value`, `Buffer::write_slice`, and
34- /// `BufferBuilder::build` because those APIs upload the in-memory representation
35- /// of a value to the GPU.
36- ///
37- /// # Safety
38- /// Types implementing `PlainOldData` MUST satisfy all of the following:
39- /// - Every byte of the value is initialized (including any padding bytes).
40- /// - The type has no pointers or references that would be invalidated by a
41- /// raw byte copy.
42- /// - The type's byte representation is stable for GPU consumption. Prefer
43- /// `#[repr(C)]` or `#[repr(transparent)]`.
44- ///
45- /// Implementing this trait incorrectly can cause undefined behavior.
46- pub unsafe trait PlainOldData : Copy { }
47-
48- unsafe impl PlainOldData for u8 { }
49- unsafe impl PlainOldData for i8 { }
50- unsafe impl PlainOldData for u16 { }
51- unsafe impl PlainOldData for i16 { }
52- unsafe impl PlainOldData for u32 { }
53- unsafe impl PlainOldData for i32 { }
54- unsafe impl PlainOldData for u64 { }
55- unsafe impl PlainOldData for i64 { }
56- unsafe impl PlainOldData for u128 { }
57- unsafe impl PlainOldData for i128 { }
58- unsafe impl PlainOldData for usize { }
59- unsafe impl PlainOldData for isize { }
60- unsafe impl PlainOldData for f32 { }
61- unsafe impl PlainOldData for f64 { }
62- unsafe impl PlainOldData for bool { }
63- unsafe impl PlainOldData for char { }
64- unsafe impl < T : PlainOldData , const N : usize > PlainOldData for [ T ; N ] { }
65-
66- unsafe impl PlainOldData for super :: vertex:: Vertex { }
30+ pub use crate :: pod:: PlainOldData ;
6731
6832/// High‑level classification for buffers created by the engine.
6933#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
0 commit comments