Skip to main content

ShaderExt

Struct ShaderExt 

Source
pub struct ShaderExt {
    pub mouse: [f32; 4],
    pub q_hi: [f32; 32],
    pub time: Option<f64>,
    pub fft: Option<Arc<[f32; 512]>>,
    pub mxd3q: [[f32; 4]; 7],
}
Expand description

See the module docs. One per shader pass owner: crate::FrameInput::ext for the state the frame is built for, crate::Md2OldPass::ext for the outgoing state of a MilkDrop 2 / 3 blend.

Fields§

§mouse: [f32; 4]

_c14 = (x, y, held, released): x = px/W, y = py/H (top origin), -1, -1 outside the window.

§q_hi: [f32; 32]

q33..q64 (q_hi[0] == q33) of the state after its per-frame code (_qi.._qp).

§time: Option<f64>

What _c2.x shows instead of crate::FrameInput::time: seconds since this state’s preset started (the renderer wraps it modulo 10000 like it does the absolute time). None = FrameInput::time.

§fft: Option<Arc<[f32; 512]>>

The smoothed shader FFT (sampler_fft, FFT_BINS values), uploaded to the renderer’s FFT texture before the frame is drawn. None keeps the texture as it is (zeros until the first upload). The texture is renderer-global: for crate::Md2OldPass::ext this field is ignored, the new state’s one is used.

§mxd3q: [[f32; 4]; 7]

The _mxd3qxa .. _mxd3qsc audio-envelope / beat-latch float4s (the MilkDrop 3 block).

Implementations§

Source§

impl ShaderExt

Source

pub fn uniforms(&self) -> MilkExtUniforms

The uniform block uploaded at @group(0) @binding(1).

Trait Implementations§

Source§

impl Clone for ShaderExt

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShaderExt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShaderExt

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ShaderExt

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ShaderExt

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,