Class VulkanModuleQueue

java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleQueue
Direct Known Subclasses:
VulkanRenderModuleGraphicsQueue

public class VulkanModuleQueue extends Object
A Vulkan queue, the channel through which recorded work reaches the device.

Queues are not created but retrieved: the logical device creates them all up front, and a queue is identified by its family and its index within that family. Subclasses narrow this to a particular capability, such as graphics or presentation.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Logger
    The logger this queue writes its diagnostics to.
    protected final int
    The family this queue belongs to, which determines what work it accepts.
    protected final org.lwjgl.vulkan.VkQueue
    The underlying Vulkan queue.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VulkanModuleQueue(VulkanModuleLogicalDevice vulkanModuleLogicalDevice, int queueFamilyIndex, int queueIndex, Logger logger)
    Retrieves a queue from the given device.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the family this queue belongs to.
    org.lwjgl.vulkan.VkQueue
    Returns the underlying Vulkan queue.
    void
    submit(org.lwjgl.PointerBuffer vulkanCommandBuffers, LongBuffer waitVulkanSemaphores, IntBuffer waitVulkanDstStageMasks, LongBuffer signalVulkanSemaphores, VulkanModuleFence vulkanModuleFence)
    Submits recorded command buffers to this queue.
    void
    Blocks until every submission to this queue has completed.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • queueFamilyIndex

      protected final int queueFamilyIndex
      The family this queue belongs to, which determines what work it accepts.
    • vkQueue

      protected final org.lwjgl.vulkan.VkQueue vkQueue
      The underlying Vulkan queue.
    • logger

      protected final Logger logger
      The logger this queue writes its diagnostics to.
  • Constructor Details

    • VulkanModuleQueue

      public VulkanModuleQueue(VulkanModuleLogicalDevice vulkanModuleLogicalDevice, int queueFamilyIndex, int queueIndex, Logger logger)
      Retrieves a queue from the given device.
      Parameters:
      vulkanModuleLogicalDevice - the device that owns the queue
      queueFamilyIndex - the family to take the queue from
      queueIndex - the index within that family
      logger - the logger to write queue diagnostics to
  • Method Details

    • getVkQueue

      public org.lwjgl.vulkan.VkQueue getVkQueue()
      Returns the underlying Vulkan queue.
      Returns:
      the VkQueue
    • waitIdle

      public void waitIdle()
      Blocks until every submission to this queue has completed.
    • submit

      public void submit(org.lwjgl.PointerBuffer vulkanCommandBuffers, LongBuffer waitVulkanSemaphores, IntBuffer waitVulkanDstStageMasks, LongBuffer signalVulkanSemaphores, VulkanModuleFence vulkanModuleFence)
      Submits recorded command buffers to this queue.
      Parameters:
      vulkanCommandBuffers - the command buffers to execute
      waitVulkanSemaphores - semaphores to wait on before executing, or null to begin immediately
      waitVulkanDstStageMasks - the pipeline stages at which each wait applies, positionally matching waitVulkanSemaphores
      signalVulkanSemaphores - semaphores to signal once execution completes
      vulkanModuleFence - a fence to signal on completion, or null for none
      Throws:
      AssertionError - if the submission is rejected
    • getQueueFamilyIndex

      public int getQueueFamilyIndex()
      Returns the family this queue belongs to.
      Returns:
      the queue family index