Use our renderpass and swapchain images to create the corresponding framebuffers
| 1229 | |
| 1230 | // Use our renderpass and swapchain images to create the corresponding framebuffers |
| 1231 | void setupFramebuffers() |
| 1232 | { |
| 1233 | swapchainFramebuffers.resize(swapchainImageViews.size()); |
| 1234 | |
| 1235 | VkFramebufferCreateInfo framebufferCreateInfo = VkFramebufferCreateInfo(); |
| 1236 | framebufferCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; |
| 1237 | framebufferCreateInfo.renderPass = renderPass; |
| 1238 | framebufferCreateInfo.attachmentCount = 2; |
| 1239 | framebufferCreateInfo.width = swapchainExtent.width; |
| 1240 | framebufferCreateInfo.height = swapchainExtent.height; |
| 1241 | framebufferCreateInfo.layers = 1; |
| 1242 | |
| 1243 | for (std::size_t i = 0; i < swapchainFramebuffers.size(); ++i) |
| 1244 | { |
| 1245 | // Each framebuffer consists of a corresponding swapchain image and the shared depth image |
| 1246 | const std::array attachments = {swapchainImageViews[i], depthImageView}; |
| 1247 | |
| 1248 | framebufferCreateInfo.pAttachments = attachments.data(); |
| 1249 | |
| 1250 | // Create the framebuffer |
| 1251 | if (vkCreateFramebuffer(device, &framebufferCreateInfo, nullptr, &swapchainFramebuffers[i]) != VK_SUCCESS) |
| 1252 | { |
| 1253 | vulkanAvailable = false; |
| 1254 | return; |
| 1255 | } |
| 1256 | } |
| 1257 | } |
| 1258 | |
| 1259 | // Set up our command pool |
| 1260 | void setupCommandPool() |
nothing calls this directly
no test coverage detected