33#include "VulkanDefines.h"
34#include "VulkanDevice.h"
35#include <NDEVR/GraphicsBuffer.h>
36#include <NDEVR/TableColumn.h>
37#include <NDEVR/Pointer.h>
132 VkDeviceMemory m_device_memory;
133 VkBuffer m_vertex_buffer;
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
GraphicsBuffer(const StringView &label)
Constructs a graphics buffer with the given label.
uint04 size() const final override
Returns the number of rows in this column.
The core String View class for the NDEVR API.
A virtual storage type that is used with Table class to store data where the actual mechanism for sto...
const String & label() const
Returns the label (name) of this column.
void sendToVideoCard(bool copy_existing) override
Sends buffer data from CPU memory to the video card.
VulkanBuffer(VulkanBuffer &&vulkan_buffer) noexcept
Move constructor.
static uint04 FindMemoryType(const VulkanDevice &device, uint04 typeFilter, uint04 properties)
Finds a suitable memory type index on the device.
void cleanup() override
Releases all Vulkan resources held by this buffer.
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 copyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint04 src_start, uint04 dst_start, uint04 size)
Copies data between two Vulkan buffers using a transfer command.
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.
~VulkanBuffer()
Destructor.
VkVertexInputBindingDescription getBindingDescription(uint04 number) const
Returns the vertex input binding description for this buffer.
VulkanBuffer(const StringView &label, const ConstPointer< VulkanDevice > &vulkan_instance)
Constructs a named Vulkan buffer.
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.
VkFormat getFormat(uint01 vertex_index) const
Returns the Vulkan format for a specific vertex attribute index.
void updateRegion(const TableColumn &column, uint04 offset, uint04 size) override
Updates a region of the GPU buffer from a table column.
void copyData(const VulkanBuffer &reference_data, bool set_type)
Copies data from another VulkanBuffer.
VkBuffer getVKBuffer() const
Returns the underlying Vulkan buffer handle.
void copyData(const TableColumn &reference_data, bool set_type) override
Copies all data from a table column into this buffer.
VkFormat getFormat() const
Returns the overall Vulkan format for this buffer.
VulkanBuffer(const TableColumn &reference_data, const ConstPointer< VulkanDevice > &vulkan_instance)
Constructs a Vulkan buffer from existing table column data.
void setSize(uint04 buffer_size) final override
Sets the total size of the buffer in number of elements.
void unmapMemory(size_t offset, size_t size) const override
Unmaps a previously mapped memory region.
A GraphicsDevice for managing Vulkan limitations and actions.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...