Skip to main content

BindGroupEntry

Enum BindGroupEntry 

Source
pub enum BindGroupEntry<'a, D: Device> {
    Buffer {
        binding: u32,
        buffer: &'a D::Buffer,
    },
    BufferRange {
        binding: u32,
        buffer: &'a D::Buffer,
        offset: u64,
        size: u64,
    },
    Texture {
        binding: u32,
        view: &'a D::TextureView,
    },
    Sampler {
        binding: u32,
        sampler: &'a D::Sampler,
    },
}
Expand description

A live resource bound into a slot.

Variants§

§

Buffer

A whole buffer.

Fields

§binding: u32

Binding index.

§buffer: &'a D::Buffer

The buffer.

§

BufferRange

A contiguous slice of a buffer.

Binding a range rather than a whole buffer is what lets one packed table be drawn as several groups: each group’s shader sees its slice starting at instance zero, so no draw needs a first-instance offset — a capability the portable baseline does not guarantee.

Fields

§binding: u32

Binding index.

§buffer: &'a D::Buffer

The buffer holding every group.

§offset: u64

Byte offset of this group; a multiple of the device’s storage binding alignment.

§size: u64

Length of this group in bytes.

§

Texture

A texture view.

Fields

§binding: u32

Binding index.

§view: &'a D::TextureView

The view.

§

Sampler

A sampler.

Fields

§binding: u32

Binding index.

§sampler: &'a D::Sampler

The sampler.

Trait Implementations§

Source§

impl<'a, D: Debug + Device> Debug for BindGroupEntry<'a, D>
where D::Buffer: Debug, D::TextureView: Debug, D::Sampler: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D> Freeze for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: Freeze, &'a <D as Device>::TextureView: Freeze, &'a <D as Device>::Sampler: Freeze,

§

impl<'a, D> RefUnwindSafe for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: RefUnwindSafe, &'a <D as Device>::TextureView: RefUnwindSafe, &'a <D as Device>::Sampler: RefUnwindSafe,

§

impl<'a, D> Send for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: Send, &'a <D as Device>::TextureView: Send, &'a <D as Device>::Sampler: Send,

§

impl<'a, D> Sync for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: Sync, &'a <D as Device>::TextureView: Sync, &'a <D as Device>::Sampler: Sync,

§

impl<'a, D> Unpin for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: Unpin, &'a <D as Device>::TextureView: Unpin, &'a <D as Device>::Sampler: Unpin,

§

impl<'a, D> UnsafeUnpin for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: UnsafeUnpin, &'a <D as Device>::TextureView: UnsafeUnpin, &'a <D as Device>::Sampler: UnsafeUnpin,

§

impl<'a, D> UnwindSafe for BindGroupEntry<'a, D>
where &'a <D as Device>::Buffer: UnwindSafe, &'a <D as Device>::TextureView: UnwindSafe, &'a <D as Device>::Sampler: UnwindSafe,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.