55 void create(std::size_t vertexSize, VkPrimitiveTopology topology, BufferTypes type = BufferTypes::DEFAULT);
58 void resize(std::size_t vertexSize);
59 void append(
Vertex const& vertex);
65 [[nodiscard]] std::size_t getCount()
const;
67 [[nodiscard]]
Vertex* getVertices();
68 [[nodiscard]]
Vertex const* getVertices()
const;
70 [[nodiscard]]
Vertex& operator[](std::size_t index);
71 [[nodiscard]]
Vertex const& operator[](std::size_t index)
const;
73 void setPrimitiveTopology(VkPrimitiveTopology topology);
74 [[nodiscard]] VkPrimitiveTopology getPrimitiveTopology()
const;
76 [[nodiscard]] VkBuffer getVerticesBuffer()
const;
77 [[nodiscard]] VmaAllocation getVerticesBufferAllocation()
const;
79 [[nodiscard]] BufferTypes getType()
const;
84 void mapBuffer()
const;
85 void cleanBuffer()
const;
86 void updateBuffer()
const;
88 std::vector<Vertex> g_vertices;
90 mutable VkBuffer g_buffer;
91 mutable VkBuffer g_stagingBuffer;
92 mutable VmaAllocation g_bufferAllocation;
93 mutable VmaAllocation g_stagingBufferAllocation;
94 mutable std::size_t g_bufferCapacity;
96 mutable bool g_needUpdate;
100 mutable VkPrimitiveTopology g_primitiveTopology;
114 void create(std::size_t indexSize, BufferTypes type = BufferTypes::DEFAULT);
117 void resize(std::size_t indexSize);
118 void append(uint16_t index = std::numeric_limits<uint16_t>::max());
120 void destroy()
final;
124 [[nodiscard]] std::size_t getCount()
const;
126 [[nodiscard]] uint16_t* getIndices();
127 [[nodiscard]] uint16_t
const* getIndices()
const;
129 [[nodiscard]] uint16_t& operator[](std::size_t index);
130 [[nodiscard]] uint16_t
const& operator[](std::size_t index)
const;
132 [[nodiscard]] VkBuffer getIndicesBuffer()
const;
133 [[nodiscard]] VmaAllocation getIndicesBufferAllocation()
const;
135 [[nodiscard]] BufferTypes getType()
const;
138 void mapBuffer()
const;
139 void cleanBuffer()
const;
140 void updateBuffer()
const;
142 std::vector<uint16_t> g_indices;
144 mutable VkBuffer g_buffer;
145 mutable VkBuffer g_stagingBuffer;
146 mutable VmaAllocation g_bufferAllocation;
147 mutable VmaAllocation g_stagingBufferAllocation;
148 mutable std::size_t g_bufferCapacity;
150 mutable bool g_needUpdate;
Definition C_contextAware.hpp:28
Vulkan context.
Definition C_context.hpp:70