Struct bevy_retrograde::core::luminance::shader::Uniform [−]
pub struct Uniform<T> where
T: ?Sized, { /* fields omitted */ }
Expand description
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
T
is the type of data you want to be able to set in a shader program.
Implementations
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.
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,
impl<T: ?Sized> UnwindSafe for Uniform<T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V