Class VulkanSwapChain#

Inheritance Relationships#

Base Type#

Class Documentation#

class VulkanSwapChain : public TRAP::Graphics::SwapChain#

Remark

Headless mode: This class is not available in headless mode.

Public Functions

explicit VulkanSwapChain(RendererAPI::SwapChainDesc &desc)#

Constructor.

Parameters:

desc – Swap chain description.

~VulkanSwapChain() override#

Destructor.

consteval VulkanSwapChain(const VulkanSwapChain&) noexcept = delete#

Copy constructor.

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

Copy assignment operator.

VulkanSwapChain(VulkanSwapChain&&) noexcept = default#

Move constructor.

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

Move assignment operator.

virtual std::optional<u32> AcquireNextImage(Semaphore &signalSemaphore, Fence &fence) const override#

Acquire the next presentable image from the swapchain to render to.

Parameters:
  • signalSemaphoreSemaphore to signal when the image is ready to be presented.

  • fenceFence to wait for the image to be ready to be presented.

Returns:

Acquired image index.

virtual std::optional<u32> AcquireNextImage(Semaphore &signalSemaphore) const override#

Acquire the next presentable image from the swapchain to render to.

Parameters:

signalSemaphoreSemaphore to signal when the image is ready to be presented.

Returns:

Acquired image index.

virtual std::optional<u32> AcquireNextImage(Fence &fence) const override#

Acquire the next presentable image from the swapchain to render to.

Parameters:

fenceFence to wait for the image to be ready to be presented.

Returns:

Acquired image index.

virtual void ToggleVSync() override#

Toggle VSync on and off.

virtual void UpdateFramebufferSize() override#

Updates the framebuffer size and recreates the swap chain.

constexpr VkSwapchainKHR GetVkSwapChain() const noexcept#

Retrieve the Vulkan swap chain handle.

Returns:

Vulkan swap chain handle.

constexpr VkQueue GetPresentVkQueue() const noexcept#

Retrieve the Vulkan queue used for presentation.

Returns:

Vulkan queue used for presentation.