mtl_gpu/mtl4/mod.rs
1//! Metal 4 API bindings.
2//!
3//! This module provides bindings to Metal 4 APIs, which offer enhanced
4//! control over command buffering, pipelines, and GPU resource management.
5//!
6//! # Key Types
7//!
8//! ## Command Infrastructure
9//! - [`CommandQueue`] - Metal 4 command queue with explicit residency management
10//! - [`CommandBuffer`] - Metal 4 command buffer with explicit allocator
11//! - [`CommandAllocator`] - Memory allocator for command buffer recording
12//! - [`CommitFeedback`] - Feedback about committed command buffers
13//!
14//! ## Command Encoders
15//! - [`CommandEncoder`] - Base command encoder with barrier and fence methods
16//! - [`ComputeCommandEncoder`] - Compute shader dispatch and resource binding
17//! - [`RenderCommandEncoder`] - Render pass encoding with draw commands
18//! - [`MachineLearningCommandEncoder`] - ML network dispatch encoder
19//!
20//! ## Render Pass
21//! - [`RenderPassDescriptor`] - Metal 4 render pass configuration
22//!
23//! ## Pipelines
24//! - [`ComputePipelineDescriptor`] - Compute pipeline configuration
25//! - [`RenderPipelineDescriptor`] - Render pipeline configuration
26//! - [`MeshRenderPipelineDescriptor`] - Mesh shading pipeline configuration
27//! - [`TileRenderPipelineDescriptor`] - Tile shading pipeline configuration
28//! - [`MachineLearningPipelineDescriptor`] - ML pipeline configuration
29//! - [`MachineLearningPipelineState`] - Compiled ML pipeline
30//!
31//! ## Function Descriptors
32//! - [`FunctionDescriptor`] - Function specification for pipelines
33//! - [`LibraryFunctionDescriptor`] - Function from a library by name
34//! - [`SpecializedFunctionDescriptor`] - Function with constant specialization
35//! - [`StitchedFunctionDescriptor`] - Graph-based function composition
36//! - [`StaticLinkingDescriptor`] - Static shader linking configuration
37//! - [`PipelineStageDynamicLinkingDescriptor`] - Dynamic linking per stage
38//! - [`RenderPipelineDynamicLinkingDescriptor`] - Dynamic linking for render pipelines
39//!
40//! ## Compiler
41//! - [`Compiler`] - Shader compiler for creating pipelines and functions
42//! - [`CompilerTask`] - Asynchronous compilation task
43//! - [`BinaryFunction`] - Precompiled binary function for linking
44//! - [`LibraryDescriptor`] - Library creation configuration
45//! - [`PipelineDataSetSerializer`] - Pipeline data serialization
46//!
47//! ## Archives
48//! - [`Archive`] - Pre-compiled pipeline archive
49//!
50//! ## Argument Binding
51//! - [`ArgumentTable`] - GPU resource binding table
52//! - [`ArgumentTableDescriptor`] - Configuration for argument tables
53//!
54//! ## Counters
55//! - [`CounterHeap`] - GPU performance counter storage
56//! - [`CounterHeapDescriptor`] - Counter heap configuration
57//!
58//! ## Machine Learning
59//! - [`MachineLearningPipelineDescriptor`] - ML pipeline descriptor
60//! - [`MachineLearningPipelineState`] - Compiled ML pipeline state
61//! - [`MachineLearningPipelineReflection`] - ML pipeline reflection data
62
63mod acceleration_structure;
64mod archive;
65mod argument_table;
66mod binary_function;
67mod command_allocator;
68mod command_buffer;
69mod command_encoder;
70mod command_queue;
71mod commit_feedback;
72mod compiler;
73mod compiler_task;
74mod compute_command_encoder;
75mod compute_pipeline;
76mod counters;
77mod enums;
78mod function_descriptor;
79mod library_descriptor;
80mod library_function_descriptor;
81mod linking_descriptor;
82mod machine_learning;
83mod mesh_render_pipeline;
84mod pipeline_data_set_serializer;
85mod pipeline_state;
86mod render_command_encoder;
87mod render_pass;
88mod render_pipeline;
89mod specialized_function_descriptor;
90mod stitched_function_descriptor;
91mod tile_render_pipeline;
92
93// Re-export enums
94pub use enums::{
95 AlphaToCoverageState, AlphaToOneState, BinaryFunctionOptions, BlendState, CommandQueueError,
96 CompilerTaskStatus, IndirectCommandBufferSupportState,
97 LogicalToPhysicalColorAttachmentMappingState, PipelineDataSetSerializerConfiguration,
98 RenderEncoderOptions, ShaderReflection, VisibilityOptions,
99};
100
101// Re-export command types
102pub use command_allocator::{CommandAllocator, CommandAllocatorDescriptor};
103pub use command_buffer::{CommandBuffer, CommandBufferOptions};
104pub use command_queue::{CommandQueue, CommandQueueDescriptor, CommitOptions};
105pub use commit_feedback::CommitFeedback;
106
107// Re-export command encoder types
108pub use command_encoder::CommandEncoder;
109pub use compute_command_encoder::ComputeCommandEncoder;
110pub use render_command_encoder::RenderCommandEncoder;
111
112// Re-export function and linking descriptors
113pub use function_descriptor::FunctionDescriptor;
114pub use linking_descriptor::{
115 PipelineStageDynamicLinkingDescriptor, RenderPipelineDynamicLinkingDescriptor,
116 StaticLinkingDescriptor,
117};
118
119// Re-export pipeline state types
120pub use pipeline_state::{PipelineDescriptor, PipelineOptions};
121
122// Re-export compute pipeline types
123pub use compute_pipeline::ComputePipelineDescriptor;
124
125// Re-export render pipeline types
126pub use render_pipeline::{
127 RenderPipelineBinaryFunctionsDescriptor, RenderPipelineColorAttachmentDescriptor,
128 RenderPipelineColorAttachmentDescriptorArray, RenderPipelineDescriptor,
129};
130
131// Re-export mesh render pipeline types
132pub use mesh_render_pipeline::MeshRenderPipelineDescriptor;
133
134// Re-export tile render pipeline types
135pub use tile_render_pipeline::TileRenderPipelineDescriptor;
136
137// Re-export binary function types
138pub use binary_function::{BinaryFunction, BinaryFunctionDescriptor};
139
140// Re-export library descriptor types
141pub use library_descriptor::LibraryDescriptor;
142
143// Re-export pipeline data set serializer types
144pub use pipeline_data_set_serializer::{
145 PipelineDataSetSerializer, PipelineDataSetSerializerDescriptor,
146};
147
148// Re-export compiler types
149pub use compiler::{Compiler, CompilerDescriptor, CompilerTaskOptions};
150pub use compiler_task::CompilerTask;
151
152// Re-export render pass types
153pub use render_pass::RenderPassDescriptor;
154
155// Re-export argument table types
156pub use argument_table::{ArgumentTable, ArgumentTableDescriptor};
157
158// Re-export archive types
159pub use archive::Archive;
160
161// Re-export function descriptor types
162pub use library_function_descriptor::LibraryFunctionDescriptor;
163pub use specialized_function_descriptor::SpecializedFunctionDescriptor;
164pub use stitched_function_descriptor::StitchedFunctionDescriptor;
165
166// Re-export counter types
167pub use counters::{
168 CounterHeap, CounterHeapDescriptor, CounterHeapType, TimestampGranularity, TimestampHeapEntry,
169};
170
171// Re-export machine learning types
172pub use machine_learning::{
173 MachineLearningCommandEncoder, MachineLearningPipelineDescriptor,
174 MachineLearningPipelineReflection, MachineLearningPipelineState,
175};
176
177// Re-export acceleration structure types
178pub use acceleration_structure::{
179 AccelerationStructureBoundingBoxGeometryDescriptor,
180 AccelerationStructureCurveGeometryDescriptor, AccelerationStructureDescriptor,
181 AccelerationStructureGeometryDescriptor,
182 AccelerationStructureMotionBoundingBoxGeometryDescriptor,
183 AccelerationStructureMotionCurveGeometryDescriptor,
184 AccelerationStructureMotionTriangleGeometryDescriptor,
185 AccelerationStructureTriangleGeometryDescriptor, BufferRange,
186 IndirectInstanceAccelerationStructureDescriptor, InstanceAccelerationStructureDescriptor,
187 PrimitiveAccelerationStructureDescriptor,
188};