diff --git a/source/blender/gpu/vulkan/vk_framebuffer.cc b/source/blender/gpu/vulkan/vk_framebuffer.cc index 776fca22f4b..13239cc2eda 100644 --- a/source/blender/gpu/vulkan/vk_framebuffer.cc +++ b/source/blender/gpu/vulkan/vk_framebuffer.cc @@ -652,9 +652,10 @@ void VKFrameBuffer::rendering_ensure_dynamic_rendering(VKContext &context, VK_FORMAT_UNDEFINED : vk_format); } + color_attachment_size = max_filled_slot_index + 1; + begin_rendering.node_data.vk_rendering_info.colorAttachmentCount = color_attachment_size; begin_rendering.node_data.vk_rendering_info.pColorAttachments = begin_rendering.node_data.color_attachments; - color_attachment_size = max_filled_slot_index + 1; for (int depth_attachment_index : IndexRange(GPU_FB_DEPTH_ATTACHMENT, 2)) { const GPUAttachment &attachment = attachments_[depth_attachment_index];