Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/metal-cpp/Metal/MTL4TileRenderPipeline.hpp
21337 views
1
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2
//
3
// Metal/MTL4TileRenderPipeline.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 "MTL4PipelineState.hpp"
25
#include "MTLDefines.hpp"
26
#include "MTLHeaderBridge.hpp"
27
#include "MTLPrivate.hpp"
28
#include "MTLTypes.hpp"
29
30
namespace MTL4
31
{
32
class FunctionDescriptor;
33
class StaticLinkingDescriptor;
34
class TileRenderPipelineDescriptor;
35
}
36
37
namespace MTL
38
{
39
class TileRenderPipelineColorAttachmentDescriptorArray;
40
}
41
42
namespace MTL4
43
{
44
class TileRenderPipelineDescriptor : public NS::Copying<TileRenderPipelineDescriptor, PipelineDescriptor>
45
{
46
public:
47
static TileRenderPipelineDescriptor* alloc();
48
49
MTL::TileRenderPipelineColorAttachmentDescriptorArray* colorAttachments() const;
50
51
TileRenderPipelineDescriptor* init();
52
53
NS::UInteger maxTotalThreadsPerThreadgroup() const;
54
55
NS::UInteger rasterSampleCount() const;
56
57
MTL::Size requiredThreadsPerThreadgroup() const;
58
59
void reset();
60
61
void setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup);
62
63
void setRasterSampleCount(NS::UInteger rasterSampleCount);
64
65
void setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup);
66
67
void setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor);
68
69
void setSupportBinaryLinking(bool supportBinaryLinking);
70
71
void setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize);
72
73
void setTileFunctionDescriptor(const MTL4::FunctionDescriptor* tileFunctionDescriptor);
74
75
StaticLinkingDescriptor* staticLinkingDescriptor() const;
76
77
bool supportBinaryLinking() const;
78
79
bool threadgroupSizeMatchesTileSize() const;
80
81
FunctionDescriptor* tileFunctionDescriptor() const;
82
};
83
84
}
85
_MTL_INLINE MTL4::TileRenderPipelineDescriptor* MTL4::TileRenderPipelineDescriptor::alloc()
86
{
87
return NS::Object::alloc<MTL4::TileRenderPipelineDescriptor>(_MTL_PRIVATE_CLS(MTL4TileRenderPipelineDescriptor));
88
}
89
90
_MTL_INLINE MTL::TileRenderPipelineColorAttachmentDescriptorArray* MTL4::TileRenderPipelineDescriptor::colorAttachments() const
91
{
92
return Object::sendMessage<MTL::TileRenderPipelineColorAttachmentDescriptorArray*>(this, _MTL_PRIVATE_SEL(colorAttachments));
93
}
94
95
_MTL_INLINE MTL4::TileRenderPipelineDescriptor* MTL4::TileRenderPipelineDescriptor::init()
96
{
97
return NS::Object::init<MTL4::TileRenderPipelineDescriptor>();
98
}
99
100
_MTL_INLINE NS::UInteger MTL4::TileRenderPipelineDescriptor::maxTotalThreadsPerThreadgroup() const
101
{
102
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(maxTotalThreadsPerThreadgroup));
103
}
104
105
_MTL_INLINE NS::UInteger MTL4::TileRenderPipelineDescriptor::rasterSampleCount() const
106
{
107
return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(rasterSampleCount));
108
}
109
110
_MTL_INLINE MTL::Size MTL4::TileRenderPipelineDescriptor::requiredThreadsPerThreadgroup() const
111
{
112
return Object::sendMessage<MTL::Size>(this, _MTL_PRIVATE_SEL(requiredThreadsPerThreadgroup));
113
}
114
115
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::reset()
116
{
117
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(reset));
118
}
119
120
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setMaxTotalThreadsPerThreadgroup(NS::UInteger maxTotalThreadsPerThreadgroup)
121
{
122
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setMaxTotalThreadsPerThreadgroup_), maxTotalThreadsPerThreadgroup);
123
}
124
125
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setRasterSampleCount(NS::UInteger rasterSampleCount)
126
{
127
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRasterSampleCount_), rasterSampleCount);
128
}
129
130
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setRequiredThreadsPerThreadgroup(MTL::Size requiredThreadsPerThreadgroup)
131
{
132
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRequiredThreadsPerThreadgroup_), requiredThreadsPerThreadgroup);
133
}
134
135
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setStaticLinkingDescriptor(const MTL4::StaticLinkingDescriptor* staticLinkingDescriptor)
136
{
137
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setStaticLinkingDescriptor_), staticLinkingDescriptor);
138
}
139
140
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setSupportBinaryLinking(bool supportBinaryLinking)
141
{
142
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSupportBinaryLinking_), supportBinaryLinking);
143
}
144
145
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setThreadgroupSizeMatchesTileSize(bool threadgroupSizeMatchesTileSize)
146
{
147
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setThreadgroupSizeMatchesTileSize_), threadgroupSizeMatchesTileSize);
148
}
149
150
_MTL_INLINE void MTL4::TileRenderPipelineDescriptor::setTileFunctionDescriptor(const MTL4::FunctionDescriptor* tileFunctionDescriptor)
151
{
152
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTileFunctionDescriptor_), tileFunctionDescriptor);
153
}
154
155
_MTL_INLINE MTL4::StaticLinkingDescriptor* MTL4::TileRenderPipelineDescriptor::staticLinkingDescriptor() const
156
{
157
return Object::sendMessage<MTL4::StaticLinkingDescriptor*>(this, _MTL_PRIVATE_SEL(staticLinkingDescriptor));
158
}
159
160
_MTL_INLINE bool MTL4::TileRenderPipelineDescriptor::supportBinaryLinking() const
161
{
162
return Object::sendMessageSafe<bool>(this, _MTL_PRIVATE_SEL(supportBinaryLinking));
163
}
164
165
_MTL_INLINE bool MTL4::TileRenderPipelineDescriptor::threadgroupSizeMatchesTileSize() const
166
{
167
return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(threadgroupSizeMatchesTileSize));
168
}
169
170
_MTL_INLINE MTL4::FunctionDescriptor* MTL4::TileRenderPipelineDescriptor::tileFunctionDescriptor() const
171
{
172
return Object::sendMessage<MTL4::FunctionDescriptor*>(this, _MTL_PRIVATE_SEL(tileFunctionDescriptor));
173
}
174
175