6#include <vulkan/vulkan_core.h>
72 uint64_t currentFrame,
74 uint32_t framesBack = 1)
const
76 if (currentFrame < framesBack)
94 uint64_t currentFrame,
116 void waitForValue(uint64_t value, uint64_t timeout = UINT64_MAX)
const;
126 uint64_t timeout = UINT64_MAX)
const
The application context is the core class which stores the basic openxr and vulkan objects.
uint64_t getStageValue(uint64_t frameNumber, PipelineStage stage) const
Gets the timeline value for a specific stage at a specific frame.
void signalValue(uint64_t value) const
CPU-side signal of the timeline semaphore.
uint32_t getFramesInFlight() const
Gets the number of frames in flight.
ApplicationContext * context_
TimelineSynchronizer(ApplicationContext *context, uint32_t framesInFlight)
Constructs a timeline synchronizer.
VkSemaphore getSemaphore() const
Gets the underlying Vulkan timeline semaphore.
TimelineSynchronizer & operator=(const TimelineSynchronizer &)=delete
TimelineSynchronizer(const TimelineSynchronizer &)=delete
uint64_t getCurrentValue() const
Gets the current GPU timeline semaphore value.
void waitForStage(uint64_t frameNumber, PipelineStage stage, uint64_t timeout=UINT64_MAX) const
CPU-side wait for a specific stage to complete.
std::optional< uint64_t > getWaitValue(uint64_t currentFrame, PipelineStage waitForStage, uint32_t framesBack=1) const
Gets the value to wait for from a previous frame's stage.
std::optional< uint64_t > getResourceReuseWaitValue(uint64_t currentFrame, PipelineStage waitForStage) const
Gets the wait value for resource reuse (frames-in-flight synchronization)
VkSemaphore timelineSemaphore_
void waitForValue(uint64_t value, uint64_t timeout=UINT64_MAX) const
CPU-side wait for a specific timeline value.
Log category system implementation.
constexpr uint32_t PIPELINE_STAGE_COUNT
PipelineStage
Extensible pipeline stages for timeline semaphore synchronization.