CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::WGBuffer Class Reference

WebGPU RenderAPI buffer object. More...

#include <CeresEngine/RenderAPI/WebGPU/WGBuffer.hpp>

Inheritance diagram for CeresEngine::WGBuffer:
CeresEngine::GPUBuffer CeresEngine::WGDeviceObject< WGBuffer, GPUBuffer > CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource > CeresEngine::WGObject< ChildTypeName, ParentType > CeresEngine::GPUResource CeresEngine::GPUDeviceObject CeresEngine::GPUObject

Public Types

using WGLBufferType = CE_WG_HANDLE(WGLBuffer)
 
- Public Types inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource >
using Descriptor = GPUBufferDescriptor
 An type-alias to the descriptor struct type.
 

Public Member Functions

 WGBuffer (WGDevicePtr device, const GPUBufferDescriptor &descriptor)
 Creates a new WebGPU buffer object.
 
 ~WGBuffer () override
 Destroys the buffer object and releases the GPU memory.
 
 operator WGLBufferType () const noexcept
 The WebGPU API buffer object.
 
GPUBufferData map () final
 
void unmap () final
 
GPUBufferSize getSize () const final
 
void flush (GPUBufferSize offset=0, GPUBufferSize size=whole) final
 
void invalidate (GPUBufferSize offset=0, GPUBufferSize size=whole) final
 
- Public Member Functions inherited from CeresEngine::GPUBuffer
 GPUBuffer (const GPUBuffer &)=delete
 Deleted copy constructor.
 
GPUBufferoperator= (const GPUBuffer &)=delete
 
 GPUBuffer (GPUBuffer &&)=delete
 Deleted move constructor.
 
GPUBufferoperator= (GPUBuffer &&)=delete
 
Async< ByteBufferread (GPUBufferSize offset=0, GPUBufferSize size=whole)
 Performs an asynchronous read operation on the buffer.
 
Async< ByteBufferread (GPUCommandBuffer &commandBuffer, GPUBufferSize offset=0, GPUBufferSize size=whole)
 Performs an asynchronous read operation on the buffer in an specific command buffer.
 
Async write (ByteBuffer &&rawData, GPUBufferSize offset=0, GPUBufferSize size=whole)
 Performs an asynchronous write operation on the buffer.
 
Async write (GPUCommandBuffer &commandBuffer, ByteBuffer &&rawData, GPUBufferSize offset=0, GPUBufferSize size=whole)
 Performs an asynchronous write operation on the buffer in an specific command buffer.
 
template<typename Block >
void data (Block &&block)
 Executes block with a pointer that gives direct access to the buffer data.
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUResource
 GPUDeviceObject (GPUDevice &device)
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 

Private Attributes

const GPUBufferDescriptor mDescriptor
 A structure that describes the buffer and it's properties.
 
WGLBufferType mBuffer
 The WebGPU API buffer object.
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::WGObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static RC< ChildTypeNamesafeCast (const RC< ParentType > &ptr)
 Safely casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamesafeCast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamesafeCast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Static Public Attributes inherited from CeresEngine::GPUBuffer
static const constexpr GPUBufferSize whole = ~0UL
 A constant the represents the whole buffer length.
 
- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 
- Protected Member Functions inherited from CeresEngine::WGDeviceObject< WGBuffer, GPUBuffer >
 WGDeviceObject (WGDevicePtr device)
 Creates a new WGDeviceObject from the given device.
 
- Protected Attributes inherited from CeresEngine::WGDeviceObject< WGBuffer, GPUBuffer >
WGDevicedeviceWG
 The owning WGDevice instance.
 

Detailed Description

WebGPU RenderAPI buffer object.

Member Typedef Documentation

◆ WGLBufferType

Constructor & Destructor Documentation

◆ WGBuffer()

CeresEngine::WGBuffer::WGBuffer ( WGDevicePtr  device,
const GPUBufferDescriptor descriptor 
)

Creates a new WebGPU buffer object.

Parameters
deviceThe device to allocate a new buffer from.
descriptorThe buffer descriptor

◆ ~WGBuffer()

CeresEngine::WGBuffer::~WGBuffer ( )
override

Destroys the buffer object and releases the GPU memory.

Member Function Documentation

◆ flush()

void CeresEngine::WGBuffer::flush ( GPUBufferSize  offset = 0,
GPUBufferSize  size = whole 
)
finalvirtual

◆ getSize()

GPUBufferSize CeresEngine::WGBuffer::getSize ( ) const
finalvirtual

◆ invalidate()

void CeresEngine::WGBuffer::invalidate ( GPUBufferSize  offset = 0,
GPUBufferSize  size = whole 
)
finalvirtual

◆ map()

GPUBufferData CeresEngine::WGBuffer::map ( )
finalvirtual

◆ operator WGLBufferType()

CeresEngine::WGBuffer::operator WGLBufferType ( ) const
inlinenoexcept

The WebGPU API buffer object.

◆ unmap()

void CeresEngine::WGBuffer::unmap ( )
finalvirtual

Member Data Documentation

◆ mBuffer

WGLBufferType CeresEngine::WGBuffer::mBuffer
private

The WebGPU API buffer object.

◆ mDescriptor

const GPUBufferDescriptor CeresEngine::WGBuffer::mDescriptor
private

A structure that describes the buffer and it's properties.


The documentation for this class was generated from the following file: