15 const VkExtent2D& getSwapChainExtent()
const {
return m_swapChainExtent; }
16 const RenderPass* getRenderPass()
const {
return m_renderPass.get(); }
17 const VkSwapchainKHR& getSwapChain()
const {
return m_swapChain; }
20 void createFramebuffers();
22 VkRenderPassBeginInfo getRenderPassBeginInfos(uint32_t imageIndex)
const;
23 VkResult acquireNextImage(
const VkSemaphore& semaphore, uint32_t* imageIndex);
26 void cleanSwapChain();
27 void cleanRenderPass();
30 VkSwapchainKHR m_swapChain;
31 std::vector<VkImage> m_swapChainImages;
32 VkFormat m_swapChainImageFormat;
33 VkExtent2D m_swapChainExtent;
34 std::vector<VkImageView> m_swapChainImageViews;
35 std::vector<VkFramebuffer> m_swapChainFramebuffers;
37 std::unique_ptr<DepthResources> m_depthResources;
38 std::unique_ptr<RenderPass> m_renderPass;
40 const Window* m_window =
nullptr;
42 void createSwapChain();
43 void createImageViews();
44 static VkSurfaceFormatKHR chooseSwapSurfaceFormat(
const std::vector<VkSurfaceFormatKHR>& availableFormats);
45 static VkPresentModeKHR chooseSwapPresentMode(
const std::vector<VkPresentModeKHR>& availablePresentModes);
46 VkExtent2D chooseSwapExtent(
const VkSurfaceCapabilitiesKHR& capabilities)
const;