Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
VulkanQueueProgress.h File Reference

donner::gpu::vulkan::VulkanQueueProgress - when the one queue every runtime device over a Vulkan root submits to last finished work, and fence waits that give up only when it stops. More...

#include <vulkan/vulkan.h>
#include <chrono>
#include <cstdint>
#include <functional>
#include <mutex>
#include <ostream>
#include <span>
#include <vector>
#include "donner/gpu/DeviceLost.h"
#include "donner/gpu/GpuResult.h"
#include "donner/gpu/vulkan/VulkanLoader.h"
Include dependency graph for VulkanQueueProgress.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::gpu::vulkan::VulkanQueueProgress
 When the one queue every runtime device over a Vulkan root submits to last made progress. More...
struct  donner::gpu::vulkan::FenceProgressWait
 How a fence wait bounded by queue progress ended, with the native result of its last step. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::gpu::vulkan::FenceProgressWaitEnd : uint8_t {
  Signalled ,
  Stalled ,
  RootLost ,
  Failed
}
 How a fence wait bounded by queue progress ended, as WaitForFencesWhileQueueProgresses reports it. More...

Functions

std::ostream & donner::gpu::vulkan::operator<< (std::ostream &os, FenceProgressWaitEnd value)
 Ostream output operator.
FenceProgressWait donner::gpu::vulkan::WaitForFencesWhileQueueProgresses (const VulkanApi &api, VkDevice device, std::span< const VkFence > fences, VulkanQueueProgress *progress, const DeviceLostState *rootLoss, std::chrono::steady_clock::duration stallBound, const std::function< void()> &stepHook={})
 Waits for every one of fences to signal, giving up once the queue they are on has made no progress for stallBound.

Detailed Description

donner::gpu::vulkan::VulkanQueueProgress - when the one queue every runtime device over a Vulkan root submits to last finished work, and fence waits that give up only when it stops.

Enumeration Type Documentation

◆ FenceProgressWaitEnd

enum class donner::gpu::vulkan::FenceProgressWaitEnd : uint8_t
strong

How a fence wait bounded by queue progress ended, as WaitForFencesWhileQueueProgresses reports it.

Enumerator
Signalled 

Every fence signalled.

Stalled 

The queue made no progress for the bound.

RootLost 

A device over the root declared the root lost first.

Failed 

The wait itself failed; FenceProgressWait::result says how.

Function Documentation

◆ operator<<()

std::ostream & donner::gpu::vulkan::operator<< ( std::ostream & os,
FenceProgressWaitEnd value )

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ WaitForFencesWhileQueueProgresses()

FenceProgressWait donner::gpu::vulkan::WaitForFencesWhileQueueProgresses ( const VulkanApi & api,
VkDevice device,
std::span< const VkFence > fences,
VulkanQueueProgress * progress,
const DeviceLostState * rootLoss,
std::chrono::steady_clock::duration stallBound,
const std::function< void()> & stepHook = {} )

Waits for every one of fences to signal, giving up once the queue they are on has made no progress for stallBound.

The bound runs from the queue's last progress, which can predate the wait, so a new wait on a queue that was already seen to stop does not restart it; progress no one had looked for yet is timed by this wait's first look (see VulkanQueueProgress). Without a progress record the whole wait is bounded by stallBound instead. Waits in steps of at most 10 ms, looking for progress and for a loss declared over the root between them; with neither to look for, it waits once for the whole bound. Records nothing: each caller decides what its outcome means.

Parameters
apiEntry points of the fences' device.
deviceDevice the fences belong to.
fencesFences to wait for, all of them.
progressProgress of the queue the fences' work is on, or null when none is tracked.
rootLossLoss condition that ends the wait once declared, or null for a wait that has to prove the fence signalled whatever was declared, as teardown does.
stallBoundLongest the queue may go without progress.
stepHookRun after every step that ends with the fence unsignalled; test seam.