Bind group layout entry descriptor
- binding : UInt32
- visibility : ShaderStage
- bindingType : BindingType
Instances For
Equations
- One or more equations did not get rendered due to their size.
Create a bind group layout. Defines the interface between shader and bound resources. Resources are automatically cleaned up by Lean's GC via External finalizers. @param device The GPU device @param entries List of binding entries
Create a bind group. Binds actual resources (buffers) to the layout. Resources are automatically cleaned up by Lean's GC via External finalizers. @param device The GPU device @param layout The bind group layout @param entries The buffer bindings
Compute pipeline descriptor
- shaderModule : ShaderModule
- entryPoint : String
- bindGroupLayout : BindGroupLayout
Instances For
Create a compute pipeline. Resources are automatically cleaned up by Lean's GC via External finalizers. @param device The GPU device @param desc Pipeline configuration
Dispatch compute work (async - returns Future). @param device The GPU device @param pipeline The compute pipeline to execute @param bindGroup The bound resources @param workgroupsX Number of workgroups in X dimension @param workgroupsY Number of workgroups in Y dimension (default 1) @param workgroupsZ Number of workgroups in Z dimension (default 1) @return Future for GPU work completion (pass to deviceWait to wait)
Command Buffer Batching #
Record multiple dispatches into a single command encoder, then submit once. Eliminates per-dispatch overhead (command encoder creation + queue submit + wait).
Create a new command encoder for recording multiple dispatches.
Record a compute dispatch into an existing command encoder (no submit, no wait).
Finish the command encoder, submit to queue, and wait for all recorded work to complete.
Finish the command encoder and submit to queue WITHOUT waiting. Queue submits are ordered, and cross-command-buffer buffer hazards are tracked by the driver, so this is a cheap batch split: it lets Dawn-on-Metal keep its per-encoder inter-pass barriers correct (which it drops in a very large single encoder) without paying a CPU round-trip per split.