Class StagingBuffer

Inheritance Relationships

Base Type

Class Documentation

class inexor::vulkan_renderer::wrapper::StagingBuffer : public inexor::vulkan_renderer::wrapper::GPUMemoryBuffer

RAII wrapper class for staging buffers. A staging buffer is a buffer which is used for copying data. Using a staging buffer is the most efficient way to copy memory from RAM to GPU.

Public Functions

StagingBuffer(const Device &device, const std::string &name, VkDeviceSize buffer_size, void *data, std::size_t data_size)

Default constructor.

  • device – The const reference to a device RAII wrapper instance.

  • name – The internal debug marker name of the staging buffer.

  • buffer_size – The size of the memory buffer to copy.

  • data – A pointer to the memory buffer.

  • data_size – The size of the memory buffer to copy.

StagingBuffer(const StagingBuffer&) = delete
StagingBuffer(StagingBuffer&&) noexcept
~StagingBuffer() override = default
StagingBuffer &operator=(const StagingBuffer&) = delete
StagingBuffer &operator=(StagingBuffer&&) = delete
void upload_data_to_gpu(const GPUMemoryBuffer &tarbuffer)

Call vkCmdCopyBuffer inside of the once command buffer.


tarbuffer – The memory buffer to copy.

Private Members

const Device &m_device
OnceCommandBuffer m_command_buffer_for_copying