improve swapchain framebuffer creation

This commit is contained in:
jacekpoz 2024-09-10 23:59:51 +02:00
parent b31dd0d797
commit 7dc9a329ad
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -937,7 +937,9 @@ bool create_graphics_pipeline(void) {
bool create_framebuffers(void) { bool create_framebuffers(void) {
m_swapchain_framebuffers = PTK_LIST_NEW(VkFramebuffer, m_swapchain_image_views.size); 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, VK_TRY(false,
vkCreateFramebuffer( vkCreateFramebuffer(
g_dev, g_dev,
@ -953,10 +955,10 @@ bool create_framebuffers(void) {
.layers = 1, .layers = 1,
}, },
NULL, NULL,
&m_swapchain_framebuffers.data[i] &fb
) )
); );
m_swapchain_framebuffers.size += 1; PTK_LIST_ADD(VkFramebuffer, m_swapchain_framebuffers, fb);
}) })
return true; return true;