Changeset 567fa88 in opengl-game for graphics-pipeline_vulkan.hpp


Ignore:
Timestamp:
Jun 7, 2021, 11:59:27 PM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
c074f81
Parents:
58453c3
Message:

Change createRenderCommands() to support dynamic offsets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    r58453c3 r567fa88  
    6363      void createDescriptorSets(uint32_t size);
    6464
    65       void createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage);
     65      void createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage,
     66                                const vector<uint32_t>& dynamicOffsets);
    6667
    6768      void addObject(const vector<VertexType>& vertices, vector<uint16_t> indices, VkCommandPool commandPool,
     
    473474
    474475template<class VertexType>
    475 void GraphicsPipeline_Vulkan<VertexType>::createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage) {
     476void GraphicsPipeline_Vulkan<VertexType>::createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage,
     477                                                               const vector<uint32_t>& dynamicOffsets) {
    476478   vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
    477479
     480   // If more dynamic UBOs are added, this needs to become an array of offsets
    478481   vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1,
    479       &descriptorSets[currentImage], 0, nullptr);
     482      &descriptorSets[currentImage], dynamicOffsets.size(), dynamicOffsets.data());
    480483
    481484   VkBuffer vertexBuffers[] = { vertexBuffer };
Note: See TracChangeset for help on using the changeset viewer.