CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::WGCommandBuffer Class Referencefinal

WebGPU RenderAPI command buffer object. More...

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

Inheritance diagram for CeresEngine::WGCommandBuffer:
CeresEngine::GPUCommandBuffer CeresEngine::WGDeviceObject< WGCommandBuffer, GPUCommandBuffer > CeresEngine::TDeviceObject< GPUCommandBufferDescriptor > CeresEngine::WGObject< ChildTypeName, ParentType > CeresEngine::GPUDeviceObject CeresEngine::GPUObject

Public Types

using WGLCommandBufferType = CE_WG_HANDLE(WGLCommandBuffer)
 
using WGLRenderCommandEncoderType = CE_WG_HANDLE(WGLRenderCommandEncoder)
 
using WGLComputeCommandEncoderType = CE_WG_HANDLE(WGLComputeCommandEncoder)
 
using WGLBlitCommandEncoderType = CE_WG_HANDLE(WGLBlitCommandEncoder)
 
- Public Types inherited from CeresEngine::TDeviceObject< GPUCommandBufferDescriptor >
using Descriptor = GPUCommandBufferDescriptor
 An type-alias to the descriptor struct type.
 

Public Member Functions

 WGCommandBuffer (WGDevicePtr device, const GPUCommandBufferDescriptor &descriptor)
 
 ~WGCommandBuffer () final
 
 operator WGLCommandBufferType () const noexcept
 The WebGPU API command buffer object.
 
void bindResourceSet (GPUResourceSet &resourceSet, UInt32 firstSet=0, Int32 offset=-1) final
 
void bindVertexBuffer (GPUBuffer &vertexBuffer, UInt32 offset=0, UInt32 slot=0) final
 
void bindIndexBuffer (GPUBuffer &indexBuffer, UInt32 offset=0, IndexType indexType=IndexType::UInt32) final
 
void draw (UInt32 vertexCount, UInt32 instanceCount=1, UInt32 firstVertex=0, UInt32 firstInstance=0) final
 
void draw (GPUBuffer &buffer, UInt32 drawCount, UInt32 bufferOffset=0, UInt32 stride=sizeof(GPUDrawIndirectCommand)) final
 
void drawIndexed (UInt32 indexCount, UInt32 instanceCount=1, UInt32 firstVertex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) final
 
void drawIndexed (GPUBuffer &buffer, UInt32 drawCount, UInt32 bufferOffset=0, UInt32 stride=sizeof(GPUDrawIndexedIndirectCommand)) final
 
void dispatch (UInt32 groupCountX, UInt32 groupCountY, UInt32 groupCountZ) final
 
void setViewport (const Viewport &viewport) final
 
void setViewports (const SmallVector< Viewport, 16 > &viewports) final
 
void setScissor (const Scissor &scissor) final
 
void setScissors (const SmallVector< Scissor, 16 > &scissors) final
 
void updateBuffer (GPUBuffer &dstBuffer, std::uint64_t dstOffset, const void *data, std::uint16_t dataSize) final
 
void copyBuffer (GPUBuffer &dstBuffer, std::uint64_t dstOffset, GPUBuffer &srcBuffer, std::uint64_t srcOffset, std::uint64_t size) final
 
void fillBuffer (GPUBuffer &dstBuffer, std::uint64_t dstOffset, std::uint32_t value, std::uint64_t fillSize=~0u) final
 
void copyBufferFromImage (GPUBuffer &dstBuffer, std::uint64_t dstOffset, GPUImage &srcImage, const GPUImageRegion &srcImageRegion, std::uint32_t rowStride=0, std::uint32_t layerStride=0) final
 
void copyImage (GPUImage &dstImage, const GPUImageLocation &dstLocation, GPUImage &srcImage, const GPUImageLocation &srcLocation, const TExtent3< UInt32 > &extent) final
 
void copyImageFromBuffer (GPUImage &dstImage, const GPUImageRegion &dstRegion, GPUBuffer &srcBuffer, std::uint64_t srcOffset, std::uint32_t rowStride=0, std::uint32_t layerStride=0) final
 
void resolveImage (GPUImage &dstImage, const GPUImageLocation &dstLocation, GPUImage &srcImage, const GPUImageLocation &srcLocation, const TExtent3< UInt32 > &extent) final
 
void clear (GPUImage &image) final
 
void generateMips (GPUImage &image) final
 
void generateMips (GPUImage &image, const GPUImageSubresource &subresource) final
 
void barrier (GPUImage &image) final
 
void begin () final
 
void end () final
 
void wait () final
 
- Public Member Functions inherited from CeresEngine::GPUCommandBuffer
 GPUCommandBuffer (const GPUCommandBuffer &)=delete
 Deleted copy constructor.
 
GPUCommandBufferoperator= (const GPUCommandBuffer &)=delete
 
 GPUCommandBuffer (GPUCommandBuffer &&)=delete
 Deleted move constructor.
 
GPUCommandBufferoperator= (GPUCommandBuffer &&)=delete
 
void bindResourceSet (const GPUResourceSetPtr &resourceSet, const UInt32 firstSet=0, const Int32 offset=-1)
 
void bindVertexBuffer (const GPUBufferPtr &vertexBuffer, const UInt32 offset=0, const UInt32 slot=0)
 
virtual void bindVertexBuffer (const GPUVertexBuffer &vertexBuffer)
 Binds a vertex buffer for drawing.
 
void bindIndexBuffer (const GPUBufferPtr &indexBuffer, const UInt32 offset=0, const IndexType indexType=IndexType::UInt32)
 
virtual void bindIndexBuffer (const GPUIndexBuffer &indexBuffer)
 Binds a index buffer for drawing.
 
void draw (const GPUIndirectBuffer &buffer, UInt32 drawCount, UInt32 stride=sizeof(GPUDrawIndirectCommand))
 
void drawIndexed (const GPUIndirectBuffer &buffer, UInt32 drawCount, UInt32 stride=sizeof(GPUDrawIndexedIndirectCommand))
 
void buildAccelerationStructures ()
 
void buildAccelerationStructuresIndirect ()
 
void copyAccelerationStructure ()
 
void copyAccelerationStructureToMemory ()
 
void copyMemoryToAccelerationStructure ()
 
void writeAccelerationStructuresProperties ()
 
void setRayTracingPipelineStackSize ()
 
void traceRays ()
 
void traceRaysIndirect ()
 
virtual void drawMeshTasks (UInt32 groupCountX, UInt32 groupCountY, UInt32 groupCountZ)=0
 Draw mesh task work items.
 
virtual void drawMeshTasksIndirect (GPUBuffer &buffer, UInt64 offset, UInt32 drawCount, UInt32 stride)=0
 Issue an indirect mesh tasks draw into a command buffer.
 
virtual void drawMeshTasksIndirect (GPUBuffer &buffer, UInt64 offset, GPUBuffer &countBuffer, UInt64 countBufferOffset, uint32_t maxDrawCount, uint32_t stride)=0
 Perform an indirect mesh tasks draw with the draw count sourced from a buffer.
 
virtual void barrier (GPUImage &image, GPUImageLayout layout)=0
 
template<typename Func >
decltype(autorecord (Func &&recorder)
 Records a sequence of commands to be executed by the GPU.
 
 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< GPUCommandBufferDescriptor >
 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::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 Member Functions

WGLRenderCommandEncoderType getRenderCommandEncoder ()
 
WGLComputeCommandEncoderType getComputeCommandEncoder ()
 
WGLBlitCommandEncoderType getBlitCommandEncoder ()
 

Private Attributes

const GPUCommandBufferDescriptor mDescriptor
 A structure that describes the command buffer and it's properties.
 
WGLCommandBufferType mCommandBuffer
 The WebGPU API command buffer object.
 
WGLRenderCommandEncoderType mRenderCommandEncoder
 The WebGPU API render command encoder object.
 
WGLComputeCommandEncoderType mComputeCommandEncoder
 The WebGPU API compute command encoder object.
 
WGLBlitCommandEncoderType mBlitCommandEncoder
 The WebGPU API blit command encoder object.
 
WGBufferPtr mIndexBuffer
 A pointer to the latest bound index buffer.
 
UInt32 mIndexBufferOffset = 0
 The offset, in bytes, to the bound index buffer.
 
IndexType mIndexBufferType = IndexType::UInt32
 The type of index stored in the bound index buffer.
 

Friends

class WGCommandQueue
 

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::GPUCommandBuffer
Event< void()> didFinish
 An event triggered whenever the command buffer has finished execution.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUCommandBufferDescriptor >
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.
 
- 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< WGCommandBuffer, GPUCommandBuffer >
 WGDeviceObject (WGDevicePtr device)
 Creates a new WGDeviceObject from the given device.
 
- Protected Attributes inherited from CeresEngine::WGDeviceObject< WGCommandBuffer, GPUCommandBuffer >
WGDevicedeviceWG
 The owning WGDevice instance.
 

Detailed Description

WebGPU RenderAPI command buffer object.

Member Typedef Documentation

◆ WGLBlitCommandEncoderType

◆ WGLCommandBufferType

◆ WGLComputeCommandEncoderType

◆ WGLRenderCommandEncoderType

Constructor & Destructor Documentation

◆ WGCommandBuffer()

CeresEngine::WGCommandBuffer::WGCommandBuffer ( WGDevicePtr  device,
const GPUCommandBufferDescriptor descriptor 
)

◆ ~WGCommandBuffer()

CeresEngine::WGCommandBuffer::~WGCommandBuffer ( )
final

Member Function Documentation

◆ barrier()

void CeresEngine::WGCommandBuffer::barrier ( GPUImage image)
final

◆ begin()

void CeresEngine::WGCommandBuffer::begin ( )
finalvirtual

◆ bindIndexBuffer()

void CeresEngine::WGCommandBuffer::bindIndexBuffer ( GPUBuffer indexBuffer,
UInt32  offset = 0,
IndexType  indexType = IndexType::UInt32 
)
finalvirtual

◆ bindResourceSet()

void CeresEngine::WGCommandBuffer::bindResourceSet ( GPUResourceSet resourceSet,
UInt32  firstSet = 0,
Int32  offset = -1 
)
finalvirtual

◆ bindVertexBuffer()

void CeresEngine::WGCommandBuffer::bindVertexBuffer ( GPUBuffer vertexBuffer,
UInt32  offset = 0,
UInt32  slot = 0 
)
finalvirtual

◆ clear()

void CeresEngine::WGCommandBuffer::clear ( GPUImage image)
finalvirtual

◆ copyBuffer()

void CeresEngine::WGCommandBuffer::copyBuffer ( GPUBuffer dstBuffer,
std::uint64_t  dstOffset,
GPUBuffer srcBuffer,
std::uint64_t  srcOffset,
std::uint64_t  size 
)
finalvirtual

◆ copyBufferFromImage()

void CeresEngine::WGCommandBuffer::copyBufferFromImage ( GPUBuffer dstBuffer,
std::uint64_t  dstOffset,
GPUImage srcImage,
const GPUImageRegion srcImageRegion,
std::uint32_t  rowStride = 0,
std::uint32_t  layerStride = 0 
)
finalvirtual

◆ copyImage()

void CeresEngine::WGCommandBuffer::copyImage ( GPUImage dstImage,
const GPUImageLocation dstLocation,
GPUImage srcImage,
const GPUImageLocation srcLocation,
const TExtent3< UInt32 > &  extent 
)
finalvirtual

◆ copyImageFromBuffer()

void CeresEngine::WGCommandBuffer::copyImageFromBuffer ( GPUImage dstImage,
const GPUImageRegion dstRegion,
GPUBuffer srcBuffer,
std::uint64_t  srcOffset,
std::uint32_t  rowStride = 0,
std::uint32_t  layerStride = 0 
)
finalvirtual

◆ dispatch()

void CeresEngine::WGCommandBuffer::dispatch ( UInt32  groupCountX,
UInt32  groupCountY,
UInt32  groupCountZ 
)
finalvirtual

◆ draw() [1/2]

void CeresEngine::WGCommandBuffer::draw ( GPUBuffer buffer,
UInt32  drawCount,
UInt32  bufferOffset = 0,
UInt32  stride = sizeof(GPUDrawIndirectCommand) 
)
finalvirtual

◆ draw() [2/2]

void CeresEngine::WGCommandBuffer::draw ( UInt32  vertexCount,
UInt32  instanceCount = 1,
UInt32  firstVertex = 0,
UInt32  firstInstance = 0 
)
finalvirtual

◆ drawIndexed() [1/2]

void CeresEngine::WGCommandBuffer::drawIndexed ( GPUBuffer buffer,
UInt32  drawCount,
UInt32  bufferOffset = 0,
UInt32  stride = sizeof(GPUDrawIndexedIndirectCommand) 
)
finalvirtual

◆ drawIndexed() [2/2]

void CeresEngine::WGCommandBuffer::drawIndexed ( UInt32  indexCount,
UInt32  instanceCount = 1,
UInt32  firstVertex = 0,
Int32  vertexOffset = 0,
UInt32  firstInstance = 0 
)
finalvirtual

◆ end()

void CeresEngine::WGCommandBuffer::end ( )
finalvirtual

◆ fillBuffer()

void CeresEngine::WGCommandBuffer::fillBuffer ( GPUBuffer dstBuffer,
std::uint64_t  dstOffset,
std::uint32_t  value,
std::uint64_t  fillSize = ~0u 
)
finalvirtual

◆ generateMips() [1/2]

void CeresEngine::WGCommandBuffer::generateMips ( GPUImage image)
finalvirtual

◆ generateMips() [2/2]

void CeresEngine::WGCommandBuffer::generateMips ( GPUImage image,
const GPUImageSubresource subresource 
)
finalvirtual

◆ getBlitCommandEncoder()

WGLBlitCommandEncoderType CeresEngine::WGCommandBuffer::getBlitCommandEncoder ( )
private

◆ getComputeCommandEncoder()

WGLComputeCommandEncoderType CeresEngine::WGCommandBuffer::getComputeCommandEncoder ( )
private

◆ getRenderCommandEncoder()

WGLRenderCommandEncoderType CeresEngine::WGCommandBuffer::getRenderCommandEncoder ( )
private

◆ operator WGLCommandBufferType()

CeresEngine::WGCommandBuffer::operator WGLCommandBufferType ( ) const
inlinenoexcept

The WebGPU API command buffer object.

◆ resolveImage()

void CeresEngine::WGCommandBuffer::resolveImage ( GPUImage dstImage,
const GPUImageLocation dstLocation,
GPUImage srcImage,
const GPUImageLocation srcLocation,
const TExtent3< UInt32 > &  extent 
)
finalvirtual

◆ setScissor()

void CeresEngine::WGCommandBuffer::setScissor ( const Scissor scissor)
finalvirtual

Reimplemented from CeresEngine::GPUCommandBuffer.

◆ setScissors()

void CeresEngine::WGCommandBuffer::setScissors ( const SmallVector< Scissor, 16 > &  scissors)
finalvirtual

◆ setViewport()

void CeresEngine::WGCommandBuffer::setViewport ( const Viewport viewport)
finalvirtual

Reimplemented from CeresEngine::GPUCommandBuffer.

◆ setViewports()

void CeresEngine::WGCommandBuffer::setViewports ( const SmallVector< Viewport, 16 > &  viewports)
finalvirtual

◆ updateBuffer()

void CeresEngine::WGCommandBuffer::updateBuffer ( GPUBuffer dstBuffer,
std::uint64_t  dstOffset,
const void data,
std::uint16_t  dataSize 
)
finalvirtual

◆ wait()

void CeresEngine::WGCommandBuffer::wait ( )
finalvirtual

Friends And Related Symbol Documentation

◆ WGCommandQueue

Member Data Documentation

◆ mBlitCommandEncoder

WGLBlitCommandEncoderType CeresEngine::WGCommandBuffer::mBlitCommandEncoder
private

The WebGPU API blit command encoder object.

◆ mCommandBuffer

WGLCommandBufferType CeresEngine::WGCommandBuffer::mCommandBuffer
private

The WebGPU API command buffer object.

◆ mComputeCommandEncoder

WGLComputeCommandEncoderType CeresEngine::WGCommandBuffer::mComputeCommandEncoder
private

The WebGPU API compute command encoder object.

◆ mDescriptor

const GPUCommandBufferDescriptor CeresEngine::WGCommandBuffer::mDescriptor
private

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

◆ mIndexBuffer

WGBufferPtr CeresEngine::WGCommandBuffer::mIndexBuffer
private

A pointer to the latest bound index buffer.

◆ mIndexBufferOffset

UInt32 CeresEngine::WGCommandBuffer::mIndexBufferOffset = 0
private

The offset, in bytes, to the bound index buffer.

◆ mIndexBufferType

IndexType CeresEngine::WGCommandBuffer::mIndexBufferType = IndexType::UInt32
private

The type of index stored in the bound index buffer.

◆ mRenderCommandEncoder

WGLRenderCommandEncoderType CeresEngine::WGCommandBuffer::mRenderCommandEncoder
private

The WebGPU API render command encoder object.


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