#[repr(C)]pub struct LineInstance {
pub a: [f32; 2],
pub b: [f32; 2],
pub half_width: f32,
pub aa: f32,
pub cap: u32,
pub _pad0: u32,
pub color: [f32; 4],
}Expand description
A thick anti-aliased line segment (a “capsule”: a stadium of half-width
half_width around the segment a → b). The GPU pipeline expands it into an
oriented quad covering the segment ± (half_width + aa); the CPU raster does
the same with a per-pixel distance-to-segment.
48 bytes, #[repr(C)] — the GPU line instance-buffer layout (matches
line.wgsl).
Fields§
§a: [f32; 2]Segment start, screen pixels.
b: [f32; 2]Segment end, screen pixels.
half_width: f32Half the stroke width (the segment’s distance ceiling), pixels.
aa: f32Anti-alias band half-width, pixels.
cap: u320 = butt cap (rectangle, no rounding past the endpoints); 1 = round cap
(the full stadium). Matches CAP_* in line.wgsl.
_pad0: u32Padding to 16-byte alignment (the colour starts on a vec4 boundary).
color: [f32; 4]Straight RGBA in [0, 1].
Implementations§
Trait Implementations§
Source§impl Clone for LineInstance
impl Clone for LineInstance
Source§fn clone(&self) -> LineInstance
fn clone(&self) -> LineInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LineInstance
Source§impl Debug for LineInstance
impl Debug for LineInstance
Source§impl PartialEq for LineInstance
impl PartialEq for LineInstance
Source§fn eq(&self, other: &LineInstance) -> bool
fn eq(&self, other: &LineInstance) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LineInstance
Auto Trait Implementations§
impl Freeze for LineInstance
impl RefUnwindSafe for LineInstance
impl Send for LineInstance
impl Sync for LineInstance
impl Unpin for LineInstance
impl UnsafeUnpin for LineInstance
impl UnwindSafe for LineInstance
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more