Expand description
Shared bind-group vocabulary for material and
compute — a material’s own bind group and a compute
pass’s own bind group are described the same way, differing only in
which shader stage(s) can see each entry (a material entry can be
FRAGMENT/VERTEX/VERTEX_FRAGMENT; a compute entry is always exactly
COMPUTE). Every constructor below takes visibility explicitly rather
than guessing a default per module — build_material/
build_compute validate it’s
appropriate for the pipeline kind they’re building, panicking with a
clear message otherwise.
Also useful directly (not just via MaterialDescriptor/ComputeDescriptor)
any time you’re building a bind group layout by hand — BindGroupLayoutBuilder
catches a duplicate @binding(N) with a clear panic instead of a wgpu
validation failure at draw time. Re-exported, along with buffers,
from wgpu::prelude.
Structs§
- Bind
Group Layout - A
wgpu::BindGroupLayout, opaque — built only viaBindGroupLayoutBuilder::build. There’s no way to reach the underlyingwgpu::BindGroupLayoutfrom outside this crate.ClonebecauseMaterialDescriptor::extra_layoutstakes ownership (e.g. a camera’s layout, wired into more than one material) — cheap, the sameArc-backed handle underneath. - Bind
Group Layout Builder - Builds a
wgpu::BindGroupLayoutoneBindingEntryat a time. - Binding
Entry - One binding within a material’s or compute pass’s own bind group (see
MaterialDescriptor::entries/ComputeDescriptor::entries).
Enums§
- Binding
Kind - What kind of resource a single
BindingEntrybinds, the wgpu binding parameters that go with it, and which shader stage(s) can see it. Construct via thetexture_*/*_buffer/sampler/storage_textureassociated functions rather than the variants directly — they fill in the usual defaults (filterable float textures, non-dynamic buffers) so only the cases that actually differ need spelling out. - Storage
Texture Access - Access mode for a storage texture binding — mirrors
wgpu::StorageTextureAccess. - Texture
Sample Type - Specific type of a sample in a texture binding — mirrors
wgpu::TextureSampleType. - Texture
View Dimension - Dimensions of a texture view — mirrors
wgpu::TextureViewDimension.
Traits§
- Bind
Group Target - Implemented by
GPUMaterialandGPUCompute— anything with its own bind group layout and named entries that aGPUBindingInstancecan bind concrete resources against.