Blender V5.0
blender::gpu::VKStagingBuffer Class Reference

#include <vk_staging_buffer.hh>

Public Types

enum class  Direction { HostToDevice , DeviceToHost }

Public Member Functions

 VKStagingBuffer (const VKBuffer &device_buffer, Direction direction, VkDeviceSize device_buffer_offset=0, VkDeviceSize region_size=UINT64_MAX)
void copy_to_device (VKContext &context)
void copy_from_device (VKContext &context)
VKBufferhost_buffer_get ()
void free ()
VkDeviceSize size_in_bytes_get () const

Detailed Description

Utility class to copy data from host to device and vise versa.

This is a common as buffers on device are more performant than when located inside host memory.

Definition at line 21 of file vk_staging_buffer.hh.

Member Enumeration Documentation

◆ Direction

Direction of the transfer.

Enumerator
HostToDevice 

Transferring data from host to device.

DeviceToHost 

Transferring data from device to host.

Definition at line 26 of file vk_staging_buffer.hh.

Constructor & Destructor Documentation

◆ VKStagingBuffer()

blender::gpu::VKStagingBuffer::VKStagingBuffer ( const VKBuffer & device_buffer,
Direction direction,
VkDeviceSize device_buffer_offset = 0,
VkDeviceSize region_size = UINT64_MAX )

Member Function Documentation

◆ copy_from_device()

void blender::gpu::VKStagingBuffer::copy_from_device ( VKContext & context)

◆ copy_to_device()

◆ free()

void blender::gpu::VKStagingBuffer::free ( )

Free the host memory.

In case a reference of the staging buffer is kept, but the host resource isn't needed anymore.

Definition at line 64 of file vk_staging_buffer.cc.

◆ host_buffer_get()

VKBuffer & blender::gpu::VKStagingBuffer::host_buffer_get ( )
inline

◆ size_in_bytes_get()

VkDeviceSize blender::gpu::VKStagingBuffer::size_in_bytes_get ( ) const
inline

Definition at line 82 of file vk_staging_buffer.hh.


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