| 739 | } |
| 740 | |
| 741 | void createFramebuffers() { |
| 742 | swapChainFramebuffers.resize(swapChainImageViews.size()); |
| 743 | |
| 744 | for (size_t i = 0; i < swapChainImageViews.size(); i++) { |
| 745 | std::array<VkImageView, 2> attachments = { |
| 746 | swapChainImageViews[i], |
| 747 | depthImageView |
| 748 | }; |
| 749 | |
| 750 | VkFramebufferCreateInfo framebufferInfo{}; |
| 751 | framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; |
| 752 | framebufferInfo.renderPass = renderPass; |
| 753 | framebufferInfo.attachmentCount = static_cast<uint32_t>(attachments.size()); |
| 754 | framebufferInfo.pAttachments = attachments.data(); |
| 755 | framebufferInfo.width = swapChainExtent.width; |
| 756 | framebufferInfo.height = swapChainExtent.height; |
| 757 | framebufferInfo.layers = 1; |
| 758 | |
| 759 | if (vkCreateFramebuffer(device, &framebufferInfo, nullptr, &swapChainFramebuffers[i]) != VK_SUCCESS) { |
| 760 | throw std::runtime_error("failed to create framebuffer!"); |
| 761 | } |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | void createCommandPool() { |
| 766 | QueueFamilyIndices queueFamilyIndices = findQueueFamilies(physicalDevice); |
nothing calls this directly
no outgoing calls
no test coverage detected