Skip to main content

BuiltinShapeUniforms

Struct BuiltinShapeUniforms 

Source
pub struct BuiltinShapeUniforms {
    pub color: [f32; 4],
    pub color2: [f32; 4],
    pub shape: [f32; 4],
    pub params: [f32; 4],
    pub quad: [f32; 2],
}
Expand description

The one uniform layout every built-in pipeline binds.

All geometry is in the RECORDING’s units (quad-local), with quad carrying the quad’s size in those same units. The shader computes px_scale = rosace_quad.size_px / quad and scales everything itself — so a conversion done at logical px (widget recording, scaled ×DPR at replay) and one done at physical px (scale 1:1) are BOTH correct, and HiDPI can never desynchronize uniforms from quad placement.

Fields§

§color: [f32; 4]

Primary color, LINEAR straight-alpha RGBA.

§color2: [f32; 4]

Secondary color (gradient to), LINEAR straight-alpha RGBA.

§shape: [f32; 4]

Shape geometry in quad-local units: rects (x, y, w, h); arcs (center_x, center_y, unused, unused).

§params: [f32; 4]

Pipeline-specific parameters — see each conversion fn.

§quad: [f32; 2]

The quad’s (w, h) in the same units as shape/params lengths.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.