Class VulkanModuleQueue
java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleQueue
- Direct Known Subclasses:
VulkanRenderModuleGraphicsQueue
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
FieldsModifier and TypeFieldDescriptionprotected final LoggerThe logger this queue writes its diagnostics to.protected final intThe family this queue belongs to, which determines what work it accepts.protected final org.lwjgl.vulkan.VkQueueThe underlying Vulkan queue. -
Constructor Summary
ConstructorsConstructorDescriptionVulkanModuleQueue(VulkanModuleLogicalDevice vulkanModuleLogicalDevice, int queueFamilyIndex, int queueIndex, Logger logger) Retrieves a queue from the given device. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the family this queue belongs to.org.lwjgl.vulkan.VkQueueReturns the underlying Vulkan queue.voidsubmit(org.lwjgl.PointerBuffer vulkanCommandBuffers, LongBuffer waitVulkanSemaphores, IntBuffer waitVulkanDstStageMasks, LongBuffer signalVulkanSemaphores, VulkanModuleFence vulkanModuleFence) Submits recorded command buffers to this queue.voidwaitIdle()Blocks until every submission to this queue has completed.
-
Field Details
-
queueFamilyIndex
protected final int queueFamilyIndexThe family this queue belongs to, which determines what work it accepts. -
vkQueue
protected final org.lwjgl.vulkan.VkQueue vkQueueThe underlying Vulkan queue. -
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 queuequeueFamilyIndex- the family to take the queue fromqueueIndex- the index within that familylogger- 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 executewaitVulkanSemaphores- semaphores to wait on before executing, ornullto begin immediatelywaitVulkanDstStageMasks- the pipeline stages at which each wait applies, positionally matchingwaitVulkanSemaphoressignalVulkanSemaphores- semaphores to signal once execution completesvulkanModuleFence- a fence to signal on completion, ornullfor none- Throws:
AssertionError- if the submission is rejected
-
getQueueFamilyIndex
public int getQueueFamilyIndex()Returns the family this queue belongs to.- Returns:
- the queue family index
-