Hymn to Beauty
C++ 3D Engine
Video::WebGPUBuffer Class Reference

WebGPU implementation of Buffer. More...

#include <WebGPUBuffer.hpp>

Inheritance diagram for Video::WebGPUBuffer:
Video::Buffer

Public Member Functions

 WebGPUBuffer (Buffer::BufferUsage bufferUsage, const BufferAllocation &allocation)
 Create new WebGPU buffer. More...
 
 ~WebGPUBuffer () final
 Destructor. More...
 
void Reset (BufferUsage bufferUsage, const BufferAllocation &allocation) final
 Reset the buffer. More...
 
unsigned int GetSize () const final
 Get the size of the buffer. More...
 
WGPUBuffer GetBuffer () const
 Get the internal WebGPU buffer. More...
 
uint32_t GetOffset () const
 Get the offset into the raw buffer. More...
 
- Public Member Functions inherited from Video::Buffer
 Buffer (BufferUsage bufferUsage)
 Create a new buffer. More...
 
virtual ~Buffer ()
 Destructor. More...
 
BufferUsage GetBufferUsage () const
 Get how the buffer is to be used. More...
 

Additional Inherited Members

- Public Types inherited from Video::Buffer
enum class  BufferUsage {
  VERTEX_BUFFER , INDEX_BUFFER , UNIFORM_BUFFER , STORAGE_BUFFER ,
  VERTEX_STORAGE_BUFFER , COUNT
}
 How the buffer is going to be used. More...
 
- Protected Attributes inherited from Video::Buffer
BufferUsage bufferUsage
 How the buffer will be used. More...
 

Detailed Description

WebGPU implementation of Buffer.

Constructor & Destructor Documentation

◆ WebGPUBuffer()

Video::WebGPUBuffer::WebGPUBuffer ( Buffer::BufferUsage  bufferUsage,
const BufferAllocation allocation 
)

Create new WebGPU buffer.

Parameters
bufferUsageHow the buffer will be used.
allocationThe allocation to encapsulate.

◆ ~WebGPUBuffer()

Video::WebGPUBuffer::~WebGPUBuffer ( )
final

Destructor.

Member Function Documentation

◆ GetBuffer()

WGPUBuffer Video::WebGPUBuffer::GetBuffer ( ) const

Get the internal WebGPU buffer.

Parameters
Theinternal WebGPU buffer.

◆ GetOffset()

uint32_t Video::WebGPUBuffer::GetOffset ( ) const

Get the offset into the raw buffer.

Returns
The offset into the raw buffer.

◆ GetSize()

unsigned int Video::WebGPUBuffer::GetSize ( ) const
finalvirtual

Get the size of the buffer.

Returns
The size of the buffer in bytes.

Implements Video::Buffer.

◆ Reset()

void Video::WebGPUBuffer::Reset ( BufferUsage  bufferUsage,
const BufferAllocation allocation 
)
finalvirtual

Reset the buffer.

Parameters
bufferUsageHow the buffer will be used.
allocationAllocation to back up buffer memory.

Implements Video::Buffer.


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