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

Method createFramebuffers

code/18_vertex_input.cpp:609–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607 }
608
609 void createFramebuffers() {
610 swapChainFramebuffers.resize(swapChainImageViews.size());
611
612 for (size_t i = 0; i < swapChainImageViews.size(); i++) {
613 VkImageView attachments[] = {
614 swapChainImageViews[i]
615 };
616
617 VkFramebufferCreateInfo framebufferInfo{};
618 framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
619 framebufferInfo.renderPass = renderPass;
620 framebufferInfo.attachmentCount = 1;
621 framebufferInfo.pAttachments = attachments;
622 framebufferInfo.width = swapChainExtent.width;
623 framebufferInfo.height = swapChainExtent.height;
624 framebufferInfo.layers = 1;
625
626 if (vkCreateFramebuffer(device, &framebufferInfo, nullptr, &swapChainFramebuffers[i]) != VK_SUCCESS) {
627 throw std::runtime_error("failed to create framebuffer!");
628 }
629 }
630 }
631
632 void createCommandPool() {
633 QueueFamilyIndices queueFamilyIndices = findQueueFamilies(physicalDevice);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected