BoundTexture

Struct BoundTexture 

Source
pub struct BoundTexture<'a, B, D, P>
where B: PipelineTexture<D, P>, D: Dimensionable, P: Pixel,
{ /* private fields */ }
Expand description

A bound Texture.

§Parametricity

§Notes

Once a Texture is bound, it can be used and passed around to shaders. In order to do so, you will need to pass a TextureBinding to your ProgramInterface. That value is unique to each BoundTexture and should always be asked — you shouldn’t cache them, for instance.

Getting a TextureBinding is a cheap operation and is performed via the BoundTexture::binding method.

Implementations§

Source§

impl<'a, B, D, P> BoundTexture<'a, B, D, P>
where B: PipelineTexture<D, P>, D: Dimensionable, P: Pixel,

Source

pub fn binding(&self) -> TextureBinding<D, P::SamplerType>

Obtain a TextureBinding object that can be used to refer to this bound texture in shader stages.

§Notes

You shouldn’t try to do store / cache or do anything special with that value. Consider it an opaque object.

Auto Trait Implementations§

§

impl<'a, B, D, P> Freeze for BoundTexture<'a, B, D, P>

§

impl<'a, B, D, P> RefUnwindSafe for BoundTexture<'a, B, D, P>

§

impl<'a, B, D, P> Send for BoundTexture<'a, B, D, P>
where <B as PipelineTexture<D, P>>::BoundTextureRepr: Send,

§

impl<'a, B, D, P> Sync for BoundTexture<'a, B, D, P>
where <B as PipelineTexture<D, P>>::BoundTextureRepr: Sync,

§

impl<'a, B, D, P> Unpin for BoundTexture<'a, B, D, P>
where <B as PipelineTexture<D, P>>::BoundTextureRepr: Unpin,

§

impl<'a, B, D, P> UnwindSafe for BoundTexture<'a, B, D, P>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.