pub struct ImageUnit<'t, T: 't + Deref<Target = TextureAny>>(pub &'t T, pub ImageUnitBehavior);
Expand description
An image unit uniform marker
Tuple Fields§
§0: &'t T
§1: ImageUnitBehavior
Implementations§
source§impl<'t, T: 't + Deref<Target = TextureAny>> ImageUnit<'t, T>
impl<'t, T: 't + Deref<Target = TextureAny>> ImageUnit<'t, T>
sourcepub fn new(
texture: &'t T,
format: ImageUnitFormat,
) -> Result<ImageUnit<'t, T>, ImageUnitError>
pub fn new( texture: &'t T, format: ImageUnitFormat, ) -> Result<ImageUnit<'t, T>, ImageUnitError>
Create a new marker
sourcepub fn set_level(self, level: u32) -> Result<Self, ImageUnitError>
pub fn set_level(self, level: u32) -> Result<Self, ImageUnitError>
Set the mip level that will be bound
sourcepub fn set_layer(self, layer: Option<u32>) -> Result<Self, ImageUnitError>
pub fn set_layer(self, layer: Option<u32>) -> Result<Self, ImageUnitError>
Sets the layer of the texture to bind, or None to disable layer binding
sourcepub fn set_access(self, access: ImageUnitAccess) -> Self
pub fn set_access(self, access: ImageUnitAccess) -> Self
State how the shader will access the image unit
Trait Implementations§
source§impl<'a> AsUniformValue for ImageUnit<'a, Cubemap>
impl<'a> AsUniformValue for ImageUnit<'a, Cubemap>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, CubemapArray>
impl<'a> AsUniformValue for ImageUnit<'a, CubemapArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralCubemap>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralCubemap>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralCubemapArray>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralCubemapArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture1d>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture1d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture1dArray>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture1dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture2d>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture2d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture2dArray>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture2dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture3d>
impl<'a> AsUniformValue for ImageUnit<'a, IntegralTexture3d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, Texture1d>
impl<'a> AsUniformValue for ImageUnit<'a, Texture1d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, Texture1dArray>
impl<'a> AsUniformValue for ImageUnit<'a, Texture1dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, Texture2d>
impl<'a> AsUniformValue for ImageUnit<'a, Texture2d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, Texture2dArray>
impl<'a> AsUniformValue for ImageUnit<'a, Texture2dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, Texture3d>
impl<'a> AsUniformValue for ImageUnit<'a, Texture3d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedCubemap>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedCubemap>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedCubemapArray>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedCubemapArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture1d>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture1d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture1dArray>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture1dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture2d>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture2d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture2dArray>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture2dArray>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.source§impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture3d>
impl<'a> AsUniformValue for ImageUnit<'a, UnsignedTexture3d>
source§fn as_uniform_value(&self) -> UniformValue<'_>
fn as_uniform_value(&self) -> UniformValue<'_>
Builds a
UniformValue
.Auto Trait Implementations§
impl<'t, T> Freeze for ImageUnit<'t, T>
impl<'t, T> RefUnwindSafe for ImageUnit<'t, T>where
T: RefUnwindSafe,
impl<'t, T> Send for ImageUnit<'t, T>where
T: Sync,
impl<'t, T> Sync for ImageUnit<'t, T>where
T: Sync,
impl<'t, T> Unpin for ImageUnit<'t, T>
impl<'t, T> UnwindSafe for ImageUnit<'t, T>where
T: RefUnwindSafe,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn 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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.