MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / createFramebuffers

Method createFramebuffers

code/30_multisampling.cpp:768–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766 }
767
768 void createFramebuffers() {
769 swapChainFramebuffers.resize(swapChainImageViews.size());
770
771 for (size_t i = 0; i < swapChainImageViews.size(); i++) {
772 std::array<VkImageView, 3> attachments = {
773 colorImageView,
774 depthImageView,
775 swapChainImageViews[i]
776 };
777
778 VkFramebufferCreateInfo framebufferInfo{};
779 framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
780 framebufferInfo.renderPass = renderPass;
781 framebufferInfo.attachmentCount = static_cast<uint32_t>(attachments.size());
782 framebufferInfo.pAttachments = attachments.data();
783 framebufferInfo.width = swapChainExtent.width;
784 framebufferInfo.height = swapChainExtent.height;
785 framebufferInfo.layers = 1;
786
787 if (vkCreateFramebuffer(device, &framebufferInfo, nullptr, &swapChainFramebuffers[i]) != VK_SUCCESS) {
788 throw std::runtime_error("failed to create framebuffer!");
789 }
790 }
791 }
792
793 void createCommandPool() {
794 QueueFamilyIndices queueFamilyIndices = findQueueFamilies(physicalDevice);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected