Changeset d25381b in opengl-game
- Timestamp:
- Feb 18, 2020, 9:33:34 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 860a0da
- Parents:
- 2d87297
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (02/16/20 21:16:53)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (02/18/20 21:33:34)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r2d87297 rd25381b 200 200 201 201 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 202 uniformBuffers_ scenePipeline, uniformBuffersMemory_scenePipeline, uniformBufferInfoList_scenePipeline);202 uniformBuffers_modelPipeline, uniformBuffersMemory_modelPipeline, uniformBufferInfoList_modelPipeline); 203 203 // TODO: Calculate the size of this buffer (and all the other SSBOs) based on the number of objects 204 204 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 205 storageBuffers_ scenePipeline, storageBuffersMemory_scenePipeline, storageBufferInfoList_scenePipeline);205 storageBuffers_modelPipeline, storageBuffersMemory_modelPipeline, storageBufferInfoList_modelPipeline); 206 206 207 207 modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 208 VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList_ scenePipeline);208 VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList_modelPipeline); 209 209 modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 210 VK_SHADER_STAGE_VERTEX_BIT, &storageBufferInfoList_ scenePipeline);210 VK_SHADER_STAGE_VERTEX_BIT, &storageBufferInfoList_modelPipeline); 211 211 212 212 modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, … … 787 787 so_Asteroid.model = asteroidObjects[0].model_transform * asteroidObjects[0].model_base; 788 788 789 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_ scenePipeline[currentImage], 0, object_VP_mats);789 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_modelPipeline[currentImage], 0, object_VP_mats); 790 790 791 791 for (size_t i = 0; i < modelObjects.size(); i++) { 792 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_ scenePipeline[currentImage],792 VulkanUtils::copyDataToMemory(device, storageBuffersMemory_modelPipeline[currentImage], 793 793 i, so_Object); 794 794 } … … 1460 1460 1461 1461 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 1462 uniformBuffers_ scenePipeline, uniformBuffersMemory_scenePipeline, uniformBufferInfoList_scenePipeline);1462 uniformBuffers_modelPipeline, uniformBuffersMemory_modelPipeline, uniformBufferInfoList_modelPipeline); 1463 1463 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 1464 storageBuffers_ scenePipeline, storageBuffersMemory_scenePipeline, storageBufferInfoList_scenePipeline);1464 storageBuffers_modelPipeline, storageBuffersMemory_modelPipeline, storageBufferInfoList_modelPipeline); 1465 1465 1466 1466 modelPipeline.updateRenderPass(renderPass); … … 1519 1519 vkDestroySwapchainKHR(device, swapChain, nullptr); 1520 1520 1521 for (size_t i = 0; i < uniformBuffers_ scenePipeline.size(); i++) {1522 vkDestroyBuffer(device, uniformBuffers_ scenePipeline[i], nullptr);1523 vkFreeMemory(device, uniformBuffersMemory_ scenePipeline[i], nullptr);1524 } 1525 1526 for (size_t i = 0; i < storageBuffers_ scenePipeline.size(); i++) {1527 vkDestroyBuffer(device, storageBuffers_ scenePipeline[i], nullptr);1528 vkFreeMemory(device, storageBuffersMemory_ scenePipeline[i], nullptr);1521 for (size_t i = 0; i < uniformBuffers_modelPipeline.size(); i++) { 1522 vkDestroyBuffer(device, uniformBuffers_modelPipeline[i], nullptr); 1523 vkFreeMemory(device, uniformBuffersMemory_modelPipeline[i], nullptr); 1524 } 1525 1526 for (size_t i = 0; i < storageBuffers_modelPipeline.size(); i++) { 1527 vkDestroyBuffer(device, storageBuffers_modelPipeline[i], nullptr); 1528 vkFreeMemory(device, storageBuffersMemory_modelPipeline[i], nullptr); 1529 1529 } 1530 1530 -
vulkan-game.hpp
r2d87297 rd25381b 148 148 149 149 GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline; 150 151 150 vector<SceneObject<OverlayVertex, void*>> overlayObjects; 152 151 153 // TODO: Rename all the variables related to modelPipeline to use the same pipelie name154 155 152 GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline; 156 157 153 vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects; 158 154 159 vector<VkBuffer> uniformBuffers_ scenePipeline;160 vector<VkDeviceMemory> uniformBuffersMemory_ scenePipeline;161 vector<VkDescriptorBufferInfo> uniformBufferInfoList_ scenePipeline;162 163 vector<VkBuffer> storageBuffers_ scenePipeline;164 vector<VkDeviceMemory> storageBuffersMemory_ scenePipeline;165 vector<VkDescriptorBufferInfo> storageBufferInfoList_ scenePipeline;155 vector<VkBuffer> uniformBuffers_modelPipeline; 156 vector<VkDeviceMemory> uniformBuffersMemory_modelPipeline; 157 vector<VkDescriptorBufferInfo> uniformBufferInfoList_modelPipeline; 158 159 vector<VkBuffer> storageBuffers_modelPipeline; 160 vector<VkDeviceMemory> storageBuffersMemory_modelPipeline; 161 vector<VkDescriptorBufferInfo> storageBufferInfoList_modelPipeline; 166 162 167 163 UBO_VP_mats object_VP_mats; … … 169 165 170 166 GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline; 171 172 167 vector<SceneObject<ShipVertex, SSBO_ModelObject>> shipObjects; 173 168 … … 184 179 185 180 GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline; 186 187 181 vector<SceneObject<AsteroidVertex, SSBO_Asteroid>> asteroidObjects; 188 182
Note:
See TracChangeset
for help on using the changeset viewer.