VV::V3::Fence class

Fences are a synchronization primitive that can be used to insert a dependency from a queue to the host. Fences have two states - signaled and unsignaled.

This object represents a device created object on the host. As such ownership is tied to this host object. Due to this design, the object has no copy-construction allowed. Instead, default move constructor and assignment has been defined.

Base classes

struct VV::V2::Fence
Fences are a synchronization primitive that can be used to insert a dependency from a queue to the host. Fences have two states - signaled and unsignaled.

Public types

using Parent = V2::Fence

Public static functions

static auto Reset(DynamicArray<Fence> _fences) -> EResult
Reset the fences in the provided container.
static auto WaitForFence(DynamicArray<Fence> _fences, bool _waitForAll, u64 _timeout) -> EResult
Wait for one or more fences to enter the signaled state on the host.

Constructors, destructors, conversion operators

Fence()
Default constructor.
Fence(const LogicalDevice& _device)
Logical device specified.
Fence(const LogicalDevice& _device, const Memory::AllocationCallbacks& _allocator)
Logical device and allocator specified.
Fence(Fence&& _other) noexcept
Performs a move operation to transfer ownership of the device object to this host object.
~Fence()
Destroy a fence if handle is not null.
operator Handle&()
Implicit conversion to give a reference to its handle.
operator const Handle&() const
Implicit conversion to give a readonly reference to its handle.
operator const Handle*() const
Implicit conversion to give a pointer to its handle.

Public functions

auto Create(const CreateInfo& _info) -> EResult
Create a fence.
auto Create(const LogicalDevice& _device, const CreateInfo& _info) -> EResult
Create a fence (logical device specified).
auto Create(const LogicalDevice& _device, const CreateInfo& _info, const Memory::AllocationCallbacks& _allocator) -> EResult
Create a fence (logical device and allocator specified).
void Destroy()
Destroy a fence.
auto GetDeviceHandle() const -> LogicalDevice::Handle
Provides the logical device handle.
auto GetStatus() -> EResult
Query the status of a fence from the host.
auto GetOS_Handle(const GetOS_HandleInfo& _win32Info, OS_Handle& _winHandle) -> EResult
Platform agnostic way to export the os handle of the fence.
auto ImportOS_Handle(const ImportOS_HandleInfo& _importInfo) -> EResult
Import a fence payload from a os handle.
auto RegisterDeviceEvent(const DeviceEventInfo _eventInfo) -> EResult
Create a fence that will be signaled when an event occurs on a device.
auto RegisterDisplayEvent(Display::Handle _display, const DisplayEventInfo& _eventInfo) -> EResult
Create a fence that will be signaled when an event occurs on a Display object.
auto Reset() -> EResult
Set the state of fences to unsignaled from the host.
auto WaitFor(u64 _timeout) -> EResult
Wait for the fence to enter the signaled state on the host.
auto operator==(const Fence& _other) const -> bool
Checks to see if its the same object by checking to see if its the same handle.
auto operator=(Fence&& _other) -> Fence& noexcept
Performs a move assignment operation to transfer ownership of the device object to this host object.

Protected variables

Handle handle
const Memory::AllocationCallbacks* allocator
const LogicalDevice* device