Changeset b01b50c in opengl-game


Ignore:
Timestamp:
Jun 20, 2021, 9:27:27 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
67527a5
Parents:
2f4ff8c
Message:

Rename all BufferSets named storageBuffers_* to objectBuffers_*

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sdl-game.cpp

    r2f4ff8c rb01b50c  
    125125                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    126126                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    127                    storageBuffers_modelPipeline);
    128 
    129    objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     127                   objectBuffers_modelPipeline);
     128
     129   objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    130130
    131131   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    132132      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_modelPipeline.infoSet);
    133133   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    134       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_modelPipeline.infoSet);
     134      VK_SHADER_STAGE_VERTEX_BIT, &objectBuffers_modelPipeline.infoSet);
    135135   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    136136      VK_SHADER_STAGE_FRAGMENT_BIT, &floorTextureImageDescriptor);
     
    457457
    458458   if (objects_modelPipeline.resized) {
    459       objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
    460 
    461       resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline.memorySize(), resourceCommandPool,
     459      objects_modelPipeline.unmap(objectBuffers_modelPipeline.memory, device);
     460
     461      resizeBufferSet(objectBuffers_modelPipeline, objects_modelPipeline.memorySize(), resourceCommandPool,
    462462                      graphicsQueue, true);
    463463
    464       objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     464      objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    465465
    466466      objects_modelPipeline.resize();
    467467
    468       modelPipeline.updateDescriptorInfo(1, &storageBuffers_modelPipeline.infoSet, swapChainImages.size());
     468      modelPipeline.updateDescriptorInfo(1, &objectBuffers_modelPipeline.infoSet, swapChainImages.size());
    469469   }
    470470
     
    487487
    488488   VulkanUtils::copyDataToMappedMemory(device, objects_modelPipeline.data(), objects_modelPipeline.mapped(imageIndex),
    489                                        storageBuffers_modelPipeline.memory[imageIndex],
     489                                       objectBuffers_modelPipeline.memory[imageIndex],
    490490                                       objects_modelPipeline.memorySize(), true);
    491491}
     
    13031303                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    13041304                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    1305                    storageBuffers_modelPipeline);
    1306 
    1307    objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     1305                   objectBuffers_modelPipeline);
     1306
     1307   objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    13081308
    13091309   modelPipeline.updateRenderPass(renderPass);
     
    13361336   }
    13371337
    1338    objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
    1339 
    1340    for (size_t i = 0; i < storageBuffers_modelPipeline.buffers.size(); i++) {
    1341       vkDestroyBuffer(device, storageBuffers_modelPipeline.buffers[i], nullptr);
    1342       vkFreeMemory(device, storageBuffers_modelPipeline.memory[i], nullptr);
     1338   objects_modelPipeline.unmap(objectBuffers_modelPipeline.memory, device);
     1339
     1340   for (size_t i = 0; i < objectBuffers_modelPipeline.buffers.size(); i++) {
     1341      vkDestroyBuffer(device, objectBuffers_modelPipeline.buffers[i], nullptr);
     1342      vkFreeMemory(device, objectBuffers_modelPipeline.memory[i], nullptr);
    13431343   }
    13441344
  • sdl-game.hpp

    r2f4ff8c rb01b50c  
    226226
    227227      BufferSet uniformBuffers_modelPipeline;
    228       BufferSet storageBuffers_modelPipeline;
     228      BufferSet objectBuffers_modelPipeline;
    229229
    230230      VulkanBuffer<UBO_VP_mats> uniforms_modelPipeline;
  • vulkan-game.cpp

    r2f4ff8c rb01b50c  
    168168                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    169169                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    170                    storageBuffers_modelPipeline);
    171 
    172    objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     170                   objectBuffers_modelPipeline);
     171
     172   objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    173173
    174174   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    175175      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_modelPipeline.infoSet);
    176176   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    177       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_modelPipeline.infoSet);
     177      VK_SHADER_STAGE_VERTEX_BIT, &objectBuffers_modelPipeline.infoSet);
    178178   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    179179      VK_SHADER_STAGE_FRAGMENT_BIT, &floorTextureImageDescriptor);
     
    242242                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    243243                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    244                    storageBuffers_shipPipeline);
    245 
    246    objects_shipPipeline.map(storageBuffers_shipPipeline.memory, device);
     244                   objectBuffers_shipPipeline);
     245
     246   objects_shipPipeline.map(objectBuffers_shipPipeline.memory, device);
    247247
    248248   shipPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    249249      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_shipPipeline.infoSet);
    250250   shipPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    251       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_shipPipeline.infoSet);
     251      VK_SHADER_STAGE_VERTEX_BIT, &objectBuffers_shipPipeline.infoSet);
    252252
    253253   // TODO: With the normals, indexing basically becomes pointless since no vertices will have exactly
     
    513513                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    514514                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    515                    storageBuffers_asteroidPipeline);
    516 
    517    objects_asteroidPipeline.map(storageBuffers_asteroidPipeline.memory, device);
     515                   objectBuffers_asteroidPipeline);
     516
     517   objects_asteroidPipeline.map(objectBuffers_asteroidPipeline.memory, device);
    518518
    519519   asteroidPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    520520      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_asteroidPipeline.infoSet);
    521521   asteroidPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    522       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_asteroidPipeline.infoSet);
     522      VK_SHADER_STAGE_VERTEX_BIT, &objectBuffers_asteroidPipeline.infoSet);
    523523
    524524   asteroidPipeline.createDescriptorSetLayout();
     
    542542                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    543543                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    544                    storageBuffers_laserPipeline);
    545 
    546    objects_laserPipeline.map(storageBuffers_laserPipeline.memory, device);
     544                   objectBuffers_laserPipeline);
     545
     546   objects_laserPipeline.map(objectBuffers_laserPipeline.memory, device);
    547547
    548548   laserPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    549549      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_laserPipeline.infoSet);
    550550   laserPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    551       VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, &storageBuffers_laserPipeline.infoSet);
     551      VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, &objectBuffers_laserPipeline.infoSet);
    552552   laserPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    553553      VK_SHADER_STAGE_FRAGMENT_BIT, &laserTextureImageDescriptor);
     
    573573                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    574574                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    575                    storageBuffers_explosionPipeline);
    576 
    577    objects_explosionPipeline.map(storageBuffers_explosionPipeline.memory, device);
     575                   objectBuffers_explosionPipeline);
     576
     577   objects_explosionPipeline.map(objectBuffers_explosionPipeline.memory, device);
    578578
    579579   explosionPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    580580      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_explosionPipeline.infoSet);
    581581   explosionPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    582       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_explosionPipeline.infoSet);
     582      VK_SHADER_STAGE_VERTEX_BIT, &objectBuffers_explosionPipeline.infoSet);
    583583
    584584   explosionPipeline.createDescriptorSetLayout();
     
    10821082
    10831083   if (objects_modelPipeline.resized) {
    1084       objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
    1085 
    1086       resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline.memorySize(), resourceCommandPool,
     1084      objects_modelPipeline.unmap(objectBuffers_modelPipeline.memory, device);
     1085
     1086      resizeBufferSet(objectBuffers_modelPipeline, objects_modelPipeline.memorySize(), resourceCommandPool,
    10871087                      graphicsQueue, true);
    10881088
    1089       objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     1089      objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    10901090
    10911091      objects_modelPipeline.resize();
    10921092
    1093       modelPipeline.updateDescriptorInfo(1, &storageBuffers_modelPipeline.infoSet, swapChainImages.size());
     1093      modelPipeline.updateDescriptorInfo(1, &objectBuffers_modelPipeline.infoSet, swapChainImages.size());
    10941094   }
    10951095
     
    11121112
    11131113   VulkanUtils::copyDataToMappedMemory(device, objects_modelPipeline.data(), objects_modelPipeline.mapped(imageIndex),
    1114                                        storageBuffers_modelPipeline.memory[imageIndex],
     1114                                       objectBuffers_modelPipeline.memory[imageIndex],
    11151115                                       objects_modelPipeline.memorySize(), true);
    11161116
    11171117   if (objects_shipPipeline.resized) {
    1118       objects_shipPipeline.unmap(storageBuffers_shipPipeline.memory, device);
    1119 
    1120       resizeBufferSet(storageBuffers_shipPipeline, objects_shipPipeline.memorySize(), resourceCommandPool,
     1118      objects_shipPipeline.unmap(objectBuffers_shipPipeline.memory, device);
     1119
     1120      resizeBufferSet(objectBuffers_shipPipeline, objects_shipPipeline.memorySize(), resourceCommandPool,
    11211121                      graphicsQueue, true);
    11221122
    1123       objects_shipPipeline.map(storageBuffers_shipPipeline.memory, device);
     1123      objects_shipPipeline.map(objectBuffers_shipPipeline.memory, device);
    11241124
    11251125      objects_shipPipeline.resize();
    11261126
    1127       shipPipeline.updateDescriptorInfo(1, &storageBuffers_shipPipeline.infoSet, swapChainImages.size());
     1127      shipPipeline.updateDescriptorInfo(1, &objectBuffers_shipPipeline.infoSet, swapChainImages.size());
    11281128   }
    11291129
     
    11421142
    11431143   VulkanUtils::copyDataToMappedMemory(device, objects_shipPipeline.data(), objects_shipPipeline.mapped(imageIndex),
    1144                                        storageBuffers_shipPipeline.memory[imageIndex],
     1144                                       objectBuffers_shipPipeline.memory[imageIndex],
    11451145                                       objects_shipPipeline.memorySize(), true);
    11461146
    11471147   if (objects_asteroidPipeline.resized) {
    1148       objects_asteroidPipeline.unmap(storageBuffers_asteroidPipeline.memory, device);
    1149 
    1150       resizeBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline.memorySize(), resourceCommandPool,
     1148      objects_asteroidPipeline.unmap(objectBuffers_asteroidPipeline.memory, device);
     1149
     1150      resizeBufferSet(objectBuffers_asteroidPipeline, objects_asteroidPipeline.memorySize(), resourceCommandPool,
    11511151                      graphicsQueue, true);
    11521152
    1153       objects_asteroidPipeline.map(storageBuffers_asteroidPipeline.memory, device);
     1153      objects_asteroidPipeline.map(objectBuffers_asteroidPipeline.memory, device);
    11541154
    11551155      objects_asteroidPipeline.resize();
    11561156
    1157       asteroidPipeline.updateDescriptorInfo(1, &storageBuffers_asteroidPipeline.infoSet, swapChainImages.size());
     1157      asteroidPipeline.updateDescriptorInfo(1, &objectBuffers_asteroidPipeline.infoSet, swapChainImages.size());
    11581158   }
    11591159
     
    11951195
    11961196   VulkanUtils::copyDataToMappedMemory(device, objects_asteroidPipeline.data(), objects_asteroidPipeline.mapped(imageIndex),
    1197                                        storageBuffers_asteroidPipeline.memory[imageIndex],
     1197                                       objectBuffers_asteroidPipeline.memory[imageIndex],
    11981198                                       objects_asteroidPipeline.memorySize(), true);
    11991199
    12001200   if (objects_laserPipeline.resized) {
    1201       objects_laserPipeline.unmap(storageBuffers_laserPipeline.memory, device);
    1202 
    1203       resizeBufferSet(storageBuffers_laserPipeline, objects_laserPipeline.memorySize(), resourceCommandPool,
     1201      objects_laserPipeline.unmap(objectBuffers_laserPipeline.memory, device);
     1202
     1203      resizeBufferSet(objectBuffers_laserPipeline, objects_laserPipeline.memorySize(), resourceCommandPool,
    12041204                      graphicsQueue, true);
    12051205
    1206       objects_laserPipeline.map(storageBuffers_laserPipeline.memory, device);
     1206      objects_laserPipeline.map(objectBuffers_laserPipeline.memory, device);
    12071207
    12081208      objects_laserPipeline.resize();
    12091209
    1210       laserPipeline.updateDescriptorInfo(1, &storageBuffers_laserPipeline.infoSet, swapChainImages.size());
     1210      laserPipeline.updateDescriptorInfo(1, &objectBuffers_laserPipeline.infoSet, swapChainImages.size());
    12111211   }
    12121212
     
    12311231
    12321232   VulkanUtils::copyDataToMappedMemory(device, objects_laserPipeline.data(), objects_laserPipeline.mapped(imageIndex),
    1233                                        storageBuffers_laserPipeline.memory[imageIndex],
     1233                                       objectBuffers_laserPipeline.memory[imageIndex],
    12341234                                       objects_laserPipeline.memorySize(), true);
    12351235
    12361236   if (objects_explosionPipeline.resized) {
    1237       objects_explosionPipeline.unmap(storageBuffers_explosionPipeline.memory, device);
    1238 
    1239       resizeBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline.memorySize(), resourceCommandPool,
     1237      objects_explosionPipeline.unmap(objectBuffers_explosionPipeline.memory, device);
     1238
     1239      resizeBufferSet(objectBuffers_explosionPipeline, objects_explosionPipeline.memorySize(), resourceCommandPool,
    12401240                      graphicsQueue, true);
    12411241
    1242       objects_explosionPipeline.map(storageBuffers_explosionPipeline.memory, device);
     1242      objects_explosionPipeline.map(objectBuffers_explosionPipeline.memory, device);
    12431243
    12441244      objects_explosionPipeline.resize();
    12451245
    1246       explosionPipeline.updateDescriptorInfo(1, &storageBuffers_explosionPipeline.infoSet, swapChainImages.size());
     1246      explosionPipeline.updateDescriptorInfo(1, &objectBuffers_explosionPipeline.infoSet, swapChainImages.size());
    12471247   }
    12481248
     
    12661266
    12671267   VulkanUtils::copyDataToMappedMemory(device, objects_explosionPipeline.data(), objects_explosionPipeline.mapped(imageIndex),
    1268                                        storageBuffers_explosionPipeline.memory[imageIndex],
     1268                                       objectBuffers_explosionPipeline.memory[imageIndex],
    12691269                                       objects_explosionPipeline.memorySize(), true);
    12701270}
     
    23172317                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    23182318                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    2319                    storageBuffers_modelPipeline);
    2320 
    2321     objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
     2319                   objectBuffers_modelPipeline);
     2320
     2321    objects_modelPipeline.map(objectBuffers_modelPipeline.memory, device);
    23222322
    23232323   modelPipeline.updateRenderPass(renderPass);
     
    23372337                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    23382338                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    2339                    storageBuffers_shipPipeline);
    2340 
    2341     objects_shipPipeline.map(storageBuffers_shipPipeline.memory, device);
     2339                   objectBuffers_shipPipeline);
     2340
     2341    objects_shipPipeline.map(objectBuffers_shipPipeline.memory, device);
    23422342
    23432343   shipPipeline.updateRenderPass(renderPass);
     
    23572357                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    23582358                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    2359                    storageBuffers_asteroidPipeline);
    2360 
    2361     objects_asteroidPipeline.map(storageBuffers_asteroidPipeline.memory, device);
     2359                   objectBuffers_asteroidPipeline);
     2360
     2361    objects_asteroidPipeline.map(objectBuffers_asteroidPipeline.memory, device);
    23622362
    23632363   asteroidPipeline.updateRenderPass(renderPass);
     
    23772377                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    23782378                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    2379                    storageBuffers_laserPipeline);
    2380 
    2381     objects_laserPipeline.map(storageBuffers_laserPipeline.memory, device);
     2379                   objectBuffers_laserPipeline);
     2380
     2381    objects_laserPipeline.map(objectBuffers_laserPipeline.memory, device);
    23822382
    23832383   laserPipeline.updateRenderPass(renderPass);
     
    23972397                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    23982398                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
    2399                    storageBuffers_explosionPipeline);
    2400 
    2401     objects_explosionPipeline.map(storageBuffers_explosionPipeline.memory, device);
     2399                   objectBuffers_explosionPipeline);
     2400
     2401    objects_explosionPipeline.map(objectBuffers_explosionPipeline.memory, device);
    24022402
    24032403   explosionPipeline.updateRenderPass(renderPass);
     
    24302430   }
    24312431
    2432    objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
    2433 
    2434    for (size_t i = 0; i < storageBuffers_modelPipeline.buffers.size(); i++) {
    2435       vkDestroyBuffer(device, storageBuffers_modelPipeline.buffers[i], nullptr);
    2436       vkFreeMemory(device, storageBuffers_modelPipeline.memory[i], nullptr);
     2432   objects_modelPipeline.unmap(objectBuffers_modelPipeline.memory, device);
     2433
     2434   for (size_t i = 0; i < objectBuffers_modelPipeline.buffers.size(); i++) {
     2435      vkDestroyBuffer(device, objectBuffers_modelPipeline.buffers[i], nullptr);
     2436      vkFreeMemory(device, objectBuffers_modelPipeline.memory[i], nullptr);
    24372437   }
    24382438
     
    24462446   }
    24472447
    2448    objects_shipPipeline.unmap(storageBuffers_shipPipeline.memory, device);
    2449 
    2450    for (size_t i = 0; i < storageBuffers_shipPipeline.buffers.size(); i++) {
    2451       vkDestroyBuffer(device, storageBuffers_shipPipeline.buffers[i], nullptr);
    2452       vkFreeMemory(device, storageBuffers_shipPipeline.memory[i], nullptr);
     2448   objects_shipPipeline.unmap(objectBuffers_shipPipeline.memory, device);
     2449
     2450   for (size_t i = 0; i < objectBuffers_shipPipeline.buffers.size(); i++) {
     2451      vkDestroyBuffer(device, objectBuffers_shipPipeline.buffers[i], nullptr);
     2452      vkFreeMemory(device, objectBuffers_shipPipeline.memory[i], nullptr);
    24532453   }
    24542454
     
    24622462   }
    24632463
    2464    objects_asteroidPipeline.unmap(storageBuffers_asteroidPipeline.memory, device);
    2465 
    2466    for (size_t i = 0; i < storageBuffers_asteroidPipeline.buffers.size(); i++) {
    2467       vkDestroyBuffer(device, storageBuffers_asteroidPipeline.buffers[i], nullptr);
    2468       vkFreeMemory(device, storageBuffers_asteroidPipeline.memory[i], nullptr);
     2464   objects_asteroidPipeline.unmap(objectBuffers_asteroidPipeline.memory, device);
     2465
     2466   for (size_t i = 0; i < objectBuffers_asteroidPipeline.buffers.size(); i++) {
     2467      vkDestroyBuffer(device, objectBuffers_asteroidPipeline.buffers[i], nullptr);
     2468      vkFreeMemory(device, objectBuffers_asteroidPipeline.memory[i], nullptr);
    24692469   }
    24702470
     
    24782478   }
    24792479
    2480    objects_laserPipeline.unmap(storageBuffers_laserPipeline.memory, device);
    2481 
    2482    for (size_t i = 0; i < storageBuffers_laserPipeline.buffers.size(); i++) {
    2483       vkDestroyBuffer(device, storageBuffers_laserPipeline.buffers[i], nullptr);
    2484       vkFreeMemory(device, storageBuffers_laserPipeline.memory[i], nullptr);
     2480   objects_laserPipeline.unmap(objectBuffers_laserPipeline.memory, device);
     2481
     2482   for (size_t i = 0; i < objectBuffers_laserPipeline.buffers.size(); i++) {
     2483      vkDestroyBuffer(device, objectBuffers_laserPipeline.buffers[i], nullptr);
     2484      vkFreeMemory(device, objectBuffers_laserPipeline.memory[i], nullptr);
    24852485   }
    24862486
     
    24942494   }
    24952495
    2496    objects_explosionPipeline.unmap(storageBuffers_explosionPipeline.memory, device);
    2497 
    2498    for (size_t i = 0; i < storageBuffers_explosionPipeline.buffers.size(); i++) {
    2499       vkDestroyBuffer(device, storageBuffers_explosionPipeline.buffers[i], nullptr);
    2500       vkFreeMemory(device, storageBuffers_explosionPipeline.memory[i], nullptr);
     2496   objects_explosionPipeline.unmap(objectBuffers_explosionPipeline.memory, device);
     2497
     2498   for (size_t i = 0; i < objectBuffers_explosionPipeline.buffers.size(); i++) {
     2499      vkDestroyBuffer(device, objectBuffers_explosionPipeline.buffers[i], nullptr);
     2500      vkFreeMemory(device, objectBuffers_explosionPipeline.memory[i], nullptr);
    25012501   }
    25022502
  • vulkan-game.hpp

    r2f4ff8c rb01b50c  
    312312
    313313      BufferSet uniformBuffers_modelPipeline;
    314       BufferSet storageBuffers_modelPipeline;
     314      BufferSet objectBuffers_modelPipeline;
    315315
    316316      VulkanBuffer<UBO_VP_mats> uniforms_modelPipeline;
     
    318318
    319319      BufferSet uniformBuffers_shipPipeline;
    320       BufferSet storageBuffers_shipPipeline;
     320      BufferSet objectBuffers_shipPipeline;
    321321
    322322      VulkanBuffer<UBO_VP_mats> uniforms_shipPipeline;
     
    324324
    325325      BufferSet uniformBuffers_asteroidPipeline;
    326       BufferSet storageBuffers_asteroidPipeline;
     326      BufferSet objectBuffers_asteroidPipeline;
    327327
    328328      VulkanBuffer<UBO_VP_mats> uniforms_asteroidPipeline;
     
    330330
    331331      BufferSet uniformBuffers_laserPipeline;
    332       BufferSet storageBuffers_laserPipeline;
     332      BufferSet objectBuffers_laserPipeline;
    333333
    334334      VulkanBuffer<UBO_VP_mats> uniforms_laserPipeline;
     
    336336
    337337      BufferSet uniformBuffers_explosionPipeline;
    338       BufferSet storageBuffers_explosionPipeline;
     338      BufferSet objectBuffers_explosionPipeline;
    339339
    340340      VulkanBuffer<UBO_Explosion> uniforms_explosionPipeline;
Note: See TracChangeset for help on using the changeset viewer.