Changeset 2da64ef in opengl-game for graphics-pipeline_vulkan.hpp


Ignore:
Timestamp:
Feb 19, 2020, 4:47:41 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
3b84bb6
Parents:
860a0da
Message:

In VulkanGame, move the logic of updating per-object data in the SSBO into GraphicsPipeline_Vulkan and remove the SSBO properties from VulkanGame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    r860a0da r2da64ef  
    7474         VkQueue graphicsQueue);
    7575
     76      void updateObject(size_t objIndex, SSBOType& ssbo);
     77
    7678      void cleanup();
    7779      void cleanupBuffers();
    78 
    79       StorageBufferSet storageBufferSet;
    8080   
    8181   private:
     
    108108      size_t numObjects;
    109109      size_t objectCapacity;
     110
     111      StorageBufferSet storageBufferSet;
    110112
    111113      VkShaderModule createShaderModule(const vector<char>& code);
     
    491493
    492494template<class VertexType, class SSBOType>
     495void GraphicsPipeline_Vulkan<VertexType, SSBOType>::updateObject(size_t objIndex, SSBOType& ssbo) {
     496   if (!is_same_v<SSBOType, void*>) {
     497      for (size_t i = 0; i < storageBufferSet.memory.size(); i++) {
     498         VulkanUtils::copyDataToMemory(device, storageBufferSet.memory[i], objIndex, ssbo);
     499      }
     500   }
     501}
     502
     503template<class VertexType, class SSBOType>
    493504void GraphicsPipeline_Vulkan<VertexType, SSBOType>::cleanup() {
    494505   vkDestroyPipeline(device, pipeline, nullptr);
Note: See TracChangeset for help on using the changeset viewer.