Skip to main content

Module buffers

Module buffers 

Source

Enums§

BindingResource
BufferSource

Functions§

build_bind_group
Builds a bind group from multiple resources. Buffers created from Data are returned in order (texture views and samplers are not returned). Pre-built buffers passed via Buffer are consumed and also returned.
build_buffer
build_buffer_sized
build_dynamic_storage_bind_group
Same as build_dynamic_uniform_bind_group but for a storage buffer.
build_dynamic_storage_buffer
Builds an empty buffer sized to hold count elements of a dynamically-offset storage buffer, and returns the buffer along with the per-element stride.
build_dynamic_uniform_bind_group
Allocates a dynamically-offset uniform buffer sized for count elements and builds a bind group for it in one step. Returns the buffer, the per-element stride to use as the dynamic offset in set_bind_group, and the bind group. Use with a layout built from crate::wgpu::material::MaterialBindingKind::dynamic_uniform_buffer (or the ComputeBindingKind equivalent).
build_dynamic_uniform_buffer
Builds an empty buffer sized to hold count elements of a dynamically-offset uniform buffer, and returns the buffer along with the per-element stride to use as dynamic offsets in RenderPass::set_bind_group.
build_storage_bind_group
build_uniform_bind_group
dynamic_buffer_binding
Builds the bind group entry resource for a dynamically-offset binding. Unlike buffer.as_entire_binding(), this scopes the entry to a single element_size-sized element starting at offset 0 in the buffer — required because the dynamic offset passed to set_bind_group at draw/dispatch time is added on top of this base range, and wgpu validates offset + size <= buffer size. Binding the whole buffer here would make any nonzero dynamic offset fail validation.
dynamic_storage_offset_stride
Same as dynamic_uniform_offset_stride but for storage buffers.
dynamic_uniform_offset_stride
Rounds element_size up to the device’s required alignment for dynamic offsets on uniform buffers, giving the stride to use when packing multiple elements into one buffer for use with MaterialBindingKind::dynamic_uniform_buffer.
resolve_buffer
resolve_storage_buffer
resolve_uniform_buffer
update_buffer_at
Writes data into buffer at a byte offset, for updating one element of a dynamically-offset buffer without touching the others. offset should be a multiple of the stride returned by [dynamic_offset_stride].
update_uniform_buffer