Skip to main content

Module binding

Module binding 

Source
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.

Structs§

BindingEntry
One binding within a material’s or compute pass’s own bind group (see MaterialDescriptor::entries/ComputeDescriptor::entries).

Enums§

BindingKind
What kind of resource a single BindingEntry binds, the wgpu binding parameters that go with it, and which shader stage(s) can see it. Construct via the texture_*/*_buffer/sampler/storage_texture associated 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.

Traits§

BindGroupTarget
Implemented by GPUMaterial and GPUCompute — anything with its own bind group layout and named entries that a GPUBindingInstance can bind concrete resources against.

Functions§

build_bind_group_layout
Build a wgpu::BindGroupLayout from entries, panicking if two entries claim the same @binding(N) — this makes a shader-mismatched binding layout fail loudly here instead of silently misbehaving at draw/dispatch time.