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

Vulkan implementation of Buffer. More...

#include <VulkanBuffer.hpp>

Inheritance diagram for Video::VulkanBuffer:
Video::Buffer

Public Member Functions

 VulkanBuffer (Buffer::BufferUsage bufferUsage, const BufferAllocation &allocation)
 Create new Vulkan buffer. More...
 
 ~VulkanBuffer () 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...
 
VkBuffer GetBuffer () const
 Get the internal Vulkan buffer. More...
 
uint32_t GetOffset () const
 Get the offset into the raw buffer. More...
 
VkPipelineStageFlags GetReadMask () const
 Get which pipeline stages have read the buffer since the last write. More...
 
void SetReadMaskStage (VkPipelineStageFlags pipelineStage)
 Set a pipeline stage having read the buffer since the last write. More...
 
void ClearReadMask ()
 Clear the read mask. More...
 
VkPipelineStageFlags GetLastWriteStage () const
 Get the shader stage which last wrote to the buffer. More...
 
void SetLastWriteStage (VkPipelineStageFlags pipelineStage)
 Set which pipeline stage last wrote to the 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

Vulkan implementation of Buffer.

Constructor & Destructor Documentation

◆ VulkanBuffer()

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

Create new Vulkan buffer.

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

◆ ~VulkanBuffer()

Video::VulkanBuffer::~VulkanBuffer ( )
final

Destructor.

Member Function Documentation

◆ ClearReadMask()

void Video::VulkanBuffer::ClearReadMask ( )

Clear the read mask.

◆ GetBuffer()

VkBuffer Video::VulkanBuffer::GetBuffer ( ) const

Get the internal Vulkan buffer.

Returns
The internal Vulkan buffer.

◆ GetLastWriteStage()

VkPipelineStageFlags Video::VulkanBuffer::GetLastWriteStage ( ) const

Get the shader stage which last wrote to the buffer.

Returns
The last shader stage which wrote to the buffer (or 0 if none).

◆ GetOffset()

uint32_t Video::VulkanBuffer::GetOffset ( ) const

Get the offset into the raw buffer.

Returns
The offset into the raw buffer.

◆ GetReadMask()

VkPipelineStageFlags Video::VulkanBuffer::GetReadMask ( ) const

Get which pipeline stages have read the buffer since the last write.

Returns
A mask of all pipeline stages which have read the buffer.

◆ GetSize()

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

Get the size of the buffer.

Returns
The size of the buffer in bytes.

Implements Video::Buffer.

◆ Reset()

void Video::VulkanBuffer::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.

◆ SetLastWriteStage()

void Video::VulkanBuffer::SetLastWriteStage ( VkPipelineStageFlags  pipelineStage)

Set which pipeline stage last wrote to the buffer.

Parameters
pipelineStageThe pipeline stage writing to the buffer.

◆ SetReadMaskStage()

void Video::VulkanBuffer::SetReadMaskStage ( VkPipelineStageFlags  pipelineStage)

Set a pipeline stage having read the buffer since the last write.

Parameters
pipelineStageThe pipeline stage reading the buffer.

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