Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    re8445f0 r5049354  
    3232};
    3333
    34 // TODO: Use this struct for uniform buffers as well and rename it to VulkanBuffer (maybe move it to VulkanUtils)
    35 // Also, probably better to make this a vector of structs where each struct
    36 // has a VkBuffer, VkDeviceMemory, and VkDescriptorBufferInfo
     34// TODO: Use this struct for uniform buffers as well (maybe move it to VulkanUtils)
    3735struct StorageBufferSet {
    3836   vector<VkBuffer> buffers;
     
    6664      void addStorageDescriptor(VkShaderStageFlags stageFlags);
    6765
    68       // TODO: I might be able to use a single VkDescriptorBufferInfo here and reuse it when creating the descriptor sets
    69       void addDescriptorInfo(VkDescriptorType type, VkShaderStageFlags stageFlags,
    70                              vector<VkDescriptorBufferInfo>* bufferData);
     66      void addDescriptorInfo(VkDescriptorType type, VkShaderStageFlags stageFlags, vector<VkDescriptorBufferInfo>* bufferData);
    7167      void addDescriptorInfo(VkDescriptorType type, VkShaderStageFlags stageFlags, VkDescriptorImageInfo* imageData);
    7268
     
    7975
    8076      bool addObject(const vector<VertexType>& vertices, vector<uint16_t> indices, SSBOType& ssbo,
    81                      VkCommandPool commandPool, VkQueue graphicsQueue);
     77         VkCommandPool commandPool, VkQueue graphicsQueue);
    8278
    8379      void updateObject(size_t objIndex, SSBOType& ssbo);
    8480
    8581      void updateObjectVertices(size_t objIndex, const vector<VertexType>& vertices, VkCommandPool commandPool,
    86                                 VkQueue graphicsQueue);
     82         VkQueue graphicsQueue);
    8783
    8884      void cleanup();
     
    460456         switch (descriptorWrites[j].descriptorType) {
    461457            case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
    462             case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
    463458            case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
    464459               descriptorWrites[j].pBufferInfo = &(*this->descriptorInfoList[j].bufferDataList)[i];
     
    479474void GraphicsPipeline_Vulkan<VertexType, SSBOType>::createRenderCommands(VkCommandBuffer& commandBuffer,
    480475      uint32_t currentImage) {
    481 
    482476   vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
    483 
    484477   vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1,
    485478      &descriptorSets[currentImage], 0, nullptr);
     
    550543}
    551544
    552 // TODO: Allow a swapchain index to be passed in instead of updating all of them
    553 // Actually, since I'm in the process of replacing SSBOs with dynamic UBOs, I can ignore that for this function
    554545template<class VertexType, class SSBOType>
    555546void GraphicsPipeline_Vulkan<VertexType, SSBOType>::updateObject(size_t objIndex, SSBOType& ssbo) {
    556547   if (!is_same_v<SSBOType, void*>) {
    557548      for (size_t i = 0; i < storageBufferSet.memory.size(); i++) {
    558          VulkanUtils::copyDataToMemory(this->device, ssbo, storageBufferSet.memory[i], objIndex * sizeof(SSBOType));
     549         VulkanUtils::copyDataToMemory(this->device, storageBufferSet.memory[i], objIndex * sizeof(SSBOType), ssbo);
    559550      }
    560551   }
Note: See TracChangeset for help on using the changeset viewer.