VV::V3::Semaphore class

Semaphores are a synchronization primitive that can be used to insert a dependency between queue operations or between a queue operation and the host. Binary semaphores 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::Semaphore
Semaphores are a synchronization primitive that can be used to insert a dependency between queue operations or between a queue operation and the host. Binary semaphores have two states - signaled and unsignaled.

Public types

using Parent = V2::Semaphore

Constructors, destructors, conversion operators

Semaphore()
Default constructor.
Semaphore(const LogicalDevice& _device)
Logical device specified.
Semaphore(const LogicalDevice& _device, const Memory::AllocationCallbacks& _allocator)
Logical device and allocator specified.
Semaphore(Semaphore&& _other) noexcept
Performs a move operation to transfer ownership of the device object to this host object.
~Semaphore()
Destroy the semaphore if the 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 semaphore.
auto Create(const LogicalDevice& _device, const CreateInfo& _info) -> EResult
Create a semaphore (logical device specified).
auto Create(const LogicalDevice& _device, const CreateInfo& _info, const Memory::AllocationCallbacks& _allocator) -> EResult
Create a semaphore (logical device and allocator specified).
void Destroy()
Destroy a semaphore.
auto GetCounterValue(u64& _value) -> EResult
Query the current counter value of a semaphore created with a SemaphoreType of Timeline from the host.
auto GetOS_Handle(const GetOS_HandleInfo& _getInfo, OS_Handle& _osHandle) -> EResult
Export an os handle representing the payload of a semaphore.
auto ImportOS_Handle(const ImportOS_HandleInfo& _importPOSIX_Info) -> EResult
Import a semaphore payload from an os handle.
auto Signal(const SignalInfo& _info) -> EResult
Signal a semaphore created with a SemaphoreType of Timeline with a particular counter value, on the host.
auto WaitFor(const WaitInfo& _info, u64 _timeout) -> EResult
Wait for a set of semaphores created with a VkSemaphoreType of VK_SEMAPHORE_TYPE_TIMELINE to reach particular counter values on the host.
auto operator==(const Semaphore& _other) const -> bool
Checks to see if its the same object by checking to see if its the same handle.
auto operator=(Semaphore&& _other) -> Semaphore& 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