Disabled framebuffer caching by physical device

Swapchain is now capable of being recreated in a partially automatic manner (some effort is still required on the developer's side still)
Windows are now allowed to be resizeable
Updated main program to support resizable windows
This commit is contained in:
2025-07-08 23:35:27 +10:00
parent 5e04281094
commit e4258318ee
5 changed files with 144 additions and 82 deletions

View File

@@ -18,9 +18,10 @@ namespace basalt
const std::initializer_list<VkPresentModeKHR> allowed_present_modes);
~Swapchain();
void recreate(VkRenderPass new_renderpass=VK_NULL_HANDLE);
void create_framebuffers(VkRenderPass render_pass);
void wait_and_reset(bool wait_all=VK_TRUE, u64 timeout=UINT64_MAX);
u32 acquire_next_image(VkFence fence=VK_NULL_HANDLE, u64 timeout=UINT64_MAX);
u32 wait_acquire_reset(bool wait_all=VK_TRUE, u64 timeout=UINT64_MAX, VkFence fence=VK_NULL_HANDLE);
basalt::darray<VkSemaphore> semaphores_image_available;
basalt::darray<VkSemaphore> semaphores_render_finished;
@@ -36,5 +37,9 @@ namespace basalt
u32 image_count = -1;
u32 max_frames_in_flight = 2;
u32 current_frame = 0;
bool framebuffers_created = false;
private:
void create (const std::initializer_list<VkSurfaceFormatKHR>& allowed_formats,
const std::initializer_list<VkPresentModeKHR> allowed_present_modes, VkSwapchainKHR prev_swapchain=VK_NULL_HANDLE);
};
}