HoviTron Video Pipeline
Public Member Functions | Data Fields | Protected Attributes
SwapchainAbstract Class Referenceabstract

Encapsulate the notion of Swapchain. More...

#include <SwapchainAbstract.h>

Inheritance diagram for SwapchainAbstract:
SwapchainCommon SwapchainOpenXR

Public Member Functions

virtual std::tuple< uint32_t, std::optional< vk::Semaphore > > acquireImage ()=0
 
virtual void presentImage (uint32_t imageIndex, vk::Semaphore &renderingFinnished)=0
 
virtual void presentImage (uint32_t imageIndex, vk::Fence &renderingFinnishedFence)=0
 
virtual void cleanup ()=0
 
virtual vk::ImageView getSwapchainImageView (int elem)=0
 
virtual int getAttachmentSize ()=0
 
virtual vk::Image getSwapchainImage (int index)=0
 
virtual vk::Image getCurrentImage ()=0
 

Data Fields

std::variant< vk::SwapchainKHR > handle
 
vk::Extent2D swapchainExtent
 
vk::Format swapchainFormat
 

Protected Attributes

std::vector< vk::ImageView > swapchainImageViews
 
VulkanWrapperwraps = nullptr
 
WindowAbstractwindow = nullptr
 

Detailed Description

Encapsulate the notion of Swapchain.

Virtual class to encapsulate the notion of swapchain. Swapchain can be seen as a stack of image waiting to be displayed. When displaying the rendered image on the computer screen GLFW library is used and we use vkSwapchainKHR object. When displaying the rendered image on the Head Mounted Display (OpenXR usage). The XrSwapchain object is used. The SwapchainAbstract have the purpose to abstract the difference between the two previous options from the rest of the code using inheritance.

Definition at line 39 of file SwapchainAbstract.h.

Member Function Documentation

◆ acquireImage()

virtual std::tuple< uint32_t, std::optional< vk::Semaphore > > SwapchainAbstract::acquireImage ( )
pure virtual

Acquire the next image that will be the rendering target and optionnaly the semaphore signalling when the image is available

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ cleanup()

virtual void SwapchainAbstract::cleanup ( )
pure virtual

cleanUp ressources

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ getAttachmentSize()

virtual int SwapchainAbstract::getAttachmentSize ( )
pure virtual

Return the size of the attachment

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ getCurrentImage()

virtual vk::Image SwapchainAbstract::getCurrentImage ( )
pure virtual

Return the current vk::Image in use

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ getSwapchainImage()

virtual vk::Image SwapchainAbstract::getSwapchainImage ( int  index)
pure virtual

Return vk::Image corresponding to the requested index

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ getSwapchainImageView()

virtual vk::ImageView SwapchainAbstract::getSwapchainImageView ( int  elem)
pure virtual

Used to retrieve the vk::ImageView corresponding to the image used

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ presentImage() [1/2]

virtual void SwapchainAbstract::presentImage ( uint32_t  imageIndex,
vk::Fence &  renderingFinnishedFence 
)
pure virtual

Called to signal that rendering work have been submitted to the GPU, and that the fence have to be used for synchronization

Implemented in SwapchainCommon, and SwapchainOpenXR.

◆ presentImage() [2/2]

virtual void SwapchainAbstract::presentImage ( uint32_t  imageIndex,
vk::Semaphore &  renderingFinnished 
)
pure virtual

Called to signal that rendering work have been submitted to the GPU, and that the Semaphore have to be used for synchronization

Implemented in SwapchainCommon, and SwapchainOpenXR.

Field Documentation

◆ handle

std::variant<vk::SwapchainKHR> SwapchainAbstract::handle

Contain the handle of the swapchain. Can be only vk::SwapchainKHR when USE_OPENXR macro is not defined

Definition at line 66 of file SwapchainAbstract.h.

◆ swapchainExtent

vk::Extent2D SwapchainAbstract::swapchainExtent

Dimension of the images that composes the swapchain

Definition at line 69 of file SwapchainAbstract.h.

◆ swapchainFormat

vk::Format SwapchainAbstract::swapchainFormat

Return the format used by this swapchain

Definition at line 71 of file SwapchainAbstract.h.

◆ swapchainImageViews

std::vector<vk::ImageView> SwapchainAbstract::swapchainImageViews
protected

View to the images of the swapchain

Definition at line 75 of file SwapchainAbstract.h.

◆ window

WindowAbstract* SwapchainAbstract::window = nullptr
protected

Pointer to the window

Definition at line 79 of file SwapchainAbstract.h.

◆ wraps

VulkanWrapper* SwapchainAbstract::wraps = nullptr
protected

pointer to the VulkanWrapper

Definition at line 77 of file SwapchainAbstract.h.


The documentation for this class was generated from the following file: