Changeset d25381b in opengl-game for vulkan-game.cpp
- 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)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.