#[repr(C)]pub struct Vertex {
pub position: [f32; 2],
pub color: [f32; 4],
pub local: [f32; 2],
pub shape_xy: [f32; 2],
pub shape_r: f32,
pub kind: f32,
pub extra: [f32; 2],
}Expand description
A single vertex fed to solid.wgsl.
Fields§
§position: [f32; 2]Pixel-space quad-corner position (@location(0)).
color: [f32; 4]Straight-alpha RGBA colour in [0, 1] (@location(1)).
local: [f32; 2]Pixel-space position used for SDF evaluation (@location(2)).
shape_xy: [f32; 2]Shape parameter XY: centre for circle/ellipse/rounded-rect;
line-segment start point for lines (@location(3)).
shape_r: f32Shape parameter R: radius for circle/uniform-rrect; packed u16 pair
(tl, tr) for per-corner rrect; (half_width + 0.5 if AA) for lines
(@location(4)).
kind: f32Primitive discriminator (@location(5)):
0 = rect, 1 = circle, 2 = rrect-uniform, 3 = rrect-per-corner,
4 = ellipse, 5 = line-segment.
extra: [f32; 2]Auxiliary parameters (@location(6)):
- kind 2 (rrect-uniform):
[hw, hh]half-extents. - kind 3 (rrect-per-corner):
[pack16(br,bl), pack16(hw,hh)]. - kind 4 (ellipse):
[rx, ry]. - kind 5 (line-seg):
[to_x, to_y]endpoint B. - all others:
[0, 0].
Implementations§
Trait Implementations§
impl Copy for Vertex
impl Pod for Vertex
impl StructuralPartialEq for Vertex
Auto Trait Implementations§
impl Freeze for Vertex
impl RefUnwindSafe for Vertex
impl Send for Vertex
impl Sync for Vertex
impl Unpin for Vertex
impl UnsafeUnpin for Vertex
impl UnwindSafe for Vertex
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.