Blender V4.3
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)
 
void copy_to_device (VKContext &context)
 
void copy_from_device (VKContext &context)
 
const VKBufferhost_buffer_get () const
 
void free ()
 

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 )

Member Function Documentation

◆ copy_from_device()

◆ 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 52 of file vk_staging_buffer.cc.

References blender::gpu::VKBuffer::free().

◆ host_buffer_get()

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

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