2#include <vulkan/vulkan.h>
29 void create(VkDevice
device, uint32_t maxFramesInFlight = 2);
std::vector< VkFence > inFlightFences
Fences waiting for queue work execution completion.
Definition VulkanFrameSync.hpp:79
VulkanFrameSync & operator=(const VulkanFrameSync &)=delete
std::vector< VkSemaphore > renderFinishedSemaphores
Semaphores waiting for render passes to complete.
Definition VulkanFrameSync.hpp:77
VulkanFrameSync()=default
Construct a new Vulkan Frame Sync object.
void create(VkDevice device, uint32_t maxFramesInFlight=2)
Allocates synchronization semaphores and fences.
Definition VulkanFrameSync.cpp:33
void nextFrame()
Progresses the frame index counter.
Definition VulkanFrameSync.cpp:68
VkSemaphore getRenderFinishedSemaphore() const
Gets render completion semaphore.
Definition VulkanFrameSync.hpp:44
VulkanFrameSync(const VulkanFrameSync &)=delete
void destroy()
Safely destroys synchronization primitives.
Definition VulkanFrameSync.cpp:13
VkFence getInFlightFence() const
Gets current in-flight queue submission fence.
Definition VulkanFrameSync.hpp:49
~VulkanFrameSync()
Destroy the Vulkan Frame Sync object and release sync objects.
Definition VulkanFrameSync.cpp:6
uint32_t getCurrentFrameIndex() const
Gets current active double-buffered index.
Definition VulkanFrameSync.hpp:64
uint32_t currentFrame
Active frame index.
Definition VulkanFrameSync.hpp:72
void waitForCurrentFrame()
Blocks host execution until current frame fence is signaled, then resets it.
Definition VulkanFrameSync.cpp:60
VkSemaphore getImageAvailableSemaphore() const
Gets image acquisition semaphore.
Definition VulkanFrameSync.hpp:39
VkDevice device
Reference to logical device.
Definition VulkanFrameSync.hpp:68
uint32_t maxFrames
Max frames allowed in flight.
Definition VulkanFrameSync.hpp:70
std::vector< VkSemaphore > imageAvailableSemaphores
Semaphores waiting for image availability.
Definition VulkanFrameSync.hpp:75