Class Fence

Class Documentation

class inexor::vulkan_renderer::wrapper::Fence

A RAII wrapper for VkFences.

Public Functions

Fence(const wrapper::Device &device, const std::string &name, bool in_signaled_state)

Default constructor.

Warning

Make sure to specify in_signaled_state correctly as needed, otherwise synchronization problems occur.

Parameters
  • device – The const reference to a device RAII wrapper instance.

  • name – The internal debug marker name of the VkFence.

  • in_signaled_state – True if the VkFence will be constructed in signaled state, false otherwise.

Fence(const Fence&) = delete
Fence(Fence&&) noexcept
~Fence()
Fence &operator=(const Fence&) = delete
Fence &operator=(Fence&&) = delete
inline VkFence get() const
void block(std::uint64_t timeout_limit = std::numeric_limits<std::uint64_t>::max()) const

Block fence by calling vkWaitForFences and wait until fence condition is fulfilled.

Parameters

timeout_limit – The time to wait in milliseconds. If no time is specified, the numeric maximum value is used.

void reset() const

Call vkResetFences.

Private Members

const wrapper::Device &m_device
std::string m_name
VkFence m_fence = {VK_NULL_HANDLE}