Changeset 5ea0a37 in opengl-game for vulkan-buffer.hpp
- Timestamp:
- Jun 11, 2021, 10:05:25 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 90880fb
- Parents:
- 6486ba8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-buffer.hpp
r6486ba8 r5ea0a37 31 31 VulkanBuffer<T>& operator=(VulkanBuffer<T>&& other) noexcept; 32 32 33 void resize(); 33 size_t memorySize(); 34 35 T* data(); // Not sure I need to expose this 34 36 35 37 T& get(uint32_t index); 36 38 void add(T obj); 37 39 38 size_t memorySize();40 void resize(); 39 41 40 42 private: … … 114 116 range = other.range; 115 117 118 mappedData = other.mappedData; 119 116 120 if (rawData != nullptr) { 117 121 free(rawData); … … 124 128 other.range = 0; 125 129 130 other.mappedData.clear(); 126 131 other.rawData = nullptr; 127 132 } … … 131 136 132 137 template<class T> 133 void VulkanBuffer<T>::resize() { 134 resized = false; 138 size_t VulkanBuffer<T>::memorySize() { 139 return memRequirement(capacity); 140 } 141 142 template<class T> 143 T* VulkanBuffer<T>::data() { 144 return rawData; 135 145 } 136 146 … … 145 155 template<class T> 146 156 void VulkanBuffer<T>::add(T obj) { 157 // TODO: Maybe copy this to the resize() function and call that function here 147 158 if (numObjects == capacity) { 148 159 // Once I add Vulkan buffer objects in here, make sure this doesn't overlap with resizeBufferSet … … 171 182 172 183 template<class T> 173 size_t VulkanBuffer<T>::memorySize() {174 re turn memRequirement(capacity);184 void VulkanBuffer<T>::resize() { 185 resized = false; 175 186 } 176 187
Note:
See TracChangeset
for help on using the changeset viewer.