#[repr(C)]pub struct Instance {
pub rect: [f32; 4],
pub uv: [f32; 4],
pub color: [f32; 4],
}Expand description
One quad, as read by the vertex shader (per-instance step mode).
A glyph has a non-empty uv rectangle; a solid rectangle has uv all zero.
Fields§
§rect: [f32; 4][x, y, width, height] in physical pixels, origin top-left.
uv: [f32; 4][x0, y0, x1, y1] of the glyph in the atlas, in texels (the shader normalizes).
color: [f32; 4]Linear RGBA, not premultiplied (a Color in the shader’s layout).
Implementations§
Trait Implementations§
impl Copy for Instance
impl Pod for Instance
impl StructuralPartialEq for Instance
Auto Trait Implementations§
impl Freeze for Instance
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnsafeUnpin for Instance
impl UnwindSafe for Instance
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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.