VPP  0.8
A high-level modern C++ API for Vulkan
vpp::Buf Class Reference

Generic class representing Vulkan buffers. More...

#include <vppBuffer.hpp>

Inheritance diagram for vpp::Buf:
vpp::Buffer< USAGE > vpp::gvector< std::uint32_t, Buf::INDEX > vpp::gvector< VkDispatchIndirectCommand, Buf::INDIRECT > vpp::gvector< VkDrawIndexedIndirectCommand, Buf::INDIRECT > vpp::gvector< VkDrawIndirectCommand, Buf::INDIRECT > vpp::dgvector< ItemT, USAGE > vpp::gvector< ItemT, USAGE > vpp::Indices vpp::DispatchIndirectCommands vpp::IndexedIndirectCommands vpp::IndirectCommands

Public Types

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 }
 

Public Member Functions

 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 Devicedevice () 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.
 

Detailed Description

Generic class representing Vulkan buffers.

This object is reference-counted and may be passed by value.

It is not recommended to create these objects directly. Use Buffer instead.

This class serves mainly as a base class for the Buffer template. It contains some useful methods that are inherited. Also many VPP functions accept Buf as an argument, so you can provide any Buffer template instance.

Member Enumeration Documentation

◆ EUsageFlags

Buffer usage flags. Can be bitwise-combined to create multipurpose buffers.

Enumerator
SOURCE 

Source buffer for transfer operations.

TARGET 

Target buffer for transfer operations.

UNITEX 

Read-only formatted data (uniform texel buffer).

STORTEX 

Read & write formatted data (storage texel buffer).

UNIFORM 

Read-only common data (uniform buffer).

STORAGE 

Read & write array (storage buffer).

INDEX 

Vertex index array for indexed primitives.

VERTEX 

Vertex attributes array.

INDIRECT 

Buffer holding indirect draw ranges.


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