Changeset 3b84bb6 in opengl-game for graphics-pipeline_vulkan.hpp
- Timestamp:
- Feb 25, 2020, 6:51:02 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 44f23af
- Parents:
- 2da64ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics-pipeline_vulkan.hpp
r2da64ef r3b84bb6 71 71 void createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage); 72 72 73 void addVertices(const vector<VertexType>& vertices, vector<uint16_t> indices, VkCommandPool commandPool,74 Vk Queue graphicsQueue);73 bool addObject(const vector<VertexType>& vertices, vector<uint16_t> indices, SSBOType& ssbo, 74 VkCommandPool commandPool, VkQueue graphicsQueue); 75 75 76 76 void updateObject(size_t objIndex, SSBOType& ssbo); … … 125 125 126 126 // TODO: Verify that vertex capacity and index capacity are both > 0 127 // TODO: See if it would be feasible to move code in the createPipeline method 128 // into the constructor. That way, I can also put relevant cleanup code into the destructor 127 129 template<class VertexType, class SSBOType> 128 130 GraphicsPipeline_Vulkan<VertexType, SSBOType>::GraphicsPipeline_Vulkan( … … 473 475 474 476 template<class VertexType, class SSBOType> 475 void GraphicsPipeline_Vulkan<VertexType, SSBOType>::addVertices(const vector<VertexType>& vertices, vector<uint16_t> indices, 476 VkCommandPool commandPool, VkQueue graphicsQueue) { 477 bool GraphicsPipeline_Vulkan<VertexType, SSBOType>::addObject( 478 const vector<VertexType>& vertices, vector<uint16_t> indices, 479 SSBOType& ssbo, VkCommandPool commandPool, VkQueue graphicsQueue) { 480 481 // TODO: When resizing the vertex or index buffer, take deleted objects into account. 482 // Remove their data from the buffer and determine the new size of the bufer based on # of remining objects 483 484 // If # non-deleted objects > currentCapacity / 2 485 // - resize and double capacity 486 // else If # non-deleted objects < currentCapacity / 4 487 // - resize amd halve capacity 488 // else 489 // - don't resize, but rewrite data in the buffer to only have non-deleted objects 477 490 478 491 if (numVertices + vertices.size() > vertexCapacity) { … … 490 503 graphicsQueue); 491 504 numIndices += indices.size(); 505 506 bool resizedStorageBuffer = false; 507 508 return resizedStorageBuffer; 492 509 } 493 510
Note:
See TracChangeset
for help on using the changeset viewer.