Changeset 6bac215 in opengl-game for vulkan-game.cpp
- Timestamp:
- Jun 9, 2021, 12:38:14 AM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- bb76950
- Parents:
- 8dcbf62
- git-author:
- Dmitry Portnoy <dportnoy@…> (06/09/21 00:38:09)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (06/09/21 00:38:14)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r8dcbf62 r6bac215 616 616 617 617 createBufferSet(objects_modelPipeline.capacity * sizeof(SSBO_ModelObject), 618 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 619 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 620 storageBuffers_modelPipeline); 618 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT 619 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 620 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 621 storageBuffers_modelPipeline); 621 622 622 623 shipPipeline = GraphicsPipeline_Vulkan<ModelVertex>( … … 625 626 626 627 createBufferSet(objects_shipPipeline.capacity * sizeof(SSBO_ModelObject), 627 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 628 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 629 storageBuffers_shipPipeline); 628 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT 629 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 630 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 631 storageBuffers_shipPipeline); 630 632 631 633 asteroidPipeline = GraphicsPipeline_Vulkan<ModelVertex>( … … 634 636 635 637 createBufferSet(objects_asteroidPipeline.capacity * sizeof(SSBO_Asteroid), 636 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 637 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 638 storageBuffers_asteroidPipeline); 638 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT 639 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 640 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 641 storageBuffers_asteroidPipeline); 639 642 640 643 laserPipeline = GraphicsPipeline_Vulkan<LaserVertex>( … … 643 646 644 647 createBufferSet(objects_laserPipeline.capacity * sizeof(SSBO_Laser), 645 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 646 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 647 storageBuffers_laserPipeline); 648 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT 649 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 650 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 651 storageBuffers_laserPipeline); 648 652 649 653 explosionPipeline = GraphicsPipeline_Vulkan<ExplosionVertex>( … … 653 657 654 658 createBufferSet(objects_explosionPipeline.capacity * sizeof(SSBO_Explosion), 655 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 656 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 657 storageBuffers_explosionPipeline); 659 VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT 660 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 661 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 662 storageBuffers_explosionPipeline); 658 663 } 659 664 … … 1085 1090 1086 1091 // TODO: Probably move the resizing to the VulkanBuffer class 1087 if (objects_modelPipeline. numObjects > objects_modelPipeline.capacity) {1092 if (objects_modelPipeline.resized) { 1088 1093 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool, 1089 1094 graphicsQueue); 1095 1096 objects_modelPipeline.resize(); 1090 1097 } 1091 1098 … … 1098 1105 1099 1106 // TODO: Probably move the resizing to the VulkanBuffer class 1100 if (objects_shipPipeline. numObjects > objects_shipPipeline.capacity) {1107 if (objects_shipPipeline.resized) { 1101 1108 resizeBufferSet(storageBuffers_shipPipeline, objects_shipPipeline, shipPipeline, resourceCommandPool, 1102 1109 graphicsQueue); 1110 1111 objects_shipPipeline.resize(); 1103 1112 } 1104 1113 … … 1111 1120 1112 1121 // TODO: Probably move the resizing to the VulkanBuffer class 1113 if (objects_asteroidPipeline. numObjects > objects_asteroidPipeline.capacity) {1122 if (objects_asteroidPipeline.resized) { 1114 1123 resizeBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline, asteroidPipeline, 1115 1124 resourceCommandPool, graphicsQueue); 1125 1126 objects_asteroidPipeline.resize(); 1116 1127 } 1117 1128 … … 1124 1135 1125 1136 // TODO: Probably move the resizing to the VulkanBuffer class 1126 if (objects_laserPipeline. numObjects > objects_laserPipeline.capacity) {1137 if (objects_laserPipeline.resized) { 1127 1138 resizeBufferSet(storageBuffers_laserPipeline, objects_laserPipeline, laserPipeline, resourceCommandPool, 1128 1139 graphicsQueue); 1140 1141 objects_laserPipeline.resize(); 1129 1142 } 1130 1143 … … 1137 1150 1138 1151 // TODO: Probably move the resizing to the VulkanBuffer class 1139 if (objects_explosionPipeline. numObjects > objects_explosionPipeline.capacity) {1152 if (objects_explosionPipeline.resized) { 1140 1153 resizeBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline, explosionPipeline, 1141 1154 resourceCommandPool, graphicsQueue); 1155 1156 objects_explosionPipeline.resize(); 1142 1157 } 1143 1158
Note:
See TracChangeset
for help on using the changeset viewer.