![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Array allocated entirely on GPU side, without any mapping to the CPU side. More...
#include <vppContainers.hpp>
Public Member Functions | |
dgvector (size_t maxItemCount, const Device &hDevice) | |
void | cmdCopyToImage (CommandBuffer hCmdBuffer, const Img &img, VkImageLayout targetLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Generates a command to copy the buffer contents to specified image. | |
void | cmdCopyToImage (const Img &img, VkImageLayout targetLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Generates a command (to the implicit context) to copy the buffer contents to specified image. | |
void | copyToImage (EQueueType eQueue, const Img &img, VkImageLayout targetLayout, const Fence &signalFenceOnEnd=Fence(), const Semaphore &waitOnBegin=Semaphore(), const Semaphore &signalOnEnd=Semaphore(), std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Submits a command to copy the buffer contents to specified image. | |
void | copyToImageAndWait (EQueueType eQueue, const Img &img, VkImageLayout targetLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Submits a command to copy the buffer contents to specified image, waits for completion. | |
void | cmdCopyFromImage (CommandBuffer hCmdBuffer, const Img &img, VkImageLayout sourceImageLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Generates a command to copy the buffer contents from specified image. | |
void | cmdCopyFromImage (const Img &img, VkImageLayout sourceImageLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Generates a command (to the implicit context) to copy the buffer contents from specified image. | |
void | copyFromImage (EQueueType eQueue, const Img &img, VkImageLayout sourceImageLayout, const Fence &signalFenceOnEnd=Fence(), const Semaphore &waitOnBegin=Semaphore(), const Semaphore &signalOnEnd=Semaphore(), std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Submits a command to copy the buffer contents from specified image. | |
void | copyFromImageAndWait (EQueueType eQueue, const Img &img, VkImageLayout sourceImageLayout, std::uint32_t mipLevel=0, std::uint32_t layer=0, const VkOffset3D &imageOffset=VkOffset3D { 0, 0, 0 }, const VkExtent3D &imageExtent=VkExtent3D { 0, 0, 0 }, VkDeviceSize bufferOffset=0, std::uint32_t bufferRowLength=0, std::uint32_t bufferImageHeight=0) |
Submits a command to copy the buffer contents from specified image. Waits for completion. | |
![]() | |
Buffer () | |
Constructs null reference. | |
Buffer (VkDeviceSize size, const Device &hDevice, unsigned int flags=0, unsigned int addUsage=0) | |
Constructs a buffer of given size and usage (bitwise combination of EUsageFlags values), associated with given device. | |
Buffer (VkDeviceSize size, const Device &hDevice, const std::vector< unsigned int > &queueFamilyIndices, unsigned int flags=0, unsigned int addUsage=0) | |
Constructs a buffer of given size and usage (bitwise combination of EUsageFlags values), associated with given device. This constructor also takes a list of queue families allowed to access the buffer in concurrent mode. | |
template<unsigned int USAGE2> | |
Buffer (const Buffer< USAGE2 > &other) | |
Construct new reference to existing buffer, with compatible usage. | |
![]() | |
Buf () | |
Constructs null reference. | |
Buf (VkDeviceSize bufferSize, unsigned int usageMask, const Device &hDevice, unsigned int flags=0) | |
Constructs a buffer of given size and usage (bitwise combination of EUsageFlags values), associated with given device. | |
Buf (VkDeviceSize bufferSize, unsigned int usageMask, const Device &hDevice, const std::vector< unsigned int > &queueFamilyIndices, unsigned int flags=0) | |
Constructs a buffer of given size and usage (bitwise combination of EUsageFlags values), associated with given device. This constructor also takes a list of queue families allowed to access the buffer in concurrent mode. | |
operator bool () const | |
Checks whether this is not a null reference. | |
VkBuffer | handle () const |
Retrieves Vulkan handle of the buffer. | |
const Device & | device () const |
Retrieves the device associated with the buffer. | |
VkDeviceSize | size () const |
Retrieves the size of the buffer. | |
unsigned int | getUsage () const |
Retrieves usage flags of the buffer. | |
template<class MemoryT > | |
MemoryT | bindMemory (const MemProfile &memProfile) const |
Allocates and binds memory for the buffer. | |
![]() | |
MemoryBinding () | |
Constructs null reference. | |
MemoryBinding (const Buffer< USAGE > &res, const MemProfile &memProfile) | |
Binds memory to a buffer and constructs MemoryBinding object. | |
const Buffer< USAGE > & | resource () const |
Retrieves the buffer. | |
DeviceMemory & | memory () |
Retrieves the memory object. | |
Additional Inherited Members | |
![]() | |
enum | EUsageFlags { SOURCE = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, TARGET = VK_BUFFER_USAGE_TRANSFER_DST_BIT, UNITEX = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, STORTEX = VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, UNIFORM = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, STORAGE = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, INDEX = VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VERTEX = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, INDIRECT = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT } |
Buffer usage flags. Can be bitwise-combined to create multipurpose buffers. More... | |
enum | ECreationFlags { SPARSE_BINDING = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, SPARSE_RESIDENCY = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, SPARSE_ALIASED = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT } |
![]() | |
static const unsigned int | usage = USAGE |
Array allocated entirely on GPU side, without any mapping to the CPU side.
Use this class for buffers of data which are generated and consumed entirely on GPU side, without a need to transfer to/from CPU. Such transfers are still possible but require explicit transfer command to be issued. This vector class does not offer a staging buffer functionality, therefore has less memory overhead than gvector (no buffer copy on CPU side).
Use for best performance during multiple-staged GPU computations.