Enum glium::uniforms::UniformValue
source · 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>
impl<'a> UniformValue<'a>
sourcepub fn is_usable_with(&self, ty: &UniformType) -> bool
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>
impl<'a> Clone for UniformValue<'a>
source§fn clone(&self) -> UniformValue<'a>
fn clone(&self) -> UniformValue<'a>
Returns a copy 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 moreimpl<'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> 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> Content for Twhere
T: Copy,
impl<T> Content for Twhere T: Copy,
source§unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
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
fn get_elements_size() -> usize
Returns the size of each element.
source§fn to_void_ptr(&self) -> *const ()
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>
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
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.