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

Method createFramebuffers

code/19_vertex_buffer.cpp:617–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected