Changeset d25381b in opengl-game


Ignore:
Timestamp:
Feb 18, 2020, 9:33:34 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
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)
Message:

In VulkanGame, rename fields related to the ubo and ssbo for the model pipeline to end in _modelPipeline rather than scenePipeline

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r2d87297 rd25381b  
    200200
    201201   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);
    203203   // TODO: Calculate the size of this buffer (and all the other SSBOs) based on the number of objects
    204204   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);
    206206
    207207   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    208       VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList_scenePipeline);
     208      VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList_modelPipeline);
    209209   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    210       VK_SHADER_STAGE_VERTEX_BIT, &storageBufferInfoList_scenePipeline);
     210      VK_SHADER_STAGE_VERTEX_BIT, &storageBufferInfoList_modelPipeline);
    211211
    212212   modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
     
    787787   so_Asteroid.model = asteroidObjects[0].model_transform * asteroidObjects[0].model_base;
    788788
    789    VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_scenePipeline[currentImage], 0, object_VP_mats);
     789   VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_modelPipeline[currentImage], 0, object_VP_mats);
    790790
    791791   for (size_t i = 0; i < modelObjects.size(); i++) {
    792       VulkanUtils::copyDataToMemory(device, storageBuffersMemory_scenePipeline[currentImage],
     792      VulkanUtils::copyDataToMemory(device, storageBuffersMemory_modelPipeline[currentImage],
    793793         i, so_Object);
    794794   }
     
    14601460
    14611461   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);
    14631463   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);
    14651465
    14661466   modelPipeline.updateRenderPass(renderPass);
     
    15191519   vkDestroySwapchainKHR(device, swapChain, nullptr);
    15201520
    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);
    15291529   }
    15301530
  • vulkan-game.hpp

    r2d87297 rd25381b  
    148148
    149149      GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline;
    150 
    151150      vector<SceneObject<OverlayVertex, void*>> overlayObjects;
    152151
    153       // TODO: Rename all the variables related to modelPipeline to use the same pipelie name
    154 
    155152      GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline;
    156 
    157153      vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects;
    158154
    159       vector<VkBuffer> uniformBuffers_scenePipeline;
    160       vector<VkDeviceMemory> uniformBuffersMemory_scenePipeline;
    161       vector<VkDescriptorBufferInfo> uniformBufferInfoList_scenePipeline;
    162 
    163       vector<VkBuffer> storageBuffers_scenePipeline;
    164       vector<VkDeviceMemory> storageBuffersMemory_scenePipeline;
    165       vector<VkDescriptorBufferInfo> storageBufferInfoList_scenePipeline;
     155      vector<VkBuffer> uniformBuffers_modelPipeline;
     156      vector<VkDeviceMemory> uniformBuffersMemory_modelPipeline;
     157      vector<VkDescriptorBufferInfo> uniformBufferInfoList_modelPipeline;
     158
     159      vector<VkBuffer> storageBuffers_modelPipeline;
     160      vector<VkDeviceMemory> storageBuffersMemory_modelPipeline;
     161      vector<VkDescriptorBufferInfo> storageBufferInfoList_modelPipeline;
    166162
    167163      UBO_VP_mats object_VP_mats;
     
    169165
    170166      GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline;
    171 
    172167      vector<SceneObject<ShipVertex, SSBO_ModelObject>> shipObjects;
    173168
     
    184179
    185180      GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline;
    186 
    187181      vector<SceneObject<AsteroidVertex, SSBO_Asteroid>> asteroidObjects;
    188182
Note: See TracChangeset for help on using the changeset viewer.