Holds semaphores used for synchronizing image acquisition and rendering. More...
#include <VulkanSwapchain.h>
Inherits Raven::Swapchain.
Public Member Functions | |
| ILLUMINE_API | VulkanSwapchain (u32 width, u32 height, bool vsync) |
| Constructs a VulkanSwapchain. | |
| ILLUMINE_API void | Shutdown () override |
| Destroys the Vulkan swapchain and associated resources. | |
| ILLUMINE_API void | Present () override |
| Presents the currently rendered image to the display. | |
| ILLUMINE_API void | Recreate (u32 width, u32 height, bool enabled) override |
| Triggers a recreation of the swapchain. | |
| float | GetAspectRatio () const override |
| Returns the current aspect ratio of the swapchain. | |
| ILLUMINE_API void | BeginFrame () override |
| Begins a new frame for rendering. | |
| operator VkSwapchainKHR () const | |
| Implicit conversion to VkSwapchainKHR. | |
| std::pair< u32, u32 > | GetExtent () |
| Returns the current width and height of the swapchain. | |
| u32 | GetImageIndex () const |
| Gets the index of the current swapchain image. | |
| u8 | GetCurrentFrame () const |
| Gets the current frame index for frame-in-flight tracking. | |
| void * | GetFence () const override |
| Returns the fence used for synchronizing the current frame. | |
| void * | GetFence (const u32 frame) const override |
| const Semaphores & | GetSemaphores () const |
| Gets the semaphores used for synchronization. | |
| VkImage | GetImage (u32 index) |
| Gets a Vulkan image by index. | |
| std::vector< VkImageView > | GetImageViews () const |
| Returns all swapchain image views. | |
| u32 | GetImageCount () |
| Returns the total number of swapchain images. | |
| Public Member Functions inherited from Raven::Swapchain | |
| virtual | ~Swapchain ()=default |
| Public Member Functions inherited from Raven::RefCounted | |
| RefCounted () | |
| virtual | ~RefCounted () |
| void | IncRefCount () |
| void | DecRefCount () |
| u32 | GetRefCount () const |
Static Public Member Functions | |
| static VulkanSwapchain & | Get () |
| Returns a reference to the active VulkanSwapchain instance. | |
| Static Public Member Functions inherited from Raven::Swapchain | |
| static Ref< Swapchain > | Create (u32 width, u32 height, bool vsync) |
| Factory method to create a platform-specific swapchain instance. | |
Holds semaphores used for synchronizing image acquisition and rendering.
Vulkan implementation of the platform-agnostic Swapchain.
Each frame-in-flight uses a pair of semaphores:
Handles Vulkan-specific swapchain creation, synchronization, resizing, and presentation.
| Raven::VulkanSwapchain::VulkanSwapchain | ( | u32 | width, |
| u32 | height, | ||
| bool | vsync ) |
Constructs a VulkanSwapchain.
| width | Pointer to the current window width. |
| height | Pointer to the current window height. |
| vsync | Whether vertical synchronization is enabled. |
|
overridevirtual |
Begins a new frame for rendering.
Acquires a new image from the swapchain and prepares for rendering.
Implements Raven::Swapchain.
|
inlinestatic |
Returns a reference to the active VulkanSwapchain instance.
|
inlineoverridevirtual |
Returns the current aspect ratio of the swapchain.
Implements Raven::Swapchain.
|
inline |
Gets the current frame index for frame-in-flight tracking.
|
inline |
Returns the current width and height of the swapchain.
|
inlineoverridevirtual |
Returns the fence used for synchronizing the current frame.
Implements Raven::Swapchain.
|
inlineoverridevirtual |
Implements Raven::Swapchain.
|
inline |
Gets a Vulkan image by index.
| index | Index of the image. |
|
inline |
Returns the total number of swapchain images.
|
inline |
Gets the index of the current swapchain image.
|
inline |
Returns all swapchain image views.
|
inline |
Gets the semaphores used for synchronization.
|
inline |
Implicit conversion to VkSwapchainKHR.
|
overridevirtual |
Presents the currently rendered image to the display.
Implements Raven::Swapchain.
|
overridevirtual |
Triggers a recreation of the swapchain.
| width | New width. |
| height | New height. |
| enabled | Enable/Disable VSync |
Implements Raven::Swapchain.
|
overridevirtual |
Destroys the Vulkan swapchain and associated resources.
Implements Raven::Swapchain.