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 binding(self, visibility: ShaderStages, ty: BindingType) -> Self
pub fn binding(self, visibility: ShaderStages, ty: BindingType) -> Self
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
) -> Self
pub fn uniform_buffer( self, visibility: ShaderStages, has_dynamic_offset: bool ) -> Self
Add a uniform buffer binding to the layout.
sourcepub fn storage_buffer(
self,
visibility: ShaderStages,
has_dynamic_offset: bool,
read_only: bool
) -> Self
pub fn storage_buffer( self, visibility: ShaderStages, has_dynamic_offset: bool, read_only: bool ) -> Self
Add a storage buffer binding to the layout.
sourcepub fn sampler(self, visibility: ShaderStages, filtering: bool) -> Self
pub fn sampler(self, visibility: ShaderStages, filtering: bool) -> Self
Add a sampler binding to the layout.
sourcepub fn comparison_sampler(self, visibility: ShaderStages) -> Self
pub fn comparison_sampler(self, visibility: ShaderStages) -> Self
Add a sampler binding to the layout.
sourcepub fn texture(
self,
visibility: ShaderStages,
multisampled: bool,
view_dimension: TextureViewDimension,
sample_type: TextureSampleType
) -> Self
pub fn texture( self, visibility: ShaderStages, multisampled: bool, view_dimension: TextureViewDimension, sample_type: TextureSampleType ) -> Self
Add a texture binding to the layout.
sourcepub fn texture_from(self, visibility: ShaderStages, texture: &Texture) -> Self
pub fn texture_from(self, visibility: ShaderStages, texture: &Texture) -> Self
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
) -> Self
pub fn storage_texture( self, visibility: ShaderStages, format: TextureFormat, view_dimension: TextureViewDimension, access: StorageTextureAccess ) -> Self
Add a storage texture binding to the layout.
sourcepub fn storage_texture_from(
self,
visibility: ShaderStages,
texture: &Texture,
access: StorageTextureAccess
) -> Self
pub fn storage_texture_from( self, visibility: ShaderStages, texture: &Texture, access: StorageTextureAccess ) -> Self
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.