#[repr(C)]pub struct SpriteUniform {
center_size: [f32; 4],
rot_pad: [f32; 4],
rgba: [f32; 4],
}Expand description
Per-sprite uniform pushed to the GPU each draw. 48 bytes; the
pipeline allocates MAX_ACTIVE_SPRITES * 256 B total uniform
storage so each draw can dynamic-offset into its own slot.
Fields§
§center_size: [f32; 4](center_x, center_y, size_x, size_y) in mixed units —
centre is [0, 1] screen coords (top-left origin), size is
half-width / half-height in clip-space units (the shader
adds and subtracts them around the centre).
rot_pad: [f32; 4](rot, _, _, _) — three slots reserved for flipx/flipy/_.
rgba: [f32; 4]Tint (r, g, b, a), premultiplied by a host-side.
Trait Implementations§
Source§impl Clone for SpriteUniform
impl Clone for SpriteUniform
Source§fn clone(&self) -> SpriteUniform
fn clone(&self) -> SpriteUniform
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpriteUniform
impl Debug for SpriteUniform
Source§impl Default for SpriteUniform
impl Default for SpriteUniform
Source§fn default() -> SpriteUniform
fn default() -> SpriteUniform
Returns the “default value” for a type. Read more
impl Copy for SpriteUniform
impl Pod for SpriteUniform
Auto Trait Implementations§
impl Freeze for SpriteUniform
impl RefUnwindSafe for SpriteUniform
impl Send for SpriteUniform
impl Sync for SpriteUniform
impl Unpin for SpriteUniform
impl UnwindSafe for SpriteUniform
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§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.§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.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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().