17#import <MetalKit/MetalKit.h>
18#define CE_MT_HANDLE(T) id<T>
20#define CE_MT_HANDLE(T) void*
23#define CE_MT_SAFE_CAST
25#define CE_MT_POOLED(T) \
26 using Allocator = VKObjectAllocator; \
27 [[nodiscard]] static Allocator& getAllocator() noexcept; \
28 [[nodiscard]] static void* operator new(size_t size) noexcept; \
29 static void operator delete(void* p, std::size_t size) noexcept;
33#define CE_MT_RENDER_API_OBJECT_FORWARD(N) \
35 using MT##N##Ptr = RC<MT##N>;
37#undef CE_MT_RENDER_API_OBJECT_FORWARD
39 template<
typename ChildTypeName,
typename ParentType =
void>
class MTObject {
46#if defined(CE_MT_SAFE_CAST)
66#if defined(CE_MT_SAFE_CAST)
78#if defined(CE_MT_SAFE_CAST)
90#if defined(CE_MT_SAFE_CAST)
102#if defined(CE_MT_SAFE_CAST)
124 template<
typename ChildTypeName,
typename ParentType =
void>
class MTDeviceObject :
public MTObject<ChildTypeName, ParentType> {
#define CE_RENDER_API_OBJECT_EACH(F)
A macro that invokes the function-macro F for every RenderAPI object type.
Definition Forward.hpp:18
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Pointer get() const noexcept
Definition SmartPtr.hpp:244
Metal RenderAPI device object.
Definition MTDevice.hpp:32
MTDevice & deviceMT
The owning MTDevice instance.
Definition Metal.hpp:127
MTDeviceObject(MTDevicePtr device)
Creates a new MTDeviceObject from the given device.
Definition Metal.hpp:132
static const ChildTypeName & cast(const ParentType &object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:77
static ChildTypeName * safeCast(ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:113
static RC< ChildTypeName > safeCast(const RC< ParentType > &ptr)
Safely casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
Definition Metal.hpp:57
static RC< ChildTypeName > cast(const RC< ParentType > &ptr)
Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
Definition Metal.hpp:45
static ChildTypeName & cast(ParentType &object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:65
static ChildTypeName * cast(ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:89
static const ChildTypeName * cast(const ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:101
static const ChildTypeName * safeCast(const ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition Metal.hpp:119
Definition Application.hpp:19
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition GPUGraphicsPipeline.hpp:281
Definition GPUGraphicsPipeline.hpp:214