Skip to main content

encode_threadgroups_with_args_and_shared

Function encode_threadgroups_with_args_and_shared 

Source
pub fn encode_threadgroups_with_args_and_shared(
    encoder: &mut CommandEncoder,
    pipeline: &ComputePipelineStateRef,
    bindings: &[(u64, KernelArg<'_>)],
    threadgroup_mem: &[(u64, u64)],
    threadgroups: MTLSize,
    threadgroup_size: MTLSize,
)
Expand description

Encode a compute pass with threadgroups, mixed buffer/bytes bindings, and threadgroup shared memory allocations.

Combines the capabilities of encode_threadgroups_with_args (inline bytes via set_bytes) and the encoder’s encode_threadgroups_with_shared (shared memory allocation). Required by fused kernels that need both constant-struct parameters and a threadgroup scratch buffer for reduction.

§Arguments

  • encoder — The command encoder to record into.
  • pipeline — The compiled compute pipeline.
  • bindings — Slice of (index, KernelArg) pairs.
  • threadgroup_mem — Slice of (index, byte_length) pairs for threadgroup memory.
  • threadgroups — Number of threadgroups to dispatch.
  • threadgroup_size — Threads per threadgroup.