Struct nannou::wgpu::BindGroupLayoutBuilder
source · pub struct BindGroupLayoutBuilder { /* private fields */ }
Expand description
A type aimed at simplifying the creation of a bind group layout.
Implementations§
source§impl LayoutBuilder
impl LayoutBuilder
sourcepub fn new() -> LayoutBuilder
pub fn new() -> LayoutBuilder
Begin building the bind group layout.
sourcepub fn binding(self, visibility: ShaderStages, ty: BindingType) -> LayoutBuilder
pub fn binding(self, visibility: ShaderStages, ty: BindingType) -> LayoutBuilder
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 BindGroupLayoutBuilder
and instead
constructing the BindGroupLayout
and BindGroup
manually.
sourcepub fn uniform_buffer(
self,
visibility: ShaderStages,
has_dynamic_offset: bool
) -> LayoutBuilder
pub fn uniform_buffer( self, visibility: ShaderStages, has_dynamic_offset: bool ) -> LayoutBuilder
Add a uniform buffer binding to the layout.
sourcepub fn storage_buffer(
self,
visibility: ShaderStages,
has_dynamic_offset: bool,
read_only: bool
) -> LayoutBuilder
pub fn storage_buffer( self, visibility: ShaderStages, has_dynamic_offset: bool, read_only: bool ) -> LayoutBuilder
Add a storage buffer binding to the layout.
sourcepub fn sampler(self, visibility: ShaderStages, filtering: bool) -> LayoutBuilder
pub fn sampler(self, visibility: ShaderStages, filtering: bool) -> LayoutBuilder
Add a sampler binding to the layout.
sourcepub fn comparison_sampler(self, visibility: ShaderStages) -> LayoutBuilder
pub fn comparison_sampler(self, visibility: ShaderStages) -> LayoutBuilder
Add a sampler binding to the layout.
sourcepub fn texture(
self,
visibility: ShaderStages,
multisampled: bool,
view_dimension: TextureViewDimension,
sample_type: TextureSampleType
) -> LayoutBuilder
pub fn texture( self, visibility: ShaderStages, multisampled: bool, view_dimension: TextureViewDimension, sample_type: TextureSampleType ) -> LayoutBuilder
Add a texture binding to the layout.
sourcepub fn texture_from(
self,
visibility: ShaderStages,
texture: &Texture
) -> LayoutBuilder
pub fn texture_from( self, visibility: ShaderStages, texture: &Texture ) -> LayoutBuilder
Short-hand for adding a texture binding for a full view of the given texture to the layout.
The multisampled
and dimension
parameters are retrieved from the Texture
itself.
Note that if you wish to take a Cube
or CubeArray
view of the given texture, you will
need to manually specify the TextureViewDimension
via the sampled_texture
method
instead.
sourcepub fn storage_texture(
self,
visibility: ShaderStages,
format: TextureFormat,
view_dimension: TextureViewDimension,
access: StorageTextureAccess
) -> LayoutBuilder
pub fn storage_texture( self, visibility: ShaderStages, format: TextureFormat, view_dimension: TextureViewDimension, access: StorageTextureAccess ) -> LayoutBuilder
Add a storage texture binding to the layout.
sourcepub fn storage_texture_from(
self,
visibility: ShaderStages,
texture: &Texture,
access: StorageTextureAccess
) -> LayoutBuilder
pub fn storage_texture_from( self, visibility: ShaderStages, texture: &Texture, access: StorageTextureAccess ) -> LayoutBuilder
Short-hand for adding a storage texture binding for a full view of the given texture to the layout.
The format
, dimension
and sample_type
are inferred from the given texture
.
sourcepub fn build(self, device: &Device) -> BindGroupLayout
pub fn build(self, device: &Device) -> BindGroupLayout
Build the bind group layout from the specified parameters.
Trait Implementations§
source§impl Debug for LayoutBuilder
impl Debug for LayoutBuilder
source§impl Default for LayoutBuilder
impl Default for LayoutBuilder
source§fn default() -> LayoutBuilder
fn default() -> LayoutBuilder
Auto Trait Implementations§
impl RefUnwindSafe for LayoutBuilder
impl Send for LayoutBuilder
impl Sync for LayoutBuilder
impl Unpin for LayoutBuilder
impl UnwindSafe for LayoutBuilder
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