Skip to main content

Module encode_helpers

Module encode_helpers 

Source
Expand description

Helper utilities for encoding compute dispatches with inline constant parameters (bytes) alongside buffer bindings.

The base CommandEncoder::encode method only supports buffer bindings. These helpers extend encoding to support Metal set_bytes for small constant parameter structs, which avoids allocating a full Metal buffer for a few bytes of configuration data.

KernelArg and as_bytes are defined in crate::encoder and re-exported here for backward compatibility.

Enums§

KernelArg
A buffer or inline-bytes binding for a compute kernel argument slot.

Functions§

as_bytes
Convert a Pod value to a byte slice suitable for KernelArg::Bytes.
encode_threadgroups_with_args
Encode a compute pass with threadgroups and mixed buffer/bytes bindings.
encode_threadgroups_with_args_and_shared
Encode a compute pass with threadgroups, mixed buffer/bytes bindings, and threadgroup shared memory allocations.
encode_with_args
Encode a compute pass with mixed buffer and bytes bindings.