Struct nannou::wgpu::BindGroupBuilder
source · pub struct BindGroupBuilder<'a> { /* private fields */ }
Expand description
Simplified creation of a bind group.
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
sourcepub fn binding(self, resource: BindingResource<'a>) -> Builder<'a>
pub fn binding(self, resource: BindingResource<'a>) -> Builder<'a>
Specify a new binding.
The binding
position of each binding will be inferred as the index within the order that
they are added to this builder type. If you require manually specifying the binding
location, you may be better off not using the BindGroupBuilder
and instead constructing
the BindGroupLayout
and BindGroup
manually.
sourcepub fn buffer_bytes(
self,
buffer: &'a Buffer,
offset: u64,
size: Option<NonZeroU64>
) -> Builder<'a>
pub fn buffer_bytes( self, buffer: &'a Buffer, offset: u64, size: Option<NonZeroU64> ) -> Builder<'a>
Specify a slice of a buffer to be bound.
The given range
represents the start and end point of the buffer to be bound in bytes.
sourcepub fn buffer<T>(self, buffer: &'a Buffer, range: Range<usize>) -> Builder<'a>where
T: Copy,
pub fn buffer<T>(self, buffer: &'a Buffer, range: Range<usize>) -> Builder<'a>where
T: Copy,
Specify a slice of a buffer of elements of type T
to be bound.
This method is similar to buffer_bytes
, but expects a range of elements rather than a
range of bytes.
Type T
must be either #[repr(C)]
or #[repr(transparent)]
.
sourcepub fn texture_view(self, view: &'a TextureView) -> Builder<'a>
pub fn texture_view(self, view: &'a TextureView) -> Builder<'a>
Specify a texture view to be bound.
sourcepub fn build(self, device: &Device, layout: &BindGroupLayout) -> BindGroup
pub fn build(self, device: &Device, layout: &BindGroupLayout) -> BindGroup
Build the bind group with the specified resources.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Builder<'a>
impl<'a> Send for Builder<'a>
impl<'a> Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> !UnwindSafe for Builder<'a>
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more