From 7dc9a329ad9c6c63758b479dac72feb6282ff838 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Tue, 10 Sep 2024 23:59:51 +0200 Subject: [PATCH] improve swapchain framebuffer creation --- src/ptk_vk/init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ptk_vk/init.c b/src/ptk_vk/init.c index 7672d68..487837d 100644 --- a/src/ptk_vk/init.c +++ b/src/ptk_vk/init.c @@ -937,7 +937,9 @@ bool create_graphics_pipeline(void) { bool create_framebuffers(void) { m_swapchain_framebuffers = PTK_LIST_NEW(VkFramebuffer, m_swapchain_image_views.size); - PTK_LIST_FOR_EACH_E(VkImageView, m_swapchain_image_views, i, swapchain_image_view, { + VkFramebuffer fb; + + PTK_LIST_FOR_EACH(VkImageView, m_swapchain_image_views, swapchain_image_view, { VK_TRY(false, vkCreateFramebuffer( g_dev, @@ -953,10 +955,10 @@ bool create_framebuffers(void) { .layers = 1, }, NULL, - &m_swapchain_framebuffers.data[i] + &fb ) ); - m_swapchain_framebuffers.size += 1; + PTK_LIST_ADD(VkFramebuffer, m_swapchain_framebuffers, fb); }) return true;