![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Allows the CPU to wait for GPU operation to finish. More...
#include <vppSynchronization.hpp>
Public Member Functions | |
Fence () | |
Constructs null reference. | |
Fence (const Device &hDevice, bool bSignaled=false) | |
Constructs a fence on specified device. More... | |
VkFence | handle () const |
Retrieves the Vulkan handle. | |
const Device & | device () const |
Retrieves the device. | |
bool | isSignaled () const |
Checks whether the fence is currently in signaled state. | |
void | reset () |
Resets the fence to unsignaled state. | |
bool | wait (std::uint64_t timeoutNs=std::numeric_limits< std::uint64_t >::max()) const |
Waits until the fence becomes signaled. More... | |
Static Public Member Functions | |
static void | reset (std::vector< Fence > *pFences) |
Resets all given fences to unsignaled state. | |
static bool | waitAll (std::vector< Fence > *pFences, std::uint64_t timeoutNs=std::numeric_limits< std::uint64_t >::max()) |
Waits until all given fences become signaled. More... | |
static bool | waitOne (std::vector< Fence > *pFences, std::uint64_t timeoutNs=std::numeric_limits< std::uint64_t >::max()) |
Waits until one of given fences becomes signaled. More... | |
static bool | waitAll (const Device &hDevice, std::vector< VkFence > *pFences, std::uint64_t timeoutNs=std::numeric_limits< std::uint64_t >::max()) |
static bool | waitOne (const Device &hDevice, std::vector< VkFence > *pFences, std::uint64_t timeoutNs=std::numeric_limits< std::uint64_t >::max()) |
Allows the CPU to wait for GPU operation to finish.
Many of VPP operations (esp. queue submission) accept optional Fence argument, allowing to wait on CPU side untile the operation finishes. When that happens, the fence is being set to signaled state.
This object is reference-counted and may be passed by value.
vpp::Fence::Fence | ( | const Device & | hDevice, |
bool | bSignaled = false |
||
) |
Constructs a fence on specified device.
You can optionally specify the initial fence state: signaled or unsignaled.
bool vpp::Fence::wait | ( | std::uint64_t | timeoutNs = std::numeric_limits< std::uint64_t >::max() | ) | const |
Waits until the fence becomes signaled.
Optionally allows to specify a timeout in nanoseconds. When omitted, the wait will be for indefinite time (may hang the application).
Returns true
if the fence has really been signaled. Returns false
if waiting has been interrupted by a timeout.
|
static |
Waits until all given fences become signaled.
Optionally allows to specify a timeout in nanoseconds. When omitted, the wait will be for indefinite time (may hang the application).
Returns true
if fences have really been signaled. Returns false
if waiting has been interrupted by a timeout.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
Waits until one of given fences becomes signaled.
Optionally allows to specify a timeout in nanoseconds. When omitted, the wait will be for indefinite time (may hang the application).
Returns true
if a fence have really been signaled. Returns false
if waiting has been interrupted by a timeout.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.