Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/metal-cpp/Metal/MTL4RenderPass.hpp
21082 views
1
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2
//
3
// Metal/MTL4RenderPass.hpp
4
//
5
// Copyright 2020-2025 Apple Inc.
6
//
7
// Licensed under the Apache License, Version 2.0 (the "License");
8
// you may not use this file except in compliance with the License.
9
// You may obtain a copy of the License at
10
//
11
// http://www.apache.org/licenses/LICENSE-2.0
12
//
13
// Unless required by applicable law or agreed to in writing, software
14
// distributed under the License is distributed on an "AS IS" BASIS,
15
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
// See the License for the specific language governing permissions and
17
// limitations under the License.
18
//
19
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
20
21
#pragma once
22
23
#include "../Foundation/Foundation.hpp"
24
#include "MTLDefines.hpp"
25
#include "MTLHeaderBridge.hpp"
26
#include "MTLPrivate.hpp"
27
#include "MTLRenderPass.hpp"
28
29
namespace MTL4
30
{
31
class RenderPassDescriptor;
32
}
33
34
namespace MTL
35
{
36
class Buffer;
37
class RasterizationRateMap;
38
class RenderPassColorAttachmentDescriptorArray;
39
class RenderPassDepthAttachmentDescriptor;
40
class RenderPassStencilAttachmentDescriptor;
41
struct SamplePosition;
42
}
43
44
namespace MTL4
45
{
46
class RenderPassDescriptor : public NS::Copying<RenderPassDescriptor>
47
{
48
public:
49
static RenderPassDescriptor* alloc();
50
51
MTL::RenderPassColorAttachmentDescriptorArray* colorAttachments() const;
52
53
NS::UInteger defaultRasterSampleCount() const;
54
55
MTL::RenderPassDepthAttachmentDescriptor* depthAttachment() const;
56
57
NS::UInteger getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count);
58
59
NS::UInteger imageblockSampleLength() const;
60
61
RenderPassDescriptor* init();
62
63
MTL::RasterizationRateMap* rasterizationRateMap() const;
64
65
NS::UInteger renderTargetArrayLength() const;
66
67
NS::UInteger renderTargetHeight() const;
68
69
NS::UInteger renderTargetWidth() const;
70
71
void setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount);
72
73
void setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment);
74
75
void setImageblockSampleLength(NS::UInteger imageblockSampleLength);
76
77
void setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap);
78
79
void setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength);
80
81
void setRenderTargetHeight(NS::UInteger renderTargetHeight);
82
83
void setRenderTargetWidth(NS::UInteger renderTargetWidth);
84
85
void setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count);
86
87
void setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment);
88
89
void setSupportColorAttachmentMapping(bool supportColorAttachmentMapping);
90
91
void setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength);
92
93
void setTileHeight(NS::UInteger tileHeight);
94
95
void setTileWidth(NS::UInteger tileWidth);
96
97
void setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer);
98
99
void setVisibilityResultType(MTL::VisibilityResultType visibilityResultType);
100
101
MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment() const;
102
103
bool supportColorAttachmentMapping() const;
104
105
NS::UInteger threadgroupMemoryLength() const;
106
107
NS::UInteger tileHeight() const;
108
109
NS::UInteger tileWidth() const;
110
111
MTL::Buffer* visibilityResultBuffer() const;
112
113
MTL::VisibilityResultType visibilityResultType() const;
114
};
115
116
}
117
_MTL_INLINE MTL4::RenderPassDescriptor* MTL4::RenderPassDescriptor::alloc()
118
{
119
return NS::Object::alloc<MTL4::RenderPassDescriptor>(_MTL_PRIVATE_CLS(MTL4RenderPassDescriptor));
120
}
121
122
_MTL_INLINE MTL::RenderPassColorAttachmentDescriptorArray* MTL4::RenderPassDescriptor::colorAttachments() const
123
{
124
return Object::sendMessage<MTL::RenderPassColorAttachmentDescriptorArray*>(this, _MTL_PRIVATE_SEL(colorAttachments));
125
}
126
127
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::defaultRasterSampleCount() const
128
{
129
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(defaultRasterSampleCount));
130
}
131
132
_MTL_INLINE MTL::RenderPassDepthAttachmentDescriptor* MTL4::RenderPassDescriptor::depthAttachment() const
133
{
134
return Object::sendMessage<MTL::RenderPassDepthAttachmentDescriptor*>(this, _MTL_PRIVATE_SEL(depthAttachment));
135
}
136
137
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::getSamplePositions(MTL::SamplePosition* positions, NS::UInteger count)
138
{
139
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(getSamplePositions_count_), positions, count);
140
}
141
142
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::imageblockSampleLength() const
143
{
144
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(imageblockSampleLength));
145
}
146
147
_MTL_INLINE MTL4::RenderPassDescriptor* MTL4::RenderPassDescriptor::init()
148
{
149
return NS::Object::init<MTL4::RenderPassDescriptor>();
150
}
151
152
_MTL_INLINE MTL::RasterizationRateMap* MTL4::RenderPassDescriptor::rasterizationRateMap() const
153
{
154
return Object::sendMessage<MTL::RasterizationRateMap*>(this, _MTL_PRIVATE_SEL(rasterizationRateMap));
155
}
156
157
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetArrayLength() const
158
{
159
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(renderTargetArrayLength));
160
}
161
162
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetHeight() const
163
{
164
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(renderTargetHeight));
165
}
166
167
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::renderTargetWidth() const
168
{
169
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(renderTargetWidth));
170
}
171
172
_MTL_INLINE void MTL4::RenderPassDescriptor::setDefaultRasterSampleCount(NS::UInteger defaultRasterSampleCount)
173
{
174
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setDefaultRasterSampleCount_), defaultRasterSampleCount);
175
}
176
177
_MTL_INLINE void MTL4::RenderPassDescriptor::setDepthAttachment(const MTL::RenderPassDepthAttachmentDescriptor* depthAttachment)
178
{
179
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setDepthAttachment_), depthAttachment);
180
}
181
182
_MTL_INLINE void MTL4::RenderPassDescriptor::setImageblockSampleLength(NS::UInteger imageblockSampleLength)
183
{
184
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setImageblockSampleLength_), imageblockSampleLength);
185
}
186
187
_MTL_INLINE void MTL4::RenderPassDescriptor::setRasterizationRateMap(const MTL::RasterizationRateMap* rasterizationRateMap)
188
{
189
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRasterizationRateMap_), rasterizationRateMap);
190
}
191
192
_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetArrayLength(NS::UInteger renderTargetArrayLength)
193
{
194
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRenderTargetArrayLength_), renderTargetArrayLength);
195
}
196
197
_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetHeight(NS::UInteger renderTargetHeight)
198
{
199
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRenderTargetHeight_), renderTargetHeight);
200
}
201
202
_MTL_INLINE void MTL4::RenderPassDescriptor::setRenderTargetWidth(NS::UInteger renderTargetWidth)
203
{
204
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRenderTargetWidth_), renderTargetWidth);
205
}
206
207
_MTL_INLINE void MTL4::RenderPassDescriptor::setSamplePositions(const MTL::SamplePosition* positions, NS::UInteger count)
208
{
209
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSamplePositions_count_), positions, count);
210
}
211
212
_MTL_INLINE void MTL4::RenderPassDescriptor::setStencilAttachment(const MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment)
213
{
214
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setStencilAttachment_), stencilAttachment);
215
}
216
217
_MTL_INLINE void MTL4::RenderPassDescriptor::setSupportColorAttachmentMapping(bool supportColorAttachmentMapping)
218
{
219
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSupportColorAttachmentMapping_), supportColorAttachmentMapping);
220
}
221
222
_MTL_INLINE void MTL4::RenderPassDescriptor::setThreadgroupMemoryLength(NS::UInteger threadgroupMemoryLength)
223
{
224
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setThreadgroupMemoryLength_), threadgroupMemoryLength);
225
}
226
227
_MTL_INLINE void MTL4::RenderPassDescriptor::setTileHeight(NS::UInteger tileHeight)
228
{
229
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTileHeight_), tileHeight);
230
}
231
232
_MTL_INLINE void MTL4::RenderPassDescriptor::setTileWidth(NS::UInteger tileWidth)
233
{
234
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTileWidth_), tileWidth);
235
}
236
237
_MTL_INLINE void MTL4::RenderPassDescriptor::setVisibilityResultBuffer(const MTL::Buffer* visibilityResultBuffer)
238
{
239
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibilityResultBuffer_), visibilityResultBuffer);
240
}
241
242
_MTL_INLINE void MTL4::RenderPassDescriptor::setVisibilityResultType(MTL::VisibilityResultType visibilityResultType)
243
{
244
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibilityResultType_), visibilityResultType);
245
}
246
247
_MTL_INLINE MTL::RenderPassStencilAttachmentDescriptor* MTL4::RenderPassDescriptor::stencilAttachment() const
248
{
249
return Object::sendMessage<MTL::RenderPassStencilAttachmentDescriptor*>(this, _MTL_PRIVATE_SEL(stencilAttachment));
250
}
251
252
_MTL_INLINE bool MTL4::RenderPassDescriptor::supportColorAttachmentMapping() const
253
{
254
return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportColorAttachmentMapping));
255
}
256
257
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::threadgroupMemoryLength() const
258
{
259
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(threadgroupMemoryLength));
260
}
261
262
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::tileHeight() const
263
{
264
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(tileHeight));
265
}
266
267
_MTL_INLINE NS::UInteger MTL4::RenderPassDescriptor::tileWidth() const
268
{
269
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(tileWidth));
270
}
271
272
_MTL_INLINE MTL::Buffer* MTL4::RenderPassDescriptor::visibilityResultBuffer() const
273
{
274
return Object::sendMessage<MTL::Buffer*>(this, _MTL_PRIVATE_SEL(visibilityResultBuffer));
275
}
276
277
_MTL_INLINE MTL::VisibilityResultType MTL4::RenderPassDescriptor::visibilityResultType() const
278
{
279
return Object::sendMessage<MTL::VisibilityResultType>(this, _MTL_PRIVATE_SEL(visibilityResultType));
280
}
281
282