1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// Groups together properties you use to create a tile render pipeline state object.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4tilerenderpipelinedescriptor?language=objc)
#[unsafe(super(MTL4PipelineDescriptor, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "MTL4PipelineState")]
pub struct MTL4TileRenderPipelineDescriptor;
);
#[cfg(feature = "MTL4PipelineState")]
extern_conformance!(
unsafe impl NSCopying for MTL4TileRenderPipelineDescriptor {}
);
#[cfg(feature = "MTL4PipelineState")]
unsafe impl CopyingHelper for MTL4TileRenderPipelineDescriptor {
type Result = Self;
}
#[cfg(feature = "MTL4PipelineState")]
extern_conformance!(
unsafe impl NSObjectProtocol for MTL4TileRenderPipelineDescriptor {}
);
#[cfg(feature = "MTL4PipelineState")]
impl MTL4TileRenderPipelineDescriptor {
extern_methods!(
#[cfg(feature = "MTL4FunctionDescriptor")]
/// Configures the tile function that the render pipeline executes for each tile in the tile shader stage.
#[unsafe(method(tileFunctionDescriptor))]
#[unsafe(method_family = none)]
pub fn tileFunctionDescriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;
#[cfg(feature = "MTL4FunctionDescriptor")]
/// Setter for [`tileFunctionDescriptor`][Self::tileFunctionDescriptor].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setTileFunctionDescriptor:))]
#[unsafe(method_family = none)]
pub fn setTileFunctionDescriptor(
&self,
tile_function_descriptor: Option<&MTL4FunctionDescriptor>,
);
/// Configures the number of samples per pixel used for multisampling.
#[unsafe(method(rasterSampleCount))]
#[unsafe(method_family = none)]
pub fn rasterSampleCount(&self) -> NSUInteger;
/// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
///
/// # Safety
///
/// This might not be bounds-checked.
#[unsafe(method(setRasterSampleCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
#[cfg(feature = "MTLRenderPipeline")]
/// Access an array of descriptors that configure the properties of each color attachment in the tile render
/// pipeline.
#[unsafe(method(colorAttachments))]
#[unsafe(method_family = none)]
pub fn colorAttachments(
&self,
) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptorArray>;
/// Indicating whether the size of the threadgroup matches the size of a tile in the render pipeline.
#[unsafe(method(threadgroupSizeMatchesTileSize))]
#[unsafe(method_family = none)]
pub fn threadgroupSizeMatchesTileSize(&self) -> bool;
/// Setter for [`threadgroupSizeMatchesTileSize`][Self::threadgroupSizeMatchesTileSize].
#[unsafe(method(setThreadgroupSizeMatchesTileSize:))]
#[unsafe(method_family = none)]
pub fn setThreadgroupSizeMatchesTileSize(&self, threadgroup_size_matches_tile_size: bool);
/// Sets the maximum number of threads that the GPU can execute simultaneously within a single threadgroup in
/// the tile render pipeline.
#[unsafe(method(maxTotalThreadsPerThreadgroup))]
#[unsafe(method_family = none)]
pub fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;
/// Setter for [`maxTotalThreadsPerThreadgroup`][Self::maxTotalThreadsPerThreadgroup].
#[unsafe(method(setMaxTotalThreadsPerThreadgroup:))]
#[unsafe(method_family = none)]
pub fn setMaxTotalThreadsPerThreadgroup(
&self,
max_total_threads_per_threadgroup: NSUInteger,
);
#[cfg(feature = "MTLTypes")]
/// Sets the required number of threads per threadgroup for tile dispatches.
///
/// This value is typically optional, except in the cases where the tile function that ``tileFunctionDescriptor``
/// references uses `CooperativeTensors`. In this case, you need to provide a non-zero value to this property.
///
/// Additionally, when you set this value, the `threadsPerTile` argument of any tile dispatch needs to match it.
///
/// Setting this value to a size of 0 in every dimension disables this property.
#[unsafe(method(requiredThreadsPerThreadgroup))]
#[unsafe(method_family = none)]
pub fn requiredThreadsPerThreadgroup(&self) -> MTLSize;
#[cfg(feature = "MTLTypes")]
/// Setter for [`requiredThreadsPerThreadgroup`][Self::requiredThreadsPerThreadgroup].
#[unsafe(method(setRequiredThreadsPerThreadgroup:))]
#[unsafe(method_family = none)]
pub fn setRequiredThreadsPerThreadgroup(&self, required_threads_per_threadgroup: MTLSize);
#[cfg(feature = "MTL4LinkingDescriptor")]
/// Configures an object that contains information about functions to link to the tile render pipeline
/// when Metal builds it.
#[unsafe(method(staticLinkingDescriptor))]
#[unsafe(method_family = none)]
pub fn staticLinkingDescriptor(&self) -> Retained<MTL4StaticLinkingDescriptor>;
#[cfg(feature = "MTL4LinkingDescriptor")]
/// Setter for [`staticLinkingDescriptor`][Self::staticLinkingDescriptor].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setStaticLinkingDescriptor:))]
#[unsafe(method_family = none)]
pub fn setStaticLinkingDescriptor(
&self,
static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
);
/// Indicates whether the pipeline supports linking binary functions.
#[unsafe(method(supportBinaryLinking))]
#[unsafe(method_family = none)]
pub fn supportBinaryLinking(&self) -> bool;
/// Setter for [`supportBinaryLinking`][Self::supportBinaryLinking].
#[unsafe(method(setSupportBinaryLinking:))]
#[unsafe(method_family = none)]
pub fn setSupportBinaryLinking(&self, support_binary_linking: bool);
/// Resets the descriptor to the default state.
#[unsafe(method(reset))]
#[unsafe(method_family = none)]
pub fn reset(&self);
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "MTL4PipelineState")]
impl MTL4TileRenderPipelineDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
#[cfg(feature = "MTL4PipelineState")]
impl DefaultRetained for MTL4TileRenderPipelineDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}