Class VulkanModuleCommandPool

java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleCommandPool

public class VulkanModuleCommandPool extends Object
A Vulkan command pool, from which command buffers for one queue family are allocated.

A pool is tied to the queue family it was created for, so buffers allocated from it can only be submitted to queues in that family. Created with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, so individual buffers can be reset and re-recorded rather than the whole pool having to be reset at once.

  • Constructor Details

    • VulkanModuleCommandPool

      public VulkanModuleCommandPool(VulkanModuleLogicalDevice vulkanModuleLogicalDevice, int queueFamilyIndex, Logger logger)
      Creates a command pool for one queue family.
      Parameters:
      vulkanModuleLogicalDevice - the device to create the pool on
      queueFamilyIndex - the queue family buffers from this pool may be submitted to
      logger - the logger to write pool diagnostics to
      Throws:
      AssertionError - if the pool cannot be created
  • Method Details

    • cleanup

      public void cleanup()
      Destroys the pool, freeing every command buffer allocated from it.
    • getVulkanLogicalDevice

      public VulkanModuleLogicalDevice getVulkanLogicalDevice()
      Returns the device this pool was created on.
      Returns:
      the owning logical device
    • getVkCommandPool

      public long getVkCommandPool()
      Returns the underlying Vulkan handle.
      Returns:
      the VkCommandPool handle