Changeset 9c0a614 in opengl-game for vulkan-game.hpp


Ignore:
Timestamp:
Feb 14, 2021, 2:15:18 AM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
4e2c709
Parents:
9067efc
git-author:
Dmitry Portnoy <dportnoy@…> (02/14/21 02:06:31)
git-committer:
Dmitry Portnoy <dportnoy@…> (02/14/21 02:15:18)
Message:

Switch to using one command pool per swap chain image in VulkanGame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.hpp

    r9067efc r9c0a614  
    278278      VkCommandPool resourceCommandPool;
    279279
    280       VkCommandPool commandPool;
    281       vector<VkCommandPool> commandPools; // This is not used yet, but will be once
     280      vector<VkCommandPool> commandPools;
    282281      vector<VkCommandBuffer> commandBuffers;
    283282
     
    404403      VkFormat findDepthFormat(); // TODO: Declare/define (in the cpp file) this function in some util functions section
    405404      void createResourceCommandPool();
    406       void createCommandPool();
     405      void createCommandPools();
    407406      void createImageResources();
    408407      void createFramebuffers();
     
    501500   if (pipelinesCreated) {
    502501      vkDeviceWaitIdle(device);
    503       vkFreeCommandBuffers(device, commandPool, static_cast<uint32_t>(commandBuffers.size()), commandBuffers.data());
     502
     503      for (uint32_t i = 0; i < swapChainImageCount; i++) {
     504         vkFreeCommandBuffers(device, commandPools[i], 1, &commandBuffers[i]);
     505      }
    504506
    505507      // TODO: The pipeline recreation only has to be done once per frame where at least
Note: See TracChangeset for help on using the changeset viewer.