KDGpu::Queue¶
Module: Public API
Represents a GPU command queue for submitting work to the device. More...
#include <KDGpu/queue.h>
Public Functions¶
| Name | |
|---|---|
| Queue() | |
| ~Queue() | |
| const Handle< Queue_t > & | handle() const Returns the handle used to retrieve the underlying API specific Queue. |
| bool | isValid() const Convenience function to check whether the Queue is actually referencing a valid API specific resource. |
| operator Handle< Queue_t >() const | |
| QueueFlags | flags() const |
| uint32_t | timestampValidBits() const |
| Extent3D | minImageTransferGranularity() const |
| uint32_t | queueTypeIndex() const |
| void | waitUntilIdle() Forces a CPU side blocking wait until all pending commands on the queue have completed their execution. |
| void | submit(const SubmitOptions & options) Submit commands for execution based on the SubmitOptionsoptions provided. |
| PresentResult | present(const PresentOptions & options) Request the Queue present content to the swapchains referenced in the PresentOptionsoptions. |
| std::vector< PresentResult > | lastPerSwapchainPresentResults() const |
| void | waitForUploadBufferData(const WaitForBufferUploadOptions & options) |
| UploadStagingBuffer | uploadBufferData(const BufferUploadOptions & options) |
| void | waitForUploadTextureData(const WaitForTextureUploadOptions & options) |
| UploadStagingBuffer | uploadTextureData(const TextureUploadOptions & options) |
Friends¶
| Name | |
|---|---|
| class | Device |
| class | VulkanGraphicsApi |
Detailed Description¶
1 | |
Represents a GPU command queue for submitting work to the device.
Note: Unlike most other KDGpu resources, Queue instances can be copied around.
Vulkan equivalent:VkQueue
Queue is the interface for submitting command buffers to the GPU for execution. Every Device has one or more queues that support different types of operations (graphics, compute, transfer).
Key responsibilities:
- Submit command buffers for GPU execution
- Present rendered images to swapchains
- Synchronize CPU and GPU with fences and semaphores
- Upload data to buffers and textures
- Wait for GPU operations to complete
Lifetime:Queue objects are created by Device and remain valid for the lifetime of the device. You typically retrieve queues from the device and copy them.
¶
Usage¶
Basic queue usage:
1 2 3 | |
Filename: kdgpu_doc_snippets.cpp
Synchronization with fences:
1 2 3 4 5 6 7 | |
Filename: kdgpu_doc_snippets.cpp
GPU-to-GPU synchronization with semaphores:
1 2 3 4 5 | |
Filename: kdgpu_doc_snippets.cpp
Presenting to swapchains:
1 2 3 4 5 6 7 8 9 | |
Filename: kdgpu_doc_snippets.cpp
Presenting and signalling a fence:
The swapchainMaintenance1 feature allows to signal a fence when a swapchain is presented. This can make it simpler to wait for presentation completeness than using a Queue::waitUntilIdle() or having per swapchain image semaphores.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
Filename: kdgpu_doc_snippets.cpp
Queue capabilities:
1 | |
Filename: kdgpu_doc_snippets.cpp
¶
Vulkan mapping:¶
- Queue::submit()->vkQueueSubmit()
- Queue::present()->vkQueuePresentKHR()
- Queue::waitUntilIdle()->vkQueueWaitIdle()
- Queue::uploadBufferData()->staging buffer + vkCmdCopyBuffer()
- Queue::uploadTextureData()->staging buffer + vkCmdCopyBufferToImage()
¶
See also:¶
SubmitOptions, PresentOptions, Device, CommandRecorder, CommandBuffer, Fence, GpuSemaphore, TimelineSemaphore, Swapchain
Public Functions Documentation¶
function Queue¶
1 | |
function ~Queue¶
1 | |
function handle¶
1 | |
Returns the handle used to retrieve the underlying API specific Queue.
See: ResourceManager
function isValid¶
1 | |
Convenience function to check whether the Queue is actually referencing a valid API specific resource.
function operator Handle< Queue_t >¶
1 | |
function flags¶
1 | |
function timestampValidBits¶
1 | |
function minImageTransferGranularity¶
1 | |
function queueTypeIndex¶
1 | |
function waitUntilIdle¶
1 | |
Forces a CPU side blocking wait until all pending commands on the queue have completed their execution.
function submit¶
1 2 3 | |
Submit commands for execution based on the SubmitOptionsoptions provided.
function present¶
1 2 3 | |
Request the Queue present content to the swapchains referenced in the PresentOptionsoptions.
function lastPerSwapchainPresentResults¶
1 | |
function waitForUploadBufferData¶
1 2 3 | |
function uploadBufferData¶
1 2 3 | |
function waitForUploadTextureData¶
1 2 3 | |
function uploadTextureData¶
1 2 3 | |
Friends¶
friend Device¶
1 2 3 | |
friend VulkanGraphicsApi¶
1 2 3 | |
Updated on 2026-03-31 at 00:02:07 +0000