Class Fence#

Inheritance Relationships#

Derived Type#

Class Documentation#

class Fence#

Subclassed by TRAP::Graphics::API::VulkanFence

Public Functions

virtual ~Fence()#

Destructor.

consteval Fence(const Fence&) noexcept = delete#

Copy constructor.

consteval Fence &operator=(const Fence&) noexcept = delete#

Copy assignment operator.

constexpr Fence(Fence&&) noexcept = default#

Move constructor.

Fence &operator=(Fence&&) noexcept = default#

Move assignment operator.

constexpr bool IsSubmitted() const noexcept#

Retrieve whether the Fence was submitted or not.

Returns:

True if Fence was submitted, false otherwise.

virtual RendererAPI::FenceStatus GetStatus() = 0#

Retrieve the current status of the fence.

Returns:

Fence status.

virtual void Wait() = 0#

Wait for the fence to be signaled.

  1. Waits for the fence to be signaled.

  2. Resets the fence.

virtual void ResetState() = 0#

Reset the fence to the unsignalled state.

Note

If fence is already in unsignalled state then this function has no effect.

Public Static Functions

static TRAP::Ref<Fence> Create(bool signalled = false, std::string_view name = "")#

Create a new fence. Fence is not signaled.

Parameters:
  • signalled – Whether the Fence should be in signalled state or not. Default: Not signalled.

  • nameOptional: Name for the Fence.

Returns:

Created fence.

static void WaitForFences(std::vector<Fence> &fences)#

Utility function to wait for multiple fences.

Parameters:

fences – Fences to wait for.

Protected Functions

explicit Fence(bool signalled)#

Constructor. Fence is not signaled.

Parameters:

signalled – Whether the Fence should be in signalled state or not. Default: Not signalled.

Protected Attributes

bool m_submitted = false#