KDGpu::GpuSemaphore¶
Module: Public API
GPU-to-GPU synchronization primitive for command buffer dependencies. More...
#include <KDGpu/gpu_semaphore.h>
Public Functions¶
| Name | |
|---|---|
| GpuSemaphore() | |
| ~GpuSemaphore() | |
| GpuSemaphore(GpuSemaphore && other) | |
| GpuSemaphore & | operator=(GpuSemaphore && other) |
| GpuSemaphore(const GpuSemaphore & ) =delete | |
| GpuSemaphore & | operator=(const GpuSemaphore & ) =delete |
| const Handle< GpuSemaphore_t > & | handle() const |
| bool | isValid() const |
| operator Handle< GpuSemaphore_t >() const | |
| HandleOrFD | externalSemaphoreHandle() const |
Friends¶
| Name | |
|---|---|
| class | Device |
Detailed Description¶
1 | |
GPU-to-GPU synchronization primitive for command buffer dependencies.
Vulkan equivalent:VkSemaphore
GpuSemaphore synchronizes GPU operations without CPU involvement. Unlike Fence (which synchronizes CPU and GPU), semaphores coordinate work between queue submissions and swapchain operations.
Key features:
- GPU-only synchronization (no CPU waiting)
- Signal/wait between queue submissions
- Swapchain image acquisition and presentation
- Cross-queue synchronization
Lifetime: Semaphores are created by Device and must remain valid while GPU operations reference them. They use RAII and clean up automatically.
¶
Usage¶
Basic semaphore usage:
1 | |
Filename: kdgpu_doc_snippets.cpp
Queue synchronization:
1 2 3 4 5 6 7 8 9 10 11 | |
Filename: kdgpu_doc_snippets.cpp
Chaining multiple operations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Filename: kdgpu_doc_snippets.cpp
Multi-queue pipeline:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Filename: kdgpu_doc_snippets.cpp
¶
Vulkan mapping:¶
- GpuSemaphore creation -> vkCreateSemaphore()
- Used in vkQueueSubmit() wait/signal arrays
- Used in vkAcquireNextImageKHR()
- Used in vkQueuePresentKHR()
¶
See also:¶
GpuSemaphoreOptions, Fence, Queue, Swapchain, Device
Public Functions Documentation¶
function GpuSemaphore¶
1 | |
function ~GpuSemaphore¶
1 | |
function GpuSemaphore¶
1 2 3 | |
function operator=¶
1 2 3 | |
function GpuSemaphore¶
1 2 3 | |
function operator=¶
1 2 3 | |
function handle¶
1 | |
function isValid¶
1 | |
function operator Handle< GpuSemaphore_t >¶
1 | |
function externalSemaphoreHandle¶
1 | |
Friends¶
friend Device¶
1 2 3 | |
Updated on 2026-03-31 at 00:02:07 +0000