yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Tolmachev DmitriiMetal support in VkFFTba7001c

master
10.5 KiB250 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Metal/MTLArgumentEncoder.hpp
4//
5// Copyright 2020-2021 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 "MTLDefines.hpp"
24#include "MTLHeaderBridge.hpp"
25#include "MTLPrivate.hpp"
26
27#include <Foundation/Foundation.hpp>
28
29#include "MTLBuffer.hpp"
30#include "MTLComputePipeline.hpp"
31#include "MTLIndirectCommandBuffer.hpp"
32#include "MTLIntersectionFunctionTable.hpp"
33#include "MTLRenderPipeline.hpp"
34#include "MTLSampler.hpp"
35#include "MTLTexture.hpp"
36#include "MTLVisibleFunctionTable.hpp"
37
38namespace MTL
39{
40class ArgumentEncoder : public NS::Referencing<ArgumentEncoder>
41{
42public:
43    class Device*          device() const;
44
45    NS::String*            label() const;
46    void                   setLabel(const NS::String* label);
47
48    NS::UInteger           encodedLength() const;
49
50    NS::UInteger           alignment() const;
51
52    void                   setArgumentBuffer(const class Buffer* argumentBuffer, NS::UInteger offset);
53
54    void                   setArgumentBuffer(const class Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement);
55
56    void                   setBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index);
57
58    void                   setBuffers(MTL::Buffer* buffers[], const NS::UInteger offsets[], NS::Range range);
59
60    void                   setTexture(const class Texture* texture, NS::UInteger index);
61
62    void                   setTextures(MTL::Texture* textures[], NS::Range range);
63
64    void                   setSamplerState(const class SamplerState* sampler, NS::UInteger index);
65
66    void                   setSamplerStates(MTL::SamplerState* samplers[], NS::Range range);
67
68    void*                  constantData(NS::UInteger index);
69
70    void                   setRenderPipelineState(const class RenderPipelineState* pipeline, NS::UInteger index);
71
72    void                   setRenderPipelineStates(MTL::RenderPipelineState* pipelines, NS::Range range);
73
74    void                   setComputePipelineState(const class ComputePipelineState* pipeline, NS::UInteger index);
75
76    void                   setComputePipelineStates(MTL::ComputePipelineState* pipelines, NS::Range range);
77
78    void                   setIndirectCommandBuffer(const class IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index);
79
80    void                   setIndirectCommandBuffers(MTL::IndirectCommandBuffer* buffers, NS::Range range);
81
82    void                   setAccelerationStructure(const class AccelerationStructure* accelerationStructure, NS::UInteger index);
83
84    class ArgumentEncoder* newArgumentEncoder(NS::UInteger index);
85
86    void                   setVisibleFunctionTable(const class VisibleFunctionTable* visibleFunctionTable, NS::UInteger index);
87
88    void                   setVisibleFunctionTables(const VisibleFunctionTable* visibleFunctionTables[], NS::Range range);
89
90    void                   setIntersectionFunctionTable(const class IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index);
91
92    void                   setIntersectionFunctionTables(const IntersectionFunctionTable* intersectionFunctionTables[], NS::Range range);
93};
94
95}
96
97// property: device
98_MTL_INLINE MTL::Device* MTL::ArgumentEncoder::device() const
99{
100    return Object::sendMessage<MTL::Device*>(this, _MTL_PRIVATE_SEL(device));
101}
102
103// property: label
104_MTL_INLINE NS::String* MTL::ArgumentEncoder::label() const
105{
106    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
107}
108
109_MTL_INLINE void MTL::ArgumentEncoder::setLabel(const NS::String* label)
110{
111    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setLabel_), label);
112}
113
114// property: encodedLength
115_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::encodedLength() const
116{
117    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(encodedLength));
118}
119
120// property: alignment
121_MTL_INLINE NS::UInteger MTL::ArgumentEncoder::alignment() const
122{
123    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(alignment));
124}
125
126// method: setArgumentBuffer:offset:
127_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger offset)
128{
129    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setArgumentBuffer_offset_), argumentBuffer, offset);
130}
131
132// method: setArgumentBuffer:startOffset:arrayElement:
133_MTL_INLINE void MTL::ArgumentEncoder::setArgumentBuffer(const MTL::Buffer* argumentBuffer, NS::UInteger startOffset, NS::UInteger arrayElement)
134{
135    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setArgumentBuffer_startOffset_arrayElement_), argumentBuffer, startOffset, arrayElement);
136}
137
138// method: setBuffer:offset:atIndex:
139_MTL_INLINE void MTL::ArgumentEncoder::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index)
140{
141    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index);
142}
143
144// method: setBuffers:offsets:withRange:
145_MTL_INLINE void MTL::ArgumentEncoder::setBuffers(MTL::Buffer* buffers[], const NS::UInteger offsets[], NS::Range range)
146{
147    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range);
148}
149
150// method: setTexture:atIndex:
151_MTL_INLINE void MTL::ArgumentEncoder::setTexture(const MTL::Texture* texture, NS::UInteger index)
152{
153    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTexture_atIndex_), texture, index);
154}
155
156// method: setTextures:withRange:
157_MTL_INLINE void MTL::ArgumentEncoder::setTextures(MTL::Texture* textures[], NS::Range range)
158{
159    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setTextures_withRange_), textures, range);
160}
161
162// method: setSamplerState:atIndex:
163_MTL_INLINE void MTL::ArgumentEncoder::setSamplerState(const MTL::SamplerState* sampler, NS::UInteger index)
164{
165    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSamplerState_atIndex_), sampler, index);
166}
167
168// method: setSamplerStates:withRange:
169_MTL_INLINE void MTL::ArgumentEncoder::setSamplerStates(MTL::SamplerState* samplers[], NS::Range range)
170{
171    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSamplerStates_withRange_), samplers, range);
172}
173
174// method: constantDataAtIndex:
175_MTL_INLINE void* MTL::ArgumentEncoder::constantData(NS::UInteger index)
176{
177    return Object::sendMessage<void*>(this, _MTL_PRIVATE_SEL(constantDataAtIndex_), index);
178}
179
180// method: setRenderPipelineState:atIndex:
181_MTL_INLINE void MTL::ArgumentEncoder::setRenderPipelineState(const MTL::RenderPipelineState* pipeline, NS::UInteger index)
182{
183    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRenderPipelineState_atIndex_), pipeline, index);
184}
185
186// method: setRenderPipelineStates:withRange:
187_MTL_INLINE void MTL::ArgumentEncoder::setRenderPipelineStates(MTL::RenderPipelineState* pipelines, NS::Range range)
188{
189    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setRenderPipelineStates_withRange_), pipelines, range);
190}
191
192// method: setComputePipelineState:atIndex:
193_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineState(const MTL::ComputePipelineState* pipeline, NS::UInteger index)
194{
195    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setComputePipelineState_atIndex_), pipeline, index);
196}
197
198// method: setComputePipelineStates:withRange:
199_MTL_INLINE void MTL::ArgumentEncoder::setComputePipelineStates(MTL::ComputePipelineState* pipelines, NS::Range range)
200{
201    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setComputePipelineStates_withRange_), pipelines, range);
202}
203
204// method: setIndirectCommandBuffer:atIndex:
205_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffer(const MTL::IndirectCommandBuffer* indirectCommandBuffer, NS::UInteger index)
206{
207    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffer_atIndex_), indirectCommandBuffer, index);
208}
209
210// method: setIndirectCommandBuffers:withRange:
211_MTL_INLINE void MTL::ArgumentEncoder::setIndirectCommandBuffers(MTL::IndirectCommandBuffer* buffers, NS::Range range)
212{
213    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setIndirectCommandBuffers_withRange_), buffers, range);
214}
215
216// method: setAccelerationStructure:atIndex:
217_MTL_INLINE void MTL::ArgumentEncoder::setAccelerationStructure(const MTL::AccelerationStructure* accelerationStructure, NS::UInteger index)
218{
219    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setAccelerationStructure_atIndex_), accelerationStructure, index);
220}
221
222// method: newArgumentEncoderForBufferAtIndex:
223_MTL_INLINE MTL::ArgumentEncoder* MTL::ArgumentEncoder::newArgumentEncoder(NS::UInteger index)
224{
225    return Object::sendMessage<MTL::ArgumentEncoder*>(this, _MTL_PRIVATE_SEL(newArgumentEncoderForBufferAtIndex_), index);
226}
227
228// method: setVisibleFunctionTable:atIndex:
229_MTL_INLINE void MTL::ArgumentEncoder::setVisibleFunctionTable(const MTL::VisibleFunctionTable* visibleFunctionTable, NS::UInteger index)
230{
231    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atIndex_), visibleFunctionTable, index);
232}
233
234// method: setVisibleFunctionTables:withRange:
235_MTL_INLINE void MTL::ArgumentEncoder::setVisibleFunctionTables(const MTL::VisibleFunctionTable* visibleFunctionTables[], NS::Range range)
236{
237    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withRange_), visibleFunctionTables, range);
238}
239
240// method: setIntersectionFunctionTable:atIndex:
241_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTable(const MTL::IntersectionFunctionTable* intersectionFunctionTable, NS::UInteger index)
242{
243    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTable_atIndex_), intersectionFunctionTable, index);
244}
245
246// method: setIntersectionFunctionTables:withRange:
247_MTL_INLINE void MTL::ArgumentEncoder::setIntersectionFunctionTables(const MTL::IntersectionFunctionTable* intersectionFunctionTables[], NS::Range range)
248{
249    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setIntersectionFunctionTables_withRange_), intersectionFunctionTables, range);
250}