Changeset 58453c3 in opengl-game for vulkan-game.cpp
- Timestamp:
- May 20, 2021, 3:50:12 PM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 567fa88
- Parents:
- c163d81
- git-author:
- Dmitry Portnoy <dportnoy@…> (05/20/21 15:48:15)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (05/20/21 15:50:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
rc163d81 r58453c3 194 194 modelPipeline.createDescriptorSetLayout(); 195 195 modelPipeline.createPipeline("shaders/model-vert.spv", "shaders/model-frag.spv"); 196 modelPipeline.createDescriptorPool(swapChainImages );197 modelPipeline.createDescriptorSets(swapChainImages );196 modelPipeline.createDescriptorPool(swapChainImages.size()); 197 modelPipeline.createDescriptorSets(swapChainImages.size()); 198 198 199 199 // START UNREVIEWED SECTION … … 458 458 shipPipeline.createDescriptorSetLayout(); 459 459 shipPipeline.createPipeline("shaders/ship-vert.spv", "shaders/ship-frag.spv"); 460 shipPipeline.createDescriptorPool(swapChainImages );461 shipPipeline.createDescriptorSets(swapChainImages );460 shipPipeline.createDescriptorPool(swapChainImages.size()); 461 shipPipeline.createDescriptorSets(swapChainImages.size()); 462 462 463 463 asteroidPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ModelVertex::pos)); … … 478 478 asteroidPipeline.createDescriptorSetLayout(); 479 479 asteroidPipeline.createPipeline("shaders/asteroid-vert.spv", "shaders/asteroid-frag.spv"); 480 asteroidPipeline.createDescriptorPool(swapChainImages );481 asteroidPipeline.createDescriptorSets(swapChainImages );480 asteroidPipeline.createDescriptorPool(swapChainImages.size()); 481 asteroidPipeline.createDescriptorSets(swapChainImages.size()); 482 482 483 483 laserPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&LaserVertex::pos)); … … 498 498 laserPipeline.createDescriptorSetLayout(); 499 499 laserPipeline.createPipeline("shaders/laser-vert.spv", "shaders/laser-frag.spv"); 500 laserPipeline.createDescriptorPool(swapChainImages );501 laserPipeline.createDescriptorSets(swapChainImages );500 laserPipeline.createDescriptorPool(swapChainImages.size()); 501 laserPipeline.createDescriptorSets(swapChainImages.size()); 502 502 503 503 explosionPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ExplosionVertex::particleStartVelocity)); … … 516 516 explosionPipeline.createDescriptorSetLayout(); 517 517 explosionPipeline.createPipeline("shaders/explosion-vert.spv", "shaders/explosion-frag.spv"); 518 explosionPipeline.createDescriptorPool(swapChainImages );519 explosionPipeline.createDescriptorSets(swapChainImages );518 explosionPipeline.createDescriptorPool(swapChainImages.size()); 519 explosionPipeline.createDescriptorSets(swapChainImages.size()); 520 520 521 521 // END UNREVIEWED SECTION … … 619 619 modelPipeline = GraphicsPipeline_Vulkan<ModelVertex>( 620 620 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 621 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages,24, 24);621 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 24, 24); 622 622 623 623 createBufferSet(objects_modelPipeline.capacity * sizeof(SSBO_ModelObject), … … 628 628 shipPipeline = GraphicsPipeline_Vulkan<ModelVertex>( 629 629 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 630 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages,138, 138);630 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 138, 138); 631 631 632 632 createBufferSet(objects_shipPipeline.capacity * sizeof(SSBO_ModelObject), … … 637 637 asteroidPipeline = GraphicsPipeline_Vulkan<ModelVertex>( 638 638 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 639 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages,24, 36);639 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 24, 36); 640 640 641 641 createBufferSet(objects_asteroidPipeline.capacity * sizeof(SSBO_Asteroid), … … 646 646 laserPipeline = GraphicsPipeline_Vulkan<LaserVertex>( 647 647 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 648 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages,8, 18);648 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 8, 18); 649 649 650 650 createBufferSet(objects_laserPipeline.capacity * sizeof(SSBO_Laser), … … 656 656 VK_PRIMITIVE_TOPOLOGY_POINT_LIST, physicalDevice, device, renderPass, 657 657 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 658 swapChainImages,EXPLOSION_PARTICLE_COUNT, EXPLOSION_PARTICLE_COUNT);658 EXPLOSION_PARTICLE_COUNT, EXPLOSION_PARTICLE_COUNT); 659 659 660 660 createBufferSet(objects_explosionPipeline.capacity * sizeof(SSBO_Explosion), … … 2226 2226 modelPipeline.updateRenderPass(renderPass); 2227 2227 modelPipeline.createPipeline("shaders/model-vert.spv", "shaders/model-frag.spv"); 2228 modelPipeline.createDescriptorPool(swapChainImages );2229 modelPipeline.createDescriptorSets(swapChainImages );2228 modelPipeline.createDescriptorPool(swapChainImages.size()); 2229 modelPipeline.createDescriptorSets(swapChainImages.size()); 2230 2230 2231 2231 createBufferSet(sizeof(UBO_VP_mats), … … 2235 2235 shipPipeline.updateRenderPass(renderPass); 2236 2236 shipPipeline.createPipeline("shaders/ship-vert.spv", "shaders/ship-frag.spv"); 2237 shipPipeline.createDescriptorPool(swapChainImages );2238 shipPipeline.createDescriptorSets(swapChainImages );2237 shipPipeline.createDescriptorPool(swapChainImages.size()); 2238 shipPipeline.createDescriptorSets(swapChainImages.size()); 2239 2239 2240 2240 createBufferSet(sizeof(UBO_VP_mats), … … 2244 2244 asteroidPipeline.updateRenderPass(renderPass); 2245 2245 asteroidPipeline.createPipeline("shaders/asteroid-vert.spv", "shaders/asteroid-frag.spv"); 2246 asteroidPipeline.createDescriptorPool(swapChainImages );2247 asteroidPipeline.createDescriptorSets(swapChainImages );2246 asteroidPipeline.createDescriptorPool(swapChainImages.size()); 2247 asteroidPipeline.createDescriptorSets(swapChainImages.size()); 2248 2248 2249 2249 createBufferSet(sizeof(UBO_VP_mats), … … 2253 2253 laserPipeline.updateRenderPass(renderPass); 2254 2254 laserPipeline.createPipeline("shaders/laser-vert.spv", "shaders/laser-frag.spv"); 2255 laserPipeline.createDescriptorPool(swapChainImages );2256 laserPipeline.createDescriptorSets(swapChainImages );2255 laserPipeline.createDescriptorPool(swapChainImages.size()); 2256 laserPipeline.createDescriptorSets(swapChainImages.size()); 2257 2257 2258 2258 createBufferSet(sizeof(UBO_Explosion), … … 2262 2262 explosionPipeline.updateRenderPass(renderPass); 2263 2263 explosionPipeline.createPipeline("shaders/explosion-vert.spv", "shaders/explosion-frag.spv"); 2264 explosionPipeline.createDescriptorPool(swapChainImages );2265 explosionPipeline.createDescriptorSets(swapChainImages );2264 explosionPipeline.createDescriptorPool(swapChainImages.size()); 2265 explosionPipeline.createDescriptorSets(swapChainImages.size()); 2266 2266 2267 2267 imageIndex = 0;
Note:
See TracChangeset
for help on using the changeset viewer.