21 #include "fence_manager.hpp" 34 for (
auto &fence : fences)
35 vkDestroyFence(device, fence,
nullptr);
47 vkWaitForFences(device, count, fences.data(),
true, UINT64_MAX);
48 vkResetFences(device, count, fences.data());
55 if (count < fences.size())
56 return fences[count++];
59 VkFenceCreateInfo info = { VK_STRUCTURE_TYPE_FENCE_CREATE_INFO };
60 VK_CHECK(vkCreateFence(device, &info,
nullptr, &fence));
61 fences.push_back(fence);
void beginFrame()
Begins the frame. Waits for GPU to trigger all outstanding fences. After begin frame returns...
~FenceManager()
Destructor.
FenceManager(VkDevice device)
Constructor.
VkFence requestClearedFence()
Called internally by the Context whenever submissions to GPU happens.