yum-mirror/VkFFT

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

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
6.7 KiB157 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Metal/MTLIntersectionFunctionTable.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 "MTLFunctionHandle.hpp"
31#include "MTLIntersectionFunctionTable.hpp"
32#include "MTLResource.hpp"
33#include "MTLVisibleFunctionTable.hpp"
34
35namespace MTL
36{
37_MTL_OPTIONS(NS::UInteger, IntersectionFunctionSignature) {
38    IntersectionFunctionSignatureNone = 0,
39    IntersectionFunctionSignatureInstancing = 1,
40    IntersectionFunctionSignatureTriangleData = 2,
41    IntersectionFunctionSignatureWorldSpaceData = 4,
42    IntersectionFunctionSignatureInstanceMotion = 8,
43    IntersectionFunctionSignaturePrimitiveMotion = 16,
44    IntersectionFunctionSignatureExtendedLimits = 32,
45};
46
47class IntersectionFunctionTableDescriptor : public NS::Copying<IntersectionFunctionTableDescriptor>
48{
49public:
50    static class IntersectionFunctionTableDescriptor* alloc();
51
52    class IntersectionFunctionTableDescriptor*        init();
53
54    static class IntersectionFunctionTableDescriptor* intersectionFunctionTableDescriptor();
55
56    NS::UInteger                                      functionCount() const;
57    void                                              setFunctionCount(NS::UInteger functionCount);
58};
59
60class IntersectionFunctionTable : public NS::Referencing<IntersectionFunctionTable, Resource>
61{
62public:
63    void setBuffer(const class Buffer* buffer, NS::UInteger offset, NS::UInteger index);
64
65    void setBuffers(const class Buffer* buffers[], const NS::UInteger offsets[], NS::Range range);
66
67    void setFunction(const class FunctionHandle* function, NS::UInteger index);
68
69    void setFunctions(const class FunctionHandle* functions[], NS::Range range);
70
71    void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index);
72
73    void setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range);
74
75    void setVisibleFunctionTable(const class VisibleFunctionTable* functionTable, NS::UInteger bufferIndex);
76
77    void setVisibleFunctionTables(const class VisibleFunctionTable* functionTables[], NS::Range bufferRange);
78};
79
80}
81
82// static method: alloc
83_MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::alloc()
84{
85    return NS::Object::alloc<MTL::IntersectionFunctionTableDescriptor>(_MTL_PRIVATE_CLS(MTLIntersectionFunctionTableDescriptor));
86}
87
88// method: init
89_MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::init()
90{
91    return NS::Object::init<MTL::IntersectionFunctionTableDescriptor>();
92}
93
94// static method: intersectionFunctionTableDescriptor
95_MTL_INLINE MTL::IntersectionFunctionTableDescriptor* MTL::IntersectionFunctionTableDescriptor::intersectionFunctionTableDescriptor()
96{
97    return Object::sendMessage<MTL::IntersectionFunctionTableDescriptor*>(_MTL_PRIVATE_CLS(MTLIntersectionFunctionTableDescriptor), _MTL_PRIVATE_SEL(intersectionFunctionTableDescriptor));
98}
99
100// property: functionCount
101_MTL_INLINE NS::UInteger MTL::IntersectionFunctionTableDescriptor::functionCount() const
102{
103    return Object::sendMessage<NS::UInteger>(this, _MTL_PRIVATE_SEL(functionCount));
104}
105
106_MTL_INLINE void MTL::IntersectionFunctionTableDescriptor::setFunctionCount(NS::UInteger functionCount)
107{
108    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setFunctionCount_), functionCount);
109}
110
111// method: setBuffer:offset:atIndex:
112_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffer(const MTL::Buffer* buffer, NS::UInteger offset, NS::UInteger index)
113{
114    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setBuffer_offset_atIndex_), buffer, offset, index);
115}
116
117// method: setBuffers:offsets:withRange:
118_MTL_INLINE void MTL::IntersectionFunctionTable::setBuffers(const MTL::Buffer* buffers[], const NS::UInteger offsets[], NS::Range range)
119{
120    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setBuffers_offsets_withRange_), buffers, offsets, range);
121}
122
123// method: setFunction:atIndex:
124_MTL_INLINE void MTL::IntersectionFunctionTable::setFunction(const MTL::FunctionHandle* function, NS::UInteger index)
125{
126    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setFunction_atIndex_), function, index);
127}
128
129// method: setFunctions:withRange:
130_MTL_INLINE void MTL::IntersectionFunctionTable::setFunctions(const MTL::FunctionHandle* functions[], NS::Range range)
131{
132    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setFunctions_withRange_), functions, range);
133}
134
135// method: setOpaqueTriangleIntersectionFunctionWithSignature:atIndex:
136_MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::UInteger index)
137{
138    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_atIndex_), signature, index);
139}
140
141// method: setOpaqueTriangleIntersectionFunctionWithSignature:withRange:
142_MTL_INLINE void MTL::IntersectionFunctionTable::setOpaqueTriangleIntersectionFunction(MTL::IntersectionFunctionSignature signature, NS::Range range)
143{
144    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setOpaqueTriangleIntersectionFunctionWithSignature_withRange_), signature, range);
145}
146
147// method: setVisibleFunctionTable:atBufferIndex:
148_MTL_INLINE void MTL::IntersectionFunctionTable::setVisibleFunctionTable(const MTL::VisibleFunctionTable* functionTable, NS::UInteger bufferIndex)
149{
150    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibleFunctionTable_atBufferIndex_), functionTable, bufferIndex);
151}
152
153// method: setVisibleFunctionTables:withBufferRange:
154_MTL_INLINE void MTL::IntersectionFunctionTable::setVisibleFunctionTables(const MTL::VisibleFunctionTable* functionTables[], NS::Range bufferRange)
155{
156    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setVisibleFunctionTables_withBufferRange_), functionTables, bufferRange);
157}