#[repr(C)]pub struct Vertex2D {
pub x: f32,
pub y: f32,
}Expand description
Vertex for GPU rendering (2D position only).
This is the minimal vertex format for text rendering. Position is in normalized device coordinates or pixel space depending on your pipeline.
Compatible with wgpu VertexFormat::Float32x2 at offset 0.
§Memory Layout
- Size: 8 bytes
- Alignment: 4 bytes
- Can be cast to
&[u8]viabytemuck::cast_slice()oras_bytes()
§Example (wgpu)
ⓘ
wgpu::VertexBufferLayout {
array_stride: 8,
step_mode: wgpu::VertexStepMode::Vertex,
attributes: &[wgpu::VertexAttribute {
offset: 0,
shader_location: 0,
format: wgpu::VertexFormat::Float32x2,
}],
}Fields§
§x: f32X coordinate
y: f32Y coordinate
Implementations§
Trait Implementations§
impl Copy for Vertex2D
impl StructuralPartialEq for Vertex2D
Auto Trait Implementations§
impl Freeze for Vertex2D
impl RefUnwindSafe for Vertex2D
impl Send for Vertex2D
impl Sync for Vertex2D
impl Unpin for Vertex2D
impl UnsafeUnpin for Vertex2D
impl UnwindSafe for Vertex2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more