API Documentation
Loading...
Searching...
No Matches
VulkanBuffer.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Graphics
28File: VulkanBuffer
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDefines.h"
34#include "VulkanDevice.h"
40namespace NDEVR
41{
43 {
44 public:
45 VulkanBuffer(const String& label, const ConstPointer<VulkanDevice>& vulkan_instance);
46 VulkanBuffer(const TableColumn& reference_data, const ConstPointer<VulkanDevice>& vulkan_instance);
47 VulkanBuffer(VulkanBuffer&& vulkan_buffer) noexcept;
49 void insertRows(uint04 location, uint04 add_size) final override;
50 void setSize(uint04 buffer_size) final override;
51 void updateRegion(const TableColumn& column, uint04 offset, uint04 size) override;
52 void copyData(const TableColumn& reference_data, bool set_type) override;
53 void cleanup() override;
54
55 VkBuffer getVKBuffer() const;
56 VkVertexInputBindingDescription getBindingDescription(uint04 number) const;
57 VkFormat getFormat(uint01 vertex_index) const;
58 VkFormat getFormat() const;
59 void copyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint04 src_start, uint04 dst_start, uint04 size, bool wait_for_completion);
60 void copyData(const VulkanBuffer& reference_data, bool set_type);
61 public:
62 static uint04 findMemoryType(const VulkanDevice& device, uint04 typeFilter, uint04 properties);
63 static VkBuffer createVKBuffer(uint04& allocation_size, const VulkanDevice& device, uint04 size, uint04 object_size, uint04 usage, uint04 properties, VkDeviceMemory& bufferMemory);
64 private:
65 uint04 getFlags() const;
66 void getFromVideoCard(bool copy_existing) override;
67 void sendToVideoCard(bool copy_existing) override;
68 void* mapMemory(size_t offset, size_t size) const override;
69 void unmapMemory() const override;
70 private:
72 VkDeviceMemory m_device_memory;
73 VkBuffer m_vertex_buffer;
74 };
75}
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Definition GraphicsBuffer.h:39
uint04 size() const final override
Definition GraphicsBuffer.h:376
The core String class for the software.
Definition String.h:47
Definition TableColumn.h:68
const String & label() const
Definition VulkanBuffer.h:43
void copyData(const TableColumn &reference_data, bool set_type) override
VkBuffer getVKBuffer() const
void copyData(const VulkanBuffer &reference_data, bool set_type)
VkVertexInputBindingDescription getBindingDescription(uint04 number) const
VkFormat getFormat(uint01 vertex_index) const
void setSize(uint04 buffer_size) final override
void cleanup() override
static VkBuffer createVKBuffer(uint04 &allocation_size, const VulkanDevice &device, uint04 size, uint04 object_size, uint04 usage, uint04 properties, VkDeviceMemory &bufferMemory)
void insertRows(uint04 location, uint04 add_size) final override
VkFormat getFormat() const
void copyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint04 src_start, uint04 dst_start, uint04 size, bool wait_for_completion)
VulkanBuffer(const String &label, const ConstPointer< VulkanDevice > &vulkan_instance)
static uint04 findMemoryType(const VulkanDevice &device, uint04 typeFilter, uint04 properties)
VulkanBuffer(const TableColumn &reference_data, const ConstPointer< VulkanDevice > &vulkan_instance)
VulkanBuffer(VulkanBuffer &&vulkan_buffer) noexcept
void updateRegion(const TableColumn &column, uint04 offset, uint04 size) override
Definition VulkanDevice.h:8
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:78
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:94