KDGpu::TimelineSemaphore
Module: Public API
GPU timeline semaphore with CPU-side signal and wait operations. More...
#include <KDGpu/timeline_semaphore.h>
Public Functions
Friends
Detailed Description
| class KDGpu::TimelineSemaphore;
|
GPU timeline semaphore with CPU-side signal and wait operations.
Vulkan equivalent:VkSemaphore (timeline type)
TimelineSemaphore is a monotonically-increasing uint64_t counter that can be signaled and waited on from both the CPU and GPU. Unlike GpuSemaphore (which is binary), a timeline semaphore carries a value that is tested against a user-supplied threshold.
Key differences from GpuSemaphore:
- Carries a uint64_t counter rather than binary signaled/unsignaled state
- CPU can signal and wait without submitting any GPU work
- Cannot be used with swapchain acquire/present operations
- Multiple pending signals and waits are allowed
Usage
CPU-side wait:
| auto sem = device.createTimelineSemaphore({ .initialValue = 0 });
// GPU submission signals value 1 via SubmitOptions::signalTimelineSemaphores
sem.wait(1); // blocks until the GPU signals value >= 1
|
Vulkan mapping:
See also:
TimelineSemaphoreOptions, GpuSemaphore, Fence, Queue, Device
KDGpu API Overview
KDGpu to Vulkan API Mapping
Public Functions Documentation
function TimelineSemaphore
function ~TimelineSemaphore
function TimelineSemaphore
| TimelineSemaphore(
TimelineSemaphore && other
)
|
function operator=
| TimelineSemaphore & operator=(
TimelineSemaphore && other
)
|
function TimelineSemaphore
| TimelineSemaphore(
const TimelineSemaphore &
) =delete
|
function operator=
| TimelineSemaphore & operator=(
const TimelineSemaphore &
) =delete
|
function handle
| inline const Handle< TimelineSemaphore_t > & handle() const
|
function isValid
| inline bool isValid() const
|
function operator Handle< TimelineSemaphore_t >
| inline operator Handle< TimelineSemaphore_t >() const
|
function value
Returns the current counter value from the GPU/CPU timeline.
function signal
| void signal(
uint64_t value
)
|
Signals the semaphore to value from the CPU side.
function wait
| TimelineSemaphoreWaitResult wait(
uint64_t value
) const
|
Return: TimelineSemaphoreWaitResult::Success or TimelineSemaphoreWaitResult::Timeout.
Blocks the calling CPU thread until the semaphore counter reaches value
Friends
friend Device
| friend class Device(
Device
);
|
Updated on 2026-03-14 at 00:03:56 +0000