40 vk::SurfaceKHR intrinsic;
42 vk::SwapchainKHR swapchain;
44 static constexpr uint32_t defaultNumberOfSwapchainImages = 2;
46 uint32_t nrSwapchainImages;
47 vk::Extent2D swapchainImageExtent;
48 vk::SurfaceFormatKHR swapchainImageFormat;
52 static const vk::Format depthImageFormat = vk::Format::eD16Unorm;
53 VmaAllocation depthImageAllocation;
55 vk::ImageView depthImageView;
57 static const vk::Format colorImageFormat = vk::Format::eR16G16B16A16Sfloat;
63 vk::RenderPass renderPass;
65 vk::CommandBuffer commandBuffer;
67 vk::Semaphore imageAvailableSemaphore;
68 vk::Semaphore renderFinishedSemaphore;
69 vk::Fence renderFinishedFence;
89 [[nodiscard]]
extent2 size() const noexcept override;
91 void update(
extent2 new_size) noexcept override;
94 void render_finish(
draw_context const &context) override;
97 void teardown() override;
102 extent2 _render_area_granularity;
106 std::optional<uint32_t> acquireNextImageFromSwapchain();
107 void presentImageToQueue(uint32_t frameBufferIndex, vk::Semaphore renderFinishedSemaphore);
110 void submitCommandBuffer();
112 bool readSurfaceExtent(
extent2 minimum_size,
extent2 maximum_size);
113 bool checkSurfaceExtent();
116 void buildSemaphores();
117 void teardownSemaphores();
118 gfx_surface_loss buildSwapchain(
std::
size_t new_count,
extent2 new_size);
119 void teardownSwapchain();
120 void buildCommandBuffers();
121 void teardownCommandBuffers();
122 void buildRenderPasses();
123 void teardownRenderPasses();
124 void buildFramebuffers();
125 void teardownFramebuffers();
126 void buildPipelines();
127 void teardownPipelines();
129 void teardownSurface();
130 void teardownDevice();