Changeset 2d87297 in opengl-game for vulkan-game.cpp
- Timestamp:
- Feb 16, 2020, 8:22:40 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- d25381b
- Parents:
- 5a1ace0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r5a1ace0 r2d87297 202 202 uniformBuffers_scenePipeline, uniformBuffersMemory_scenePipeline, uniformBufferInfoList_scenePipeline); 203 203 // TODO: Calculate the size of this buffer (and all the other SSBOs) based on the number of objects 204 createBufferSet(10 * sizeof(S BO_SceneObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,204 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 205 205 storageBuffers_scenePipeline, storageBuffersMemory_scenePipeline, storageBufferInfoList_scenePipeline); 206 206 … … 221 221 }), { 222 222 0, 1, 2, 2, 3, 0 223 }, { 224 mat4(1.0f) 223 225 }); 224 226 … … 231 233 }), { 232 234 0, 1, 2, 2, 3, 0 235 }, { 236 mat4(1.0f) 233 237 }); 234 238 … … 252 256 }, { 253 257 0, 1, 2, 2, 3, 0 254 } );258 }, {}); 255 259 256 260 overlayPipeline.createDescriptorSetLayout(); … … 266 270 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 267 271 uniformBuffers_shipPipeline, uniformBuffersMemory_shipPipeline, uniformBufferInfoList_shipPipeline); 268 createBufferSet(10 * sizeof(S BO_SceneObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,272 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 269 273 storageBuffers_shipPipeline, storageBuffersMemory_shipPipeline, storageBufferInfoList_shipPipeline); 270 274 … … 506 510 132, 133, 134, 507 511 135, 136, 137, 512 }, { 513 mat4(1.0f) 508 514 }); 509 515 … … 520 526 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 521 527 uniformBuffers_asteroidPipeline, uniformBuffersMemory_asteroidPipeline, uniformBufferInfoList_asteroidPipeline); 522 createBufferSet(10 * sizeof(S BO_Asteroid), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,528 createBufferSet(10 * sizeof(SSBO_Asteroid), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 523 529 storageBuffers_asteroidPipeline, storageBuffersMemory_asteroidPipeline, storageBufferInfoList_asteroidPipeline); 524 530 … … 587 593 24, 25, 26, 27, 28, 29, 588 594 30, 31, 32, 33, 34, 35, 595 }, { 596 mat4(1.0f), 597 10.0f, 598 0 589 599 }); 590 600 … … 620 630 621 631 void VulkanGame::initGraphicsPipelines() { 622 modelPipeline = GraphicsPipeline_Vulkan<ModelVertex>(physicalDevice, device, renderPass, 632 overlayPipeline = GraphicsPipeline_Vulkan<OverlayVertex, void*>(physicalDevice, device, renderPass, 633 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 4, 6); 634 635 modelPipeline = GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject>(physicalDevice, device, renderPass, 623 636 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 16, 24); 624 637 625 overlayPipeline = GraphicsPipeline_Vulkan<OverlayVertex>(physicalDevice, device, renderPass, 626 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 4, 6); 627 628 shipPipeline = GraphicsPipeline_Vulkan<ShipVertex>(physicalDevice, device, renderPass, 638 shipPipeline = GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject>(physicalDevice, device, renderPass, 629 639 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 138, 138); 630 640 631 asteroidPipeline = GraphicsPipeline_Vulkan<AsteroidVertex >(physicalDevice, device, renderPass,641 asteroidPipeline = GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid>(physicalDevice, device, renderPass, 632 642 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, 24, 36); 633 643 } … … 707 717 }), { 708 718 0, 1, 2, 2, 3, 0 719 }, { 720 mat4(1.0f) 709 721 }); 710 722 … … 1449 1461 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 1450 1462 uniformBuffers_scenePipeline, uniformBuffersMemory_scenePipeline, uniformBufferInfoList_scenePipeline); 1451 createBufferSet(10 * sizeof(S BO_SceneObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,1463 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 1452 1464 storageBuffers_scenePipeline, storageBuffersMemory_scenePipeline, storageBufferInfoList_scenePipeline); 1453 1465 … … 1464 1476 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 1465 1477 uniformBuffers_shipPipeline, uniformBuffersMemory_shipPipeline, uniformBufferInfoList_shipPipeline); 1466 createBufferSet(10 * sizeof(S BO_SceneObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,1478 createBufferSet(10 * sizeof(SSBO_ModelObject), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 1467 1479 storageBuffers_shipPipeline, storageBuffersMemory_shipPipeline, storageBufferInfoList_shipPipeline); 1468 1480 … … 1474 1486 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, 1475 1487 uniformBuffers_asteroidPipeline, uniformBuffersMemory_asteroidPipeline, uniformBufferInfoList_asteroidPipeline); 1476 createBufferSet(10 * sizeof(S BO_Asteroid), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,1488 createBufferSet(10 * sizeof(SSBO_Asteroid), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 1477 1489 storageBuffers_asteroidPipeline, storageBuffersMemory_asteroidPipeline, storageBufferInfoList_asteroidPipeline); 1478 1490
Note:
See TracChangeset
for help on using the changeset viewer.