yum-mirror/VkFFT

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

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
5.0 KiB138 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Metal/MTLBinaryArchive.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
29namespace MTL
30{
31_MTL_ENUM(NS::UInteger, BinaryArchiveError) {
32    BinaryArchiveErrorNone = 0,
33    BinaryArchiveErrorInvalidFile = 1,
34    BinaryArchiveErrorUnexpectedElement = 2,
35    BinaryArchiveErrorCompilationFailure = 3,
36};
37
38class BinaryArchiveDescriptor : public NS::Copying<BinaryArchiveDescriptor>
39{
40public:
41    static class BinaryArchiveDescriptor* alloc();
42
43    class BinaryArchiveDescriptor*        init();
44
45    NS::URL*                              url() const;
46    void                                  setUrl(const NS::URL* url);
47};
48
49class BinaryArchive : public NS::Referencing<BinaryArchive>
50{
51public:
52    NS::String*   label() const;
53    void          setLabel(const NS::String* label);
54
55    class Device* device() const;
56
57    bool          addComputePipelineFunctions(const class ComputePipelineDescriptor* descriptor, NS::Error** error);
58
59    bool          addRenderPipelineFunctions(const class RenderPipelineDescriptor* descriptor, NS::Error** error);
60
61    bool          addTileRenderPipelineFunctions(const class TileRenderPipelineDescriptor* descriptor, NS::Error** error);
62
63    bool          serializeToURL(const NS::URL* url, NS::Error** error);
64
65    bool          addFunction(const class FunctionDescriptor* descriptor, const class Library* library, NS::Error** error);
66};
67
68}
69
70// static method: alloc
71_MTL_INLINE MTL::BinaryArchiveDescriptor* MTL::BinaryArchiveDescriptor::alloc()
72{
73    return NS::Object::alloc<MTL::BinaryArchiveDescriptor>(_MTL_PRIVATE_CLS(MTLBinaryArchiveDescriptor));
74}
75
76// method: init
77_MTL_INLINE MTL::BinaryArchiveDescriptor* MTL::BinaryArchiveDescriptor::init()
78{
79    return NS::Object::init<MTL::BinaryArchiveDescriptor>();
80}
81
82// property: url
83_MTL_INLINE NS::URL* MTL::BinaryArchiveDescriptor::url() const
84{
85    return Object::sendMessage<NS::URL*>(this, _MTL_PRIVATE_SEL(url));
86}
87
88_MTL_INLINE void MTL::BinaryArchiveDescriptor::setUrl(const NS::URL* url)
89{
90    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setUrl_), url);
91}
92
93// property: label
94_MTL_INLINE NS::String* MTL::BinaryArchive::label() const
95{
96    return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
97}
98
99_MTL_INLINE void MTL::BinaryArchive::setLabel(const NS::String* label)
100{
101    Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setLabel_), label);
102}
103
104// property: device
105_MTL_INLINE MTL::Device* MTL::BinaryArchive::device() const
106{
107    return Object::sendMessage<MTL::Device*>(this, _MTL_PRIVATE_SEL(device));
108}
109
110// method: addComputePipelineFunctionsWithDescriptor:error:
111_MTL_INLINE bool MTL::BinaryArchive::addComputePipelineFunctions(const MTL::ComputePipelineDescriptor* descriptor, NS::Error** error)
112{
113    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(addComputePipelineFunctionsWithDescriptor_error_), descriptor, error);
114}
115
116// method: addRenderPipelineFunctionsWithDescriptor:error:
117_MTL_INLINE bool MTL::BinaryArchive::addRenderPipelineFunctions(const MTL::RenderPipelineDescriptor* descriptor, NS::Error** error)
118{
119    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(addRenderPipelineFunctionsWithDescriptor_error_), descriptor, error);
120}
121
122// method: addTileRenderPipelineFunctionsWithDescriptor:error:
123_MTL_INLINE bool MTL::BinaryArchive::addTileRenderPipelineFunctions(const MTL::TileRenderPipelineDescriptor* descriptor, NS::Error** error)
124{
125    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(addTileRenderPipelineFunctionsWithDescriptor_error_), descriptor, error);
126}
127
128// method: serializeToURL:error:
129_MTL_INLINE bool MTL::BinaryArchive::serializeToURL(const NS::URL* url, NS::Error** error)
130{
131    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(serializeToURL_error_), url, error);
132}
133
134// method: addFunctionWithDescriptor:library:error:
135_MTL_INLINE bool MTL::BinaryArchive::addFunction(const MTL::FunctionDescriptor* descriptor, const MTL::Library* library, NS::Error** error)
136{
137    return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(addFunctionWithDescriptor_library_error_), descriptor, library, error);
138}