18#define CE_WG_SAFE_CAST
20#define CE_WG_POOLED(T) \
21 using Allocator = VKObjectAllocator; \
22 [[nodiscard]] static Allocator& getAllocator() noexcept; \
23 [[nodiscard]] static void* operator new(size_t size) noexcept; \
24 static void operator delete(void* p, std::size_t size) noexcept;
28#define CE_WG_RENDER_API_OBJECT_FORWARD(N) \
30 using WG##N##Ptr = RC<WG##N>;
32#undef CE_WG_RENDER_API_OBJECT_FORWARD
34 template<
typename ChildTypeName,
typename ParentType =
void>
class WGObject {
41#if defined(CE_WG_SAFE_CAST)
61#if defined(CE_WG_SAFE_CAST)
73#if defined(CE_WG_SAFE_CAST)
85#if defined(CE_WG_SAFE_CAST)
97#if defined(CE_WG_SAFE_CAST)
119 template<
typename ChildTypeName,
typename ParentType =
void>
class WGDeviceObject :
public WGObject<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
#define CE_WG_RENDER_API_OBJECT_FORWARD(N)
Definition WebGPU.hpp:28
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Pointer get() const noexcept
Definition SmartPtr.hpp:244
WebGPU RenderAPI device object.
Definition WGDevice.hpp:32
Definition WebGPU.hpp:119
WGDeviceObject(WGDevicePtr device)
Creates a new WGDeviceObject from the given device.
Definition WebGPU.hpp:127
WGDevice & deviceWG
The owning WGDevice instance.
Definition WebGPU.hpp:122
static const ChildTypeName * safeCast(const ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:114
static ChildTypeName & cast(ParentType &object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:60
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 WebGPU.hpp:52
static const ChildTypeName * cast(const ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:96
static ChildTypeName * safeCast(ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:108
static const ChildTypeName & cast(const ParentType &object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:72
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 WebGPU.hpp:40
static ChildTypeName * cast(ParentType *object)
Casts a object of type ParentType to a object of type ChildTypeName.
Definition WebGPU.hpp:84
Definition Application.hpp:19
WGLResourceOptions WGResourceOptions(const GPUMemoryProperties &memoryProperty)
WGLViewport WGViewport(const Viewport &viewport)
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
WGLScissorRect WGScissorRect(const Scissor &scissor)
Definition GPUGraphicsPipeline.hpp:281
Definition GPUGraphicsPipeline.hpp:214