Allocate and present separate top/bottom screen framebuffer images
Instead of operating directly on the swapchain images, we have our own top/bottom framebuffer images that will be rendered to independent of having an available swapchain. The images are blitted into the swapchain images, allowing for resizing too!
This commit is contained in:
@@ -37,6 +37,8 @@ class RendererVK final : public Renderer {
|
||||
// Todo: make this a configuration option
|
||||
static constexpr usize frameBufferingCount = 3;
|
||||
|
||||
vk::UniqueDeviceMemory framebufferMemory = {};
|
||||
|
||||
// Frame-buffering data
|
||||
// Each vector is `frameBufferingCount` in size
|
||||
std::vector<vk::UniqueCommandBuffer> frameCommandBuffers = {};
|
||||
@@ -44,6 +46,9 @@ class RendererVK final : public Renderer {
|
||||
std::vector<vk::UniqueSemaphore> renderFinishedSemaphore = {};
|
||||
std::vector<vk::UniqueFence> frameFinishedFences = {};
|
||||
|
||||
std::vector<vk::UniqueImage> topScreenImages = {};
|
||||
std::vector<vk::UniqueImage> bottomScreenImages = {};
|
||||
|
||||
// Recreate the swapchain, possibly re-using the old one in the case of a resize
|
||||
vk::Result recreateSwapchain(vk::SurfaceKHR surface, vk::Extent2D swapchainExtent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user