Skip to main content

Module indirect

Module indirect 

Source
Expand description

Metal indirect command buffer and command types.

Corresponds to Metal/MTLIndirectCommandBuffer.hpp and Metal/MTLIndirectCommandEncoder.hpp.

Indirect command buffers allow you to encode GPU commands from the GPU itself, enabling GPU-driven rendering and compute workflows.

§Example

use mtl_gpu::{device, IndirectCommandBufferDescriptor, IndirectCommandType};

let device = device::system_default().expect("no Metal device");

let mut desc = IndirectCommandBufferDescriptor::new().unwrap();
desc.set_command_types(IndirectCommandType::DRAW | IndirectCommandType::DRAW_INDEXED);
desc.set_max_vertex_buffer_bind_count(8);

let icb = device.new_indirect_command_buffer(&desc, 100, ResourceOptions::default());

Structs§

IndirectCommandBuffer
A buffer that stores GPU commands for indirect execution.
IndirectCommandBufferDescriptor
Descriptor for creating an indirect command buffer.
IndirectCommandBufferExecutionRange
Execution range for indirect command buffers.
IndirectComputeCommand
A compute command within an indirect command buffer.
IndirectRenderCommand
A render command within an indirect command buffer.