Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/metal-cpp/Metal/MTL4CommandAllocator.hpp
21082 views
1
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2
//
3
// Metal/MTL4CommandAllocator.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 <cstdint>
28
29
namespace MTL
30
{
31
class Device;
32
}
33
34
namespace MTL4
35
{
36
37
class CommandAllocatorDescriptor : public NS::Copying<CommandAllocatorDescriptor>
38
{
39
public:
40
static CommandAllocatorDescriptor* alloc();
41
42
CommandAllocatorDescriptor* init();
43
44
NS::String* label() const;
45
void setLabel(const NS::String* label);
46
};
47
48
class CommandAllocator : public NS::Referencing<CommandAllocator>
49
{
50
public:
51
uint64_t allocatedSize();
52
53
MTL::Device* device() const;
54
55
NS::String* label() const;
56
57
void reset();
58
};
59
60
}
61
62
_MTL_INLINE MTL4::CommandAllocatorDescriptor* MTL4::CommandAllocatorDescriptor::alloc()
63
{
64
return NS::Object::alloc<MTL4::CommandAllocatorDescriptor>(_MTL_PRIVATE_CLS(MTL4CommandAllocatorDescriptor));
65
}
66
67
_MTL_INLINE MTL4::CommandAllocatorDescriptor* MTL4::CommandAllocatorDescriptor::init()
68
{
69
return NS::Object::init<MTL4::CommandAllocatorDescriptor>();
70
}
71
72
_MTL_INLINE NS::String* MTL4::CommandAllocatorDescriptor::label() const
73
{
74
return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
75
}
76
77
_MTL_INLINE void MTL4::CommandAllocatorDescriptor::setLabel(const NS::String* label)
78
{
79
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setLabel_), label);
80
}
81
82
_MTL_INLINE uint64_t MTL4::CommandAllocator::allocatedSize()
83
{
84
return Object::sendMessage<uint64_t>(this, _MTL_PRIVATE_SEL(allocatedSize));
85
}
86
87
_MTL_INLINE MTL::Device* MTL4::CommandAllocator::device() const
88
{
89
return Object::sendMessage<MTL::Device*>(this, _MTL_PRIVATE_SEL(device));
90
}
91
92
_MTL_INLINE NS::String* MTL4::CommandAllocator::label() const
93
{
94
return Object::sendMessage<NS::String*>(this, _MTL_PRIVATE_SEL(label));
95
}
96
97
_MTL_INLINE void MTL4::CommandAllocator::reset()
98
{
99
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(reset));
100
}
101
102