pub enum UniformValue<'a> {
Show 96 variants Block(BufferAnySlice<'a>, fn(_: &UniformBlock) -> Result<(), LayoutMismatchError>), Subroutine(ShaderStage, &'a str), SignedInt(i32), UnsignedInt(u32), Float(f32), Mat2([[f32; 2]; 2]), Mat3([[f32; 3]; 3]), Mat4([[f32; 4]; 4]), Vec2([f32; 2]), Vec3([f32; 3]), Vec4([f32; 4]), IntVec2([i32; 2]), IntVec3([i32; 3]), IntVec4([i32; 4]), UnsignedIntVec2([u32; 2]), UnsignedIntVec3([u32; 3]), UnsignedIntVec4([u32; 4]), Bool(bool), BoolVec2([bool; 2]), BoolVec3([bool; 3]), BoolVec4([bool; 4]), Double(f64), DoubleVec2([f64; 2]), DoubleVec3([f64; 3]), DoubleVec4([f64; 4]), DoubleMat2([[f64; 2]; 2]), DoubleMat3([[f64; 3]; 3]), DoubleMat4([[f64; 4]; 4]), Int64(i64), Int64Vec2([i64; 2]), Int64Vec3([i64; 3]), Int64Vec4([i64; 4]), UnsignedInt64(u64), UnsignedInt64Vec2([u64; 2]), UnsignedInt64Vec3([u64; 3]), UnsignedInt64Vec4([u64; 4]), Texture1d(&'a Texture1d, Option<SamplerBehavior>), CompressedTexture1d(&'a CompressedTexture1d, Option<SamplerBehavior>), SrgbTexture1d(&'a SrgbTexture1d, Option<SamplerBehavior>), CompressedSrgbTexture1d(&'a CompressedSrgbTexture1d, Option<SamplerBehavior>), IntegralTexture1d(&'a IntegralTexture1d, Option<SamplerBehavior>), UnsignedTexture1d(&'a UnsignedTexture1d, Option<SamplerBehavior>), DepthTexture1d(&'a DepthTexture1d, Option<SamplerBehavior>), Texture2d(&'a Texture2d, Option<SamplerBehavior>), CompressedTexture2d(&'a CompressedTexture2d, Option<SamplerBehavior>), SrgbTexture2d(&'a SrgbTexture2d, Option<SamplerBehavior>), CompressedSrgbTexture2d(&'a CompressedSrgbTexture2d, Option<SamplerBehavior>), IntegralTexture2d(&'a IntegralTexture2d, Option<SamplerBehavior>), UnsignedTexture2d(&'a UnsignedTexture2d, Option<SamplerBehavior>), DepthTexture2d(&'a DepthTexture2d, Option<SamplerBehavior>), Texture2dMultisample(&'a Texture2dMultisample, Option<SamplerBehavior>), SrgbTexture2dMultisample(&'a SrgbTexture2dMultisample, Option<SamplerBehavior>), IntegralTexture2dMultisample(&'a IntegralTexture2dMultisample, Option<SamplerBehavior>), UnsignedTexture2dMultisample(&'a UnsignedTexture2dMultisample, Option<SamplerBehavior>), DepthTexture2dMultisample(&'a DepthTexture2dMultisample, Option<SamplerBehavior>), Texture3d(&'a Texture3d, Option<SamplerBehavior>), CompressedTexture3d(&'a CompressedTexture3d, Option<SamplerBehavior>), SrgbTexture3d(&'a SrgbTexture3d, Option<SamplerBehavior>), CompressedSrgbTexture3d(&'a CompressedSrgbTexture3d, Option<SamplerBehavior>), IntegralTexture3d(&'a IntegralTexture3d, Option<SamplerBehavior>), UnsignedTexture3d(&'a UnsignedTexture3d, Option<SamplerBehavior>), DepthTexture3d(&'a DepthTexture3d, Option<SamplerBehavior>), Texture1dArray(&'a Texture1dArray, Option<SamplerBehavior>), CompressedTexture1dArray(&'a CompressedTexture1dArray, Option<SamplerBehavior>), SrgbTexture1dArray(&'a SrgbTexture1dArray, Option<SamplerBehavior>), CompressedSrgbTexture1dArray(&'a CompressedSrgbTexture1dArray, Option<SamplerBehavior>), IntegralTexture1dArray(&'a IntegralTexture1dArray, Option<SamplerBehavior>), UnsignedTexture1dArray(&'a UnsignedTexture1dArray, Option<SamplerBehavior>), DepthTexture1dArray(&'a DepthTexture1dArray, Option<SamplerBehavior>), Texture2dArray(&'a Texture2dArray, Option<SamplerBehavior>), CompressedTexture2dArray(&'a CompressedTexture2dArray, Option<SamplerBehavior>), SrgbTexture2dArray(&'a SrgbTexture2dArray, Option<SamplerBehavior>), CompressedSrgbTexture2dArray(&'a CompressedSrgbTexture2dArray, Option<SamplerBehavior>), IntegralTexture2dArray(&'a IntegralTexture2dArray, Option<SamplerBehavior>), UnsignedTexture2dArray(&'a UnsignedTexture2dArray, Option<SamplerBehavior>), DepthTexture2dArray(&'a DepthTexture2dArray, Option<SamplerBehavior>), Texture2dMultisampleArray(&'a Texture2dMultisampleArray, Option<SamplerBehavior>), SrgbTexture2dMultisampleArray(&'a SrgbTexture2dMultisampleArray, Option<SamplerBehavior>), IntegralTexture2dMultisampleArray(&'a IntegralTexture2dMultisampleArray, Option<SamplerBehavior>), UnsignedTexture2dMultisampleArray(&'a UnsignedTexture2dMultisampleArray, Option<SamplerBehavior>), DepthTexture2dMultisampleArray(&'a DepthTexture2dMultisampleArray, Option<SamplerBehavior>), Cubemap(&'a Cubemap, Option<SamplerBehavior>), CompressedCubemap(&'a CompressedCubemap, Option<SamplerBehavior>), SrgbCubemap(&'a SrgbCubemap, Option<SamplerBehavior>), CompressedSrgbCubemap(&'a CompressedSrgbCubemap, Option<SamplerBehavior>), IntegralCubemap(&'a IntegralCubemap, Option<SamplerBehavior>), UnsignedCubemap(&'a UnsignedCubemap, Option<SamplerBehavior>), DepthCubemap(&'a DepthCubemap, Option<SamplerBehavior>), CubemapArray(&'a CubemapArray, Option<SamplerBehavior>), CompressedCubemapArray(&'a CompressedCubemapArray, Option<SamplerBehavior>), SrgbCubemapArray(&'a SrgbCubemapArray, Option<SamplerBehavior>), CompressedSrgbCubemapArray(&'a CompressedSrgbCubemapArray, Option<SamplerBehavior>), IntegralCubemapArray(&'a IntegralCubemapArray, Option<SamplerBehavior>), UnsignedCubemapArray(&'a UnsignedCubemapArray, Option<SamplerBehavior>), DepthCubemapArray(&'a DepthCubemapArray, Option<SamplerBehavior>), BufferTexture(BufferTextureRef<'a>),
}
Expand description

Represents a value to bind to a uniform.

Variants§

§

Block(BufferAnySlice<'a>, fn(_: &UniformBlock) -> Result<(), LayoutMismatchError>)

Contains a handle to the buffer, and a function that indicates whether this buffer can be bound on a block with the given layout. The last parameter is a sender which must be used to send a SyncFence that expires when the buffer has finished being used.

§

Subroutine(ShaderStage, &'a str)

§

SignedInt(i32)

§

UnsignedInt(u32)

§

Float(f32)

§

Mat2([[f32; 2]; 2])

2x2 column-major matrix.

§

Mat3([[f32; 3]; 3])

3x3 column-major matrix.

§

Mat4([[f32; 4]; 4])

4x4 column-major matrix.

§

Vec2([f32; 2])

§

Vec3([f32; 3])

§

Vec4([f32; 4])

§

IntVec2([i32; 2])

§

IntVec3([i32; 3])

§

IntVec4([i32; 4])

§

UnsignedIntVec2([u32; 2])

§

UnsignedIntVec3([u32; 3])

§

UnsignedIntVec4([u32; 4])

§

Bool(bool)

§

BoolVec2([bool; 2])

§

BoolVec3([bool; 3])

§

BoolVec4([bool; 4])

§

Double(f64)

§

DoubleVec2([f64; 2])

§

DoubleVec3([f64; 3])

§

DoubleVec4([f64; 4])

§

DoubleMat2([[f64; 2]; 2])

§

DoubleMat3([[f64; 3]; 3])

§

DoubleMat4([[f64; 4]; 4])

§

Int64(i64)

§

Int64Vec2([i64; 2])

§

Int64Vec3([i64; 3])

§

Int64Vec4([i64; 4])

§

UnsignedInt64(u64)

§

UnsignedInt64Vec2([u64; 2])

§

UnsignedInt64Vec3([u64; 3])

§

UnsignedInt64Vec4([u64; 4])

§

Texture1d(&'a Texture1d, Option<SamplerBehavior>)

§

CompressedTexture1d(&'a CompressedTexture1d, Option<SamplerBehavior>)

§

SrgbTexture1d(&'a SrgbTexture1d, Option<SamplerBehavior>)

§

CompressedSrgbTexture1d(&'a CompressedSrgbTexture1d, Option<SamplerBehavior>)

§

IntegralTexture1d(&'a IntegralTexture1d, Option<SamplerBehavior>)

§

UnsignedTexture1d(&'a UnsignedTexture1d, Option<SamplerBehavior>)

§

DepthTexture1d(&'a DepthTexture1d, Option<SamplerBehavior>)

§

Texture2d(&'a Texture2d, Option<SamplerBehavior>)

§

CompressedTexture2d(&'a CompressedTexture2d, Option<SamplerBehavior>)

§

SrgbTexture2d(&'a SrgbTexture2d, Option<SamplerBehavior>)

§

CompressedSrgbTexture2d(&'a CompressedSrgbTexture2d, Option<SamplerBehavior>)

§

IntegralTexture2d(&'a IntegralTexture2d, Option<SamplerBehavior>)

§

UnsignedTexture2d(&'a UnsignedTexture2d, Option<SamplerBehavior>)

§

DepthTexture2d(&'a DepthTexture2d, Option<SamplerBehavior>)

§

Texture2dMultisample(&'a Texture2dMultisample, Option<SamplerBehavior>)

§

SrgbTexture2dMultisample(&'a SrgbTexture2dMultisample, Option<SamplerBehavior>)

§

IntegralTexture2dMultisample(&'a IntegralTexture2dMultisample, Option<SamplerBehavior>)

§

UnsignedTexture2dMultisample(&'a UnsignedTexture2dMultisample, Option<SamplerBehavior>)

§

DepthTexture2dMultisample(&'a DepthTexture2dMultisample, Option<SamplerBehavior>)

§

Texture3d(&'a Texture3d, Option<SamplerBehavior>)

§

CompressedTexture3d(&'a CompressedTexture3d, Option<SamplerBehavior>)

§

SrgbTexture3d(&'a SrgbTexture3d, Option<SamplerBehavior>)

§

CompressedSrgbTexture3d(&'a CompressedSrgbTexture3d, Option<SamplerBehavior>)

§

IntegralTexture3d(&'a IntegralTexture3d, Option<SamplerBehavior>)

§

UnsignedTexture3d(&'a UnsignedTexture3d, Option<SamplerBehavior>)

§

DepthTexture3d(&'a DepthTexture3d, Option<SamplerBehavior>)

§

Texture1dArray(&'a Texture1dArray, Option<SamplerBehavior>)

§

CompressedTexture1dArray(&'a CompressedTexture1dArray, Option<SamplerBehavior>)

§

SrgbTexture1dArray(&'a SrgbTexture1dArray, Option<SamplerBehavior>)

§

CompressedSrgbTexture1dArray(&'a CompressedSrgbTexture1dArray, Option<SamplerBehavior>)

§

IntegralTexture1dArray(&'a IntegralTexture1dArray, Option<SamplerBehavior>)

§

UnsignedTexture1dArray(&'a UnsignedTexture1dArray, Option<SamplerBehavior>)

§

DepthTexture1dArray(&'a DepthTexture1dArray, Option<SamplerBehavior>)

§

Texture2dArray(&'a Texture2dArray, Option<SamplerBehavior>)

§

CompressedTexture2dArray(&'a CompressedTexture2dArray, Option<SamplerBehavior>)

§

SrgbTexture2dArray(&'a SrgbTexture2dArray, Option<SamplerBehavior>)

§

CompressedSrgbTexture2dArray(&'a CompressedSrgbTexture2dArray, Option<SamplerBehavior>)

§

IntegralTexture2dArray(&'a IntegralTexture2dArray, Option<SamplerBehavior>)

§

UnsignedTexture2dArray(&'a UnsignedTexture2dArray, Option<SamplerBehavior>)

§

DepthTexture2dArray(&'a DepthTexture2dArray, Option<SamplerBehavior>)

§

Texture2dMultisampleArray(&'a Texture2dMultisampleArray, Option<SamplerBehavior>)

§

SrgbTexture2dMultisampleArray(&'a SrgbTexture2dMultisampleArray, Option<SamplerBehavior>)

§

IntegralTexture2dMultisampleArray(&'a IntegralTexture2dMultisampleArray, Option<SamplerBehavior>)

§

UnsignedTexture2dMultisampleArray(&'a UnsignedTexture2dMultisampleArray, Option<SamplerBehavior>)

§

DepthTexture2dMultisampleArray(&'a DepthTexture2dMultisampleArray, Option<SamplerBehavior>)

§

Cubemap(&'a Cubemap, Option<SamplerBehavior>)

§

CompressedCubemap(&'a CompressedCubemap, Option<SamplerBehavior>)

§

SrgbCubemap(&'a SrgbCubemap, Option<SamplerBehavior>)

§

CompressedSrgbCubemap(&'a CompressedSrgbCubemap, Option<SamplerBehavior>)

§

IntegralCubemap(&'a IntegralCubemap, Option<SamplerBehavior>)

§

UnsignedCubemap(&'a UnsignedCubemap, Option<SamplerBehavior>)

§

DepthCubemap(&'a DepthCubemap, Option<SamplerBehavior>)

§

CubemapArray(&'a CubemapArray, Option<SamplerBehavior>)

§

CompressedCubemapArray(&'a CompressedCubemapArray, Option<SamplerBehavior>)

§

SrgbCubemapArray(&'a SrgbCubemapArray, Option<SamplerBehavior>)

§

CompressedSrgbCubemapArray(&'a CompressedSrgbCubemapArray, Option<SamplerBehavior>)

§

IntegralCubemapArray(&'a IntegralCubemapArray, Option<SamplerBehavior>)

§

UnsignedCubemapArray(&'a UnsignedCubemapArray, Option<SamplerBehavior>)

§

DepthCubemapArray(&'a DepthCubemapArray, Option<SamplerBehavior>)

§

BufferTexture(BufferTextureRef<'a>)

Implementations§

source§

impl<'a> UniformValue<'a>

source

pub fn is_usable_with(&self, ty: &UniformType) -> bool

Returns true if this value can be used with a uniform of the given type.

Trait Implementations§

source§

impl<'a> Clone for UniformValue<'a>

source§

fn clone(&self) -> UniformValue<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Copy for UniformValue<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for UniformValue<'a>

§

impl<'a> !Send for UniformValue<'a>

§

impl<'a> !Sync for UniformValue<'a>

§

impl<'a> Unpin for UniformValue<'a>

§

impl<'a> !UnwindSafe for UniformValue<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> Content for Twhere T: Copy,

§

type Owned = T

A type that holds a sized version of the content.
source§

unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>where F: FnOnce(&mut T) -> Result<(), E>,

Prepares an output buffer, then turns this buffer into an Owned. User-provided closure F must only write to and not read from &mut Self.
source§

fn get_elements_size() -> usize

Returns the size of each element.
source§

fn to_void_ptr(&self) -> *const ()

Produces a pointer to the data.
source§

fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>

Builds a pointer to this type from a raw pointer.
source§

fn is_size_suitable(size: usize) -> bool

Returns true if the size is suitable to store a type like this.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.