#[repr(C)]pub struct GradientUniforms {
pub p0: [f32; 2],
pub p1: [f32; 2],
pub radius: f32,
pub gradient_type: u32,
pub stop_count: u32,
pub _pad: u32,
pub stop_offsets: [[f32; 4]; 8],
pub stop_colors: [[f32; 4]; 8],
}Expand description
Per-gradient uniform block sent to gradient.wgsl.
Follows std140 layout: each field is aligned to its natural boundary, the total size is a multiple of 16 bytes.
Fields§
§p0: [f32; 2]Linear: gradient start point (pixel space). Radial: gradient centre point (pixel space).
p1: [f32; 2]Linear: gradient end point (pixel space). Radial: unused (zeroed).
radius: f32Radial: outer radius in pixels. 0 for linear.
gradient_type: u32Gradient type: 0 = linear, 1 = radial.
stop_count: u32Number of active colour stops (1–8).
_pad: u32Padding to align the arrays on 16-byte boundaries.
stop_offsets: [[f32; 4]; 8]Per-stop offset packed into .x (y/z/w = 0).
stop_colors: [[f32; 4]; 8]Per-stop RGBA colour in [0, 1].
Trait Implementations§
Source§impl Clone for GradientUniforms
impl Clone for GradientUniforms
Source§fn clone(&self) -> GradientUniforms
fn clone(&self) -> GradientUniforms
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 moreSource§impl Debug for GradientUniforms
impl Debug for GradientUniforms
Source§impl PartialEq for GradientUniforms
impl PartialEq for GradientUniforms
Source§fn eq(&self, other: &GradientUniforms) -> bool
fn eq(&self, other: &GradientUniforms) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for GradientUniforms
impl Pod for GradientUniforms
impl StructuralPartialEq for GradientUniforms
Auto Trait Implementations§
impl Freeze for GradientUniforms
impl RefUnwindSafe for GradientUniforms
impl Send for GradientUniforms
impl Sync for GradientUniforms
impl Unpin for GradientUniforms
impl UnsafeUnpin for GradientUniforms
impl UnwindSafe for GradientUniforms
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.