NDEVR
API Documentation

A GPU buffer managed through the Vulkan API, used for vertex, index, and uniform data. More...

Inheritance diagram for VulkanBuffer:
[legend]
Collaboration diagram for VulkanBuffer:
[legend]

Public Member Functions

 VulkanBuffer (const StringView &label, const ConstPointer< VulkanDevice > &vulkan_instance)
 Constructs a named Vulkan buffer.
 VulkanBuffer (const TableColumn &reference_data, const ConstPointer< VulkanDevice > &vulkan_instance)
 Constructs a Vulkan buffer from existing table column data.
 VulkanBuffer (VulkanBuffer &&vulkan_buffer) noexcept
 Move constructor.
 ~VulkanBuffer ()
 Destructor.
void cleanup () override
 Releases all Vulkan resources held by this buffer.
void copyBuffer (VkBuffer srcBuffer, VkBuffer dstBuffer, uint04 src_start, uint04 dst_start, uint04 size)
 Copies data between two Vulkan buffers using a transfer command.
void copyData (const TableColumn &reference_data, bool set_type) override
 Copies all data from a table column into this buffer.
void copyData (const VulkanBuffer &reference_data, bool set_type)
 Copies data from another VulkanBuffer.
VkVertexInputBindingDescription getBindingDescription (uint04 number) const
 Returns the vertex input binding description for this buffer.
VkFormat getFormat () const
 Returns the overall Vulkan format for this buffer.
VkFormat getFormat (uint01 vertex_index) const
 Returns the Vulkan format for a specific vertex attribute index.
VkBuffer getVKBuffer () const
 Returns the underlying Vulkan buffer handle.
void insertRows (uint04 location, uint04 add_size) final override
 Inserts empty rows into the buffer at the given location.
virtual void setDefaultValueFrom (const TableColumn &) override
 Sets the default value from a table column (no-op for Vulkan buffers).
void setSize (uint04 buffer_size) final override
 Sets the total size of the buffer in number of elements.
void updateRegion (const TableColumn &column, uint04 offset, uint04 size) override
 Updates a region of the GPU buffer from a table column.
Public Member Functions inherited from GraphicsBuffer
 GraphicsBuffer (const StringView &label)
 Constructs a graphics buffer with the given label.
 GraphicsBuffer (GraphicsBuffer &&buffer) noexcept
 Move constructor.
const void * begin () const final
 Returns a const pointer to the beginning of the underlying raw data.
void * begin () final
 Returns a mutable pointer to the beginning of the underlying raw data.
bool beginsWith (uint04 index, const StringView &value, bool ignore_case) const override
 Checks whether the stored string at the given row begins with the given prefix.
uint08 capacity ()
 Returns the allocated capacity of this buffer.
virtual void compress (BinaryCompressionObject &object) override
 Compresses the column data into the given compression object.
bool contains (uint04 index, const StringView &value, bool ignore_case) const override
 Checks whether the stored string at the given row contains the given substring.
virtual void copyRow (uint04 source, uint04 destination) override
 Copies the value from one row to another within this column.
virtual void copyRows (uint04 source, uint04 destination, uint04 size) override
 Copies a contiguous block of rows from one location to another within this column.
const void * end () const final
 Returns a const pointer to one past the end of the underlying raw data.
void * end () final
 Returns a mutable pointer to one past the end of the underlying raw data.
void get (uint04 index, bool &value) const final override
 Retrieves a bool value at the given row index.
void get (uint04 index, fltp04 &value) const final override
 Retrieves a fltp04 value at the given row index.
void get (uint04 index, fltp08 &value) const final override
 Retrieves a fltp08 value at the given row index.
void get (uint04 index, RGBColor &value) const final override
 Retrieves an RGBColor value at the given row index.
void get (uint04 index, sint01 &value) const final override
 Retrieves a sint01 value at the given row index.
void get (uint04 index, sint02 &value) const final override
 Retrieves a sint02 value at the given row index.
void get (uint04 index, sint04 &value) const final override
 Retrieves a sint04 value at the given row index.
void get (uint04 index, sint08 &value) const final override
 Retrieves a sint08 value at the given row index.
void get (uint04 index, uint01 &value) const final override
 Retrieves a uint01 value at the given row index.
void get (uint04 index, uint02 &value) const final override
 Retrieves a uint02 value at the given row index.
void get (uint04 index, uint04 &value) const final override
 Retrieves a uint04 value at the given row index.
void get (uint04 index, uint04 vector_pos, bool &value) const final override
 Retrieves a bool value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, fltp04 &value) const final override
 Retrieves a fltp04 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, fltp08 &value) const final override
 Retrieves a fltp08 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, sint01 &value) const final override
 Retrieves a sint01 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, sint02 &value) const final override
 Retrieves a sint02 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, sint04 &value) const final override
 Retrieves a sint04 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, sint08 &value) const final override
 Retrieves a sint08 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, uint01 &value) const final override
 Retrieves a uint01 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, uint02 &value) const final override
 Retrieves a uint02 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, uint04 &value) const final override
 Retrieves a uint04 value at a specific vector position within a row.
void get (uint04 index, uint04 vector_pos, uint08 &value) const final override
 Retrieves a uint08 value at a specific vector position within a row.
void get (uint04 index, uint08 &value) const final override
 Retrieves a uint08 value at the given row index.
void get (uint04, StringAllocatingView &) const final override
 Retrieves a string value at the given row index as a StringAllocatingView.
void get (uint04, StringView &) const final override
 Retrieves a string value at the given row index as a StringView.
void get (uint04, uint04, StringAllocatingView &) const final override
 Retrieves a string value at a specific vector position within a row.
const StringAllocatingView getDefaultValue () const override
 Returns the default value for new rows as a string representation.
virtual TableColumngetSelected (const Buffer< bool > &) const override
 Creates a new TableColumn containing only the rows where the corresponding selected_indices entry is true.
void insert (uint04 index) override final
 Inserts a default-initialized row at the given index, shifting subsequent rows.
virtual void insertIndices (uint04 location, uint04 size) override
 Inserts a contiguous block of index entries at the given location.
bool isAccessable () const
 Checks whether the buffer is currently CPU-accessible.
bool isSame (uint04 index, const StringView &value) const override
 Checks whether the stored string at the given row is exactly equal to the given value.
virtual void mapFromFile (BinaryFileTableInfo &file) override
 Maps this column from a binary file for deserialization.
virtual void mapToFile (BinaryFileTableInfo &file, BinaryCompressionObject &object) override
 Maps this column to a binary file using compression.
virtual void mapToFile (BinaryFileTableInfo &file, int compression) override
 Maps this column to a binary file for serialization.
void removeIndices (const Buffer< uint04 > &offset_lookup_list) override final
 Removes index entries using an offset lookup list.
virtual void removeIndices (uint04 location, uint04 size) override
 Removes a contiguous block of index entries at the given location.
void removeRow (uint04 index) override final
 Removes a single row at the given index.
void removeRows (const Buffer< uint04 > &indices) override final
 Removes multiple rows identified by a sorted list of indices.
void removeRows (uint04 index, uint04 size) override final
 Removes a contiguous block of rows starting at the given index.
void removeRows (uint04 offset, const Buffer< bool > &indices) override
 Removes rows indicated by a boolean mask starting from a given offset.
void set (uint04 index, bool value) final override
 Sets a bool value at the given row index.
void set (uint04 index, fltp04 value) final override
 Sets a fltp04 value at the given row index.
void set (uint04 index, fltp08 value) final override
 Sets a fltp08 value at the given row index.
void set (uint04 index, RGBColor value) final override
 Sets an RGBColor value at the given row index.
void set (uint04 index, sint01 value) final override
 Sets a sint01 value at the given row index.
void set (uint04 index, sint02 value) final override
 Sets a sint02 value at the given row index.
void set (uint04 index, sint04 value) final override
 Sets a sint04 value at the given row index.
void set (uint04 index, sint08 value) final override
 Sets a sint08 value at the given row index.
void set (uint04 index, uint01 value) final override
 Sets a uint01 value at the given row index.
void set (uint04 index, uint02 value) final override
 Sets a uint02 value at the given row index.
void set (uint04 index, uint04 value) final override
 Sets a uint04 value at the given row index.
void set (uint04 index, uint04 vector_pos, bool value) final override
 Sets a bool value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, fltp04 value) final override
 Sets a fltp04 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, fltp08 value) final override
 Sets a fltp08 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, sint01 value) final override
 Sets a sint01 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, sint02 value) final override
 Sets a sint02 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, sint04 value) final override
 Sets a sint04 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, sint08 value) final override
 Sets a sint08 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, uint01 value) final override
 Sets a uint01 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, uint02 value) final override
 Sets a uint02 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, uint04 value) final override
 Sets a uint04 value at a specific vector position within a row.
void set (uint04 index, uint04 vector_pos, uint08 value) final override
 Sets a uint08 value at a specific vector position within a row.
void set (uint04 index, uint08 value) final override
 Sets a uint08 value at the given row index.
void set (uint04, const StringView &) final override
 Sets a string value at the given row index.
void set (uint04, uint04, const StringView &) final override
 Sets a string value at a specific vector position within a row.
virtual void setAccessable (bool is_accessable, bool copy_existing)
 Sets whether the buffer is CPU-accessible.
virtual void setDefaultValue (const StringAllocatingView &) override
 Sets the default value for new rows from a string representation.
void setType (const TypeInfo &type)
 Sets the element type for this buffer.
void setUsage (Type type)
 Sets the video card usage type for this buffer.
uint04 size () const final override
 Returns the number of rows in this column.
virtual void swap (uint04 a, uint04 b) override
 Swaps the values at two row indices.
virtual void swapIndices (uint04 a, uint04 b) override
 Swaps two index entries.
virtual TypeInfo type () const override
 Returns the type information for this buffer.
virtual void updateFrom (const TableColumn &column) override
 Synchronizes this buffer from a source TableColumn.
Public Member Functions inherited from TableColumn
 TableColumn (const StringView &label)
 Constructs a TableColumn with the given label.
virtual ~TableColumn ()
 Virtual destructor.
virtual void addRow ()
 Appends a single default-initialized row at the end of the column.
const Buffer< TableChange > & changes () const
 Returns the list of all recorded changes for this column.
Buffer< TableChangechangesSince (const Time &time) const
 Returns all changes recorded since the given time.
Buffer< TableChangechangesSince (const Time &time, const Bounds< 1, uint04 > &range) const
 Returns all changes recorded since the given time within a specific row range.
void clearUpdates ()
 Clears all recorded changes and resets the modified time to zero.
virtual void finishMapFromFile (BinaryFileTableInfo &)
 Completes any deferred work after mapping from a binary file.
template<class t_class>
t_class get (uint04 index) const
 Convenience template that returns a value by type from the given row index.
void get (uint04 index, BitFlag &bitflag) const
 Retrieves a BitFlag value at the given row index.
virtual void get (uint04 index, Bounds< 3, fltp04 > &bounds) const
 Retrieves a 3D fltp04 bounding box from the given row index.
virtual void get (uint04 index, Bounds< 3, fltp08 > &bounds) const
 Retrieves a 3D fltp08 bounding box from the given row index.
template<uint01 t_dims, class t_type>
void get (uint04 index, Bounds< t_dims, t_type > &bounds) const
 Retrieves a Bounds value at the given row index by reading min and max components from contiguous vector positions.
void get (uint04 index, const String &value) const =delete
 Deleted overload to prevent accidentally passing a const String by reference as an output parameter.
void get (uint04 index, File &file) const
 Retrieves a File value at the given row index.
virtual void get (uint04 index, Matrix< fltp04 > &transform) const
 Retrieves a 4x4 fltp04 matrix from the given row index.
virtual void get (uint04 index, Matrix< fltp08 > &transform) const
 Retrieves a 4x4 fltp08 matrix from the given row index.
template<class t_type, uint01 t_col, uint01 t_row>
void get (uint04 index, Matrix< t_type, t_col, t_row > &matrix) const
 Retrieves a generic matrix from the given row index by reading each element from contiguous vector positions in column-major order.
template<class t_class>
std::enable_if< ObjectInfo< t_class >::Enum >::type get (uint04 index, t_class &enum_value) const
 Retrieves an enum value at the given row index by reading a stored uint04.
template<class t_class>
std::enable_if< IsVec< t_class >::value &&t_class::NumberOfDimensions()!=1 >::type get (uint04 index, t_class &vector) const
 Retrieves a multi-dimensional vector value at the given row index.
template<class t_class>
std::enable_if< std::is_pointer< t_class >::value >::type get (uint04 index, t_class &vector) const
 Retrieves a pointer value at the given row index by reading a stored uint08.
void get (uint04 index, Time &time) const
 Retrieves a Time value at the given row index.
void get (uint04 index, TranslatedString &string) const
 Retrieves a TranslatedString value at the given row index.
template<uint01 t_dims, class t_type>
void get (uint04 index, Triangle< t_dims, t_type > &tri) const
 Retrieves a Triangle value at the given row index by reading vertex components from contiguous vector positions.
template<class t_class>
t_class get (uint04 index, uint04 sub_index) const
 Convenience template that returns a value by type from a specific vector position within a row.
virtual void get (uint04 index, UUID &vector) const
 Retrieves a UUID value at the given row index by reading 16 bytes.
template<class t_class>
void get (uint04 index, Vector< 1, t_class > &vector) const
 Retrieves a 1D vector value at the given row index by delegating to the scalar get.
void get (uint04 index, Vector< 32, bool > &value) const
 Retrieves a 32-element boolean vector at the given row index by reading the stored uint04 and reinterpreting its bits.
template<class t_type>
Buffer< t_type > getAll (uint04 start, uint04 size) const
 Retrieves a contiguous range of values as a typed buffer.
template<class t_type>
uint04 getIndexOf (const t_type &object) const
 Searches for the first row containing the given value.
Time getModifiedTime () const
 Returns the last modification time of this column.
virtual uint04 getRowSize (uint04) const
 Returns the size of an array-typed row at the given index.
virtual void getVector (uint04 index, Vector< 1, uint04 > &vector) const
 Retrieves a 1D uint04 vector from the given row index.
virtual void getVector (uint04 index, Vector< 2, uint04 > &vector) const
 Retrieves a 2D uint04 vector from the given row index.
virtual void getVector (uint04 index, Vector< 3, fltp04 > &vector) const
 Retrieves a 3D fltp04 vector from the given row index.
virtual void getVector (uint04 index, Vector< 3, fltp08 > &vector) const
 Retrieves a 3D fltp08 vector from the given row index.
virtual void getVector (uint04 index, Vector< 3, uint04 > &vector) const
 Retrieves a 3D uint04 vector from the given row index.
template<uint01 t_dims, class t_type>
void getVector (uint04 index, Vector< t_dims, t_type > &value) const
 Retrieves a generic vector from the given row index by reading each component from consecutive vector positions.
bool hasChangesSince (const Time &time, const Bounds< 1, uint04 > &range) const
 Checks whether any changes have been recorded since the given time within a row range.
template<class t_type>
void insert (uint04 index, const t_type &value)
 Inserts a new row at the given index and immediately sets its value.
const Stringlabel () const
 Returns the label (name) of this column.
UUID referenceTable () const
 Returns the UUID of a table that this column references, if any.
virtual void resetRow (uint04)
 Resets a row to its default state.
template<class t_type>
void set (t_type *values, uint04 start_index, uint04 size)
 Bulk-sets values from a raw pointer array into this column.
void set (uint04 index, const BitFlag &bitflag)
 Sets a BitFlag value at the given row index by storing its underlying bits.
void set (uint04 index, const BitReference &val)
 Sets the value at the given row index from a BitReference.
virtual void set (uint04 index, const Bounds< 3, fltp04 > &bounds)
 Sets a 3D fltp04 bounding box at the given row index.
virtual void set (uint04 index, const Bounds< 3, fltp08 > &bounds)
 Sets a 3D fltp08 bounding box at the given row index.
template<uint01 t_dims, class t_type>
void set (uint04 index, const Bounds< t_dims, t_type > &value)
 Sets a Bounds value at the given row index by writing min and max components into contiguous vector positions.
void set (uint04 index, const char *string)
 Sets the value at the given row index from a C-string pointer.
template<std::size_t N>
void set (uint04 index, const char(&string)[N])
 Sets the value at the given row index from a string literal.
void set (uint04 index, const File &value)
 Sets a File value at the given row index.
virtual void set (uint04 index, const Matrix< fltp04 > &transform)
 Sets a 4x4 fltp04 matrix value at the given row index.
virtual void set (uint04 index, const Matrix< fltp08 > &transform)
 Sets a 4x4 fltp08 matrix value at the given row index.
template<class t_type, uint01 t_col, uint01 t_row>
void set (uint04 index, const Matrix< t_type, t_col, t_row > &matrix)
 Sets a Matrix value at the given row index by writing each element column-major into contiguous vector positions.
void set (uint04 index, const std::nullptr_t &)
 Sets the value at the given row index to zero (nullptr overload).
void set (uint04 index, const String &value)
 Sets a String value at the given row index.
void set (uint04 index, const StringAllocatingView &string)
 Sets the value at the given row index from a StringAllocatingView.
template<class t_class>
std::enable_if< ObjectInfo< t_class >::Enum >::type set (uint04 index, const t_class &value)
 Sets an enum value at the given row index by casting to uint04.
template<class t_class>
std::enable_if< IsVec< t_class >::value >::type set (uint04 index, const t_class &value)
 Sets a vector value at the given row index.
template<class t_class>
std::enable_if<!ObjectInfo< t_class >::Enum >::type set (uint04 index, const t_class &value)
 Sets the value at the given row index from a non-enum type.
template<class t_pointer_type>
void set (uint04 index, const t_pointer_type *pointer)
 Sets the value at the given row index from a const pointer, stored as uint08.
void set (uint04 index, const Time &time)
 Sets a Time value at the given row index by storing its underlying uint08.
void set (uint04 index, const TranslatedString &value)
 Sets a TranslatedString value at the given row index.
template<uint01 t_dims, class t_type>
void set (uint04 index, const Triangle< t_dims, t_type > &value)
 Sets a Triangle value at the given row index by writing each vertex component into contiguous vector positions.
virtual void set (uint04 index, const UUID &value)
 Sets a UUID value at the given row index.
void set (uint04 index, const Vector< 32, bool > &value)
 Sets a 32-element boolean vector at the given row index.
template<class t_pointer_type>
void set (uint04 index, t_pointer_type *pointer)
 Sets the value at the given row index from a non-const pointer, stored as uint08.
template<class t_type>
void setAll (uint04 to_location, uint04 from_location, uint04 size, const TableColumn &from_column)
 Copies a range of values from another column into this column using a specific type.
virtual void setAll (uint04 to_location, uint04 from_location, uint04 size, const TableColumn &from_column)
 Copies a range of values from another column into this column.
void setCompressionMode (CompressionMode compression_mode)
 Sets the compression mode used when serializing this column.
template<class t_type>
std::enable_if<!std::is_enum< t_type >::value >::type setDefault (const t_type &value)
 Sets the default value for new rows from a non-enum value.
template<class t_type>
std::enable_if< std::is_enum< t_type >::value >::type setDefault (const t_type &value)
 Sets the default value for new rows from an enum value by casting to uint04.
void setLabel (const StringView &label)
 Sets the label (name) for this column.
void setReferenceTable (const UUID table)
 Sets the UUID of a table that this column references.
virtual void setRowSize (uint04, uint04)
 Sets the size of an array-typed row at the given index.
template<uint01 t_dims, class t_type>
void setVector (uint04 index, const Vector< t_dims, t_type > &value)
 Sets a vector value at the given row index, writing each component individually.
void update (const TableChange &change)
 Records a change to this column and updates the modification time.
void updateAll ()
 Marks the entire column as updated by recording a change spanning all rows.

Static Public Member Functions

static VkBuffer CreateVKBuffer (VkDeviceSize &allocation_size, const VulkanDevice &device, VkDeviceSize size, VkDeviceSize object_size, uint04 usage, uint04 properties, VkDeviceMemory &bufferMemory)
 Creates a new Vulkan buffer with the given properties.
static uint04 FindMemoryType (const VulkanDevice &device, uint04 typeFilter, uint04 properties)
 Finds a suitable memory type index on the device.

Private Member Functions

void getFromVideoCard (bool copy_existing) override
 Retrieves buffer data from the video card into CPU memory.
void * mapMemory (size_t offset, size_t size) const override
 Maps a region of GPU memory for CPU access.
void sendToVideoCard (bool copy_existing) override
 Sends buffer data from CPU memory to the video card.
void unmapMemory (size_t offset, size_t size) const override
 Unmaps a previously mapped memory region.

Additional Inherited Members

Public Types inherited from GraphicsBuffer
enum  Type {
  VERTEX , UNIFORM , INDEX , INSTANCE ,
  INDIRECT
}
 The usage type for this graphics buffer on the video card. More...
Protected Attributes inherited from GraphicsBuffer
uint08 m_allocated_size
 Allocated capacity in elements.
Type m_internal_type
 Video card usage type.
bool m_is_accessable
 Whether the buffer is CPU-accessible.
bool m_is_memory_owner
 Whether this buffer owns the underlying memory.
bool m_is_normalized
 Whether values are normalized on the GPU.
uint08 m_size
 Current number of elements in the buffer.
TypeInfo m_type
 Element type information.
Protected Attributes inherited from TableColumn
Buffer< TableChangem_changes
 The list of recorded changes for change-tracking and synchronization.
CompressionMode m_compression_mode = CompressionMode::e_default_compression
 The compression mode used when serializing this column.
String m_label
 The display name or identifier for this column.
Time m_modified_time
 The timestamp of the most recent modification to this column.
UUID m_reference_table = Constant<UUID>::Invalid
 UUID of a table this column references, or Invalid if none.

Detailed Description

A GPU buffer managed through the Vulkan API, used for vertex, index, and uniform data.


Definition at line 45 of file VulkanBuffer.h.

Constructor & Destructor Documentation

◆ VulkanBuffer() [1/3]

VulkanBuffer::VulkanBuffer ( const StringView & label,
const ConstPointer< VulkanDevice > & vulkan_instance )

Constructs a named Vulkan buffer.

Parameters
[in]labelThe debug label for this buffer.
[in]vulkan_instanceThe Vulkan device to allocate on.

References TableColumn::label().

Referenced by VulkanBuffer(), and copyData().

◆ VulkanBuffer() [2/3]

VulkanBuffer::VulkanBuffer ( const TableColumn & reference_data,
const ConstPointer< VulkanDevice > & vulkan_instance )

Constructs a Vulkan buffer from existing table column data.

Parameters
[in]reference_dataThe table column whose data will be uploaded.
[in]vulkan_instanceThe Vulkan device to allocate on.

◆ VulkanBuffer() [3/3]

VulkanBuffer::VulkanBuffer ( VulkanBuffer && vulkan_buffer)
noexcept

Move constructor.

Parameters
[in]vulkan_bufferThe buffer to move from.

References VulkanBuffer().

◆ ~VulkanBuffer()

VulkanBuffer::~VulkanBuffer ( )

Destructor.

Frees GPU resources.

Member Function Documentation

◆ copyBuffer()

void VulkanBuffer::copyBuffer ( VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint04 src_start,
uint04 dst_start,
uint04 size )

Copies data between two Vulkan buffers using a transfer command.

Parameters
[in]srcBufferThe source buffer.
[in]dstBufferThe destination buffer.
[in]src_startThe source offset in elements.
[in]dst_startThe destination offset in elements.
[in]sizeThe number of elements to copy.

References GraphicsBuffer::size().

◆ copyData() [1/2]

void VulkanBuffer::copyData ( const TableColumn & reference_data,
bool set_type )
overridevirtual

Copies all data from a table column into this buffer.

Parameters
[in]reference_dataThe source column.
[in]set_typeWhether to also copy the column type information.

Implements GraphicsBuffer.

◆ copyData() [2/2]

void VulkanBuffer::copyData ( const VulkanBuffer & reference_data,
bool set_type )

Copies data from another VulkanBuffer.

Parameters
[in]reference_dataThe source buffer.
[in]set_typeWhether to also copy the type information.

References VulkanBuffer().

◆ CreateVKBuffer()

VkBuffer VulkanBuffer::CreateVKBuffer ( VkDeviceSize & allocation_size,
const VulkanDevice & device,
VkDeviceSize size,
VkDeviceSize object_size,
uint04 usage,
uint04 properties,
VkDeviceMemory & bufferMemory )
static

Creates a new Vulkan buffer with the given properties.

Parameters
[in]allocation_sizeReceives the actual allocation size.
[in]deviceThe Vulkan device.
[in]sizeThe requested buffer size in bytes.
[in]object_sizeThe size of a single element.
[in]usageVulkan buffer usage flags.
[in]propertiesVulkan memory property flags.
[in]bufferMemoryReceives the allocated device memory handle.
Returns
The created VkBuffer handle.

References GraphicsBuffer::size().

◆ FindMemoryType()

uint04 VulkanBuffer::FindMemoryType ( const VulkanDevice & device,
uint04 typeFilter,
uint04 properties )
static

Finds a suitable memory type index on the device.

Parameters
[in]deviceThe Vulkan device.
[in]typeFilterBitmask of acceptable memory type indices.
[in]propertiesRequired memory property flags.
Returns
The memory type index.

◆ getBindingDescription()

VkVertexInputBindingDescription VulkanBuffer::getBindingDescription ( uint04 number) const

Returns the vertex input binding description for this buffer.

Parameters
[in]numberThe binding number.
Returns
The binding description.

◆ getFormat() [1/2]

VkFormat VulkanBuffer::getFormat ( ) const

Returns the overall Vulkan format for this buffer.

Returns
The VkFormat.

◆ getFormat() [2/2]

VkFormat VulkanBuffer::getFormat ( uint01 vertex_index) const

Returns the Vulkan format for a specific vertex attribute index.

Parameters
[in]vertex_indexThe attribute index.
Returns
The VkFormat for that attribute.

◆ getFromVideoCard()

void VulkanBuffer::getFromVideoCard ( bool copy_existing)
overrideprivatevirtual

Retrieves buffer data from the video card into CPU memory.

Parameters
[in]copy_existingWhether to copy existing GPU data.

Implements GraphicsBuffer.

◆ getVKBuffer()

VkBuffer VulkanBuffer::getVKBuffer ( ) const

Returns the underlying Vulkan buffer handle.

Returns
The VkBuffer handle.

◆ insertRows()

void VulkanBuffer::insertRows ( uint04 location,
uint04 add_size )
finaloverridevirtual

Inserts empty rows into the buffer at the given location.

Parameters
[in]locationThe row index at which to insert.
[in]add_sizeThe number of rows to insert.

Implements TableColumn.

◆ mapMemory()

void * VulkanBuffer::mapMemory ( size_t offset,
size_t size ) const
overrideprivatevirtual

Maps a region of GPU memory for CPU access.

Parameters
[in]offsetByte offset into the buffer.
[in]sizeNumber of bytes to map.
Returns
Pointer to the mapped memory region.

Implements GraphicsBuffer.

References GraphicsBuffer::size().

◆ sendToVideoCard()

void VulkanBuffer::sendToVideoCard ( bool copy_existing)
overrideprivatevirtual

Sends buffer data from CPU memory to the video card.

Parameters
[in]copy_existingWhether to copy existing CPU data.

Implements GraphicsBuffer.

◆ setSize()

void VulkanBuffer::setSize ( uint04 buffer_size)
finaloverridevirtual

Sets the total size of the buffer in number of elements.

Parameters
[in]buffer_sizeThe new element count.

Implements TableColumn.

◆ unmapMemory()

void VulkanBuffer::unmapMemory ( size_t offset,
size_t size ) const
overrideprivatevirtual

Unmaps a previously mapped memory region.

Parameters
[in]offsetByte offset that was mapped.
[in]sizeNumber of bytes that were mapped.

Implements GraphicsBuffer.

References GraphicsBuffer::size().

◆ updateRegion()

void VulkanBuffer::updateRegion ( const TableColumn & column,
uint04 offset,
uint04 size )
overridevirtual

Updates a region of the GPU buffer from a table column.

Parameters
[in]columnThe source data.
[in]offsetThe starting element offset.
[in]sizeThe number of elements to update.

Implements GraphicsBuffer.

References GraphicsBuffer::size().


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