VulkanEngine 0.1
Graphics engine using Vulkan
Loading...
Searching...
No Matches
VulkanEngine::StagedBuffer< DestinationClass > Class Template Reference

#include <StagedBuffer.h>

Inheritance diagram for VulkanEngine::StagedBuffer< DestinationClass >:

Public Member Functions

template<class... DestinationClassArgs>
 StagedBuffer (DestinationClassArgs... args)
 
 ~StagedBuffer ()
 Destructor.
 
void transferBuffer (const vk::CommandBuffer &command_buffer=nullptr)
 
void updateBuffer (const void *_data, size_t _data_size) override
 

Protected Attributes

Buffer source_buffer
 

Detailed Description

template<class DestinationClass>
class VulkanEngine::StagedBuffer< DestinationClass >

Represents a temporary buffer used to transfer data to another StagedBufferDestination buffer. This class can be templated on any class inheriting from StagedBufferDestination in order to provide staging functionality for that class. E.g the type StagedBuffer< Image > is an Image which has staging functionality.

Template Parameters
DestinationClassThe class which will be the receiver of the data in this buffer.
DestinationClassArgsParameter pack specifying the signature of the constructor of DestinationClass to call from StagedBuffer's constructor.

Constructor & Destructor Documentation

◆ StagedBuffer()

template<class DestinationClass >
template<class... DestinationClassArgs>
VulkanEngine::StagedBuffer< DestinationClass >::StagedBuffer ( DestinationClassArgs...  args)
explicit

Contructor. Creates the staging buffer.

Member Function Documentation

◆ transferBuffer()

template<class DestinationClass >
void VulkanEngine::StagedBuffer< DestinationClass >::transferBuffer ( const vk::CommandBuffer &  command_buffer = nullptr)

When called, data will be transferred from this staging buffer to the destination buffer.

Parameters
command_bufferThe command buffer to record the transfer command in. If not specified an internal command buffer will be created and submitted to the appropriate queue.

◆ updateBuffer()

template<class DestinationClass >
void VulkanEngine::StagedBuffer< DestinationClass >::updateBuffer ( const void *  _data,
size_t  _data_size 
)
override

Copy the data to the buffer. Overridden to update the source buffer.

Parameters
_dataPointer to the data.
_data_sizeThe size of the data in bytes.

Member Data Documentation

◆ source_buffer

template<class DestinationClass >
Buffer VulkanEngine::StagedBuffer< DestinationClass >::source_buffer
protected

The source buffer. Data will be transferred from this buffer to the destination buffer when calling transferBuffer().


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