[−][src]Struct luminance_front::shader::Uniform
A GPU shader program environment variable.
A uniform is a special variable that can be used to send data to a GPU. Several
forms exist, but the idea is that T represents the data you want to send. Some exceptions
exist that allow to pass indirect data — such as BufferBinding to pass a buffer, or
TextureBinding to pass a texture in order to fetch from it in a shader stage.
You will never be able to store them by your own. Instead, you must use a UniformInterface,
which provides a contravariant interface for you. Creation is unsafe and should be
avoided. The UniformInterface is the only safe way to create those.
Parametricity
Tis the type of data you want to be able to set in a shader program.
Implementations
impl<T> Uniform<T> where
T: ?Sized, [src]
T: ?Sized,
pub unsafe fn new(index: i32) -> Uniform<T>[src]
Create a new Uniform.
Safety
This method must be used only by backends. If you end up using it,
then you’re doing something wrong. Read on UniformInterface for further
information.
pub fn index(&self) -> i32[src]
Retrieve the internal index.
Even though that function is safe, you have no reason to use it. Read on
UniformInterface for further details.
Trait Implementations
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Uniform<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for Uniform<T>
impl<T> !Sync for Uniform<T>
impl<T: ?Sized> Unpin for Uniform<T>
impl<T: ?Sized> UnwindSafe for Uniform<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,