|
MANDRILL_API | Swapchain (ptr< Device > pDevice, uint32_t framesInFlight=2) |
| Create a new swapchain.
|
|
MANDRILL_API | ~Swapchain () |
| Destructor for swapchain.
|
|
MANDRILL_API void | recreate () |
| Recreate the swapchain, for instance if window size changed.
|
|
MANDRILL_API VkCommandBuffer | acquireNextImage () |
| Acquire the next image in the swapchain to render to.
|
|
MANDRILL_API void | present (VkCommandBuffer cmd, ptr< Image > pImage) |
| Present a rendered image to the swapchain image.
|
|
MANDRILL_API void | requestScreenshot () |
| Request a screenshot from the next rendered frame. This call must be paired with a call to waitForScreenshot(). See App::takeScreenshot() for proper usage.
|
|
MANDRILL_API std::vector< uint8_t > | waitForScreenshot () |
| Wait for screenshot to be available and acquire it. Only call this after a call to requestScreenshot(). See App::takeScreenshot() for proper usage.
|
|
MANDRILL_API VkSwapchainKHR | getSwapchain () const |
| Get the swapchain handle.
|
|
MANDRILL_API VkImage | getImage () const |
| Get the current swapchain image.
|
|
MANDRILL_API const std::vector< VkImage > & | getImages () const |
| Get all the swapchain images.
|
|
MANDRILL_API VkImageView | getImageView () const |
| Get the current swapchain image view.
|
|
MANDRILL_API const std::vector< VkImageView > & | getImageViews () const |
| Get all the swapchain image views.
|
|
MANDRILL_API VkDescriptorSet | getImageDescriptorSet () const |
| Get the descriptor set of the current swapchain image. Useful if using the swapchain image as a storage image in a shader.
|
|
MANDRILL_API VkFormat | getImageFormat () const |
| Get the image format of the swapchain.
|
|
MANDRILL_API VkExtent2D | getExtent () const |
| Get the extent (resolution) of the swapchain.
|
|
MANDRILL_API uint32_t | getImageIndex () const |
| Get the current image index.
|
|
MANDRILL_API uint32_t | getInFlightIndex () const |
| Get the current frame in flight index.
|
|
MANDRILL_API uint32_t | getPreviousInFlightIndex () const |
| Get the index of the previous frame that was in flight. This is useful when indexing after calling present(), like when querying for timestamps.
|
|
MANDRILL_API uint32_t | getFramesInFlightCount () const |
| Get the count of the total number of frames in flight.
|
|
MANDRILL_API bool | recreated () const |
| Check if the swapchain was recreated during the last frame. This is reset in present().
|
|
Swapchain class for managing the swapchain and its images.