whillothewhisp

framebuffer creation

Jan 4th, 2022 (edited)
1,800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1.     //out previously created imageViews are our attachments
  2.     std::array<VkImageView, 2> attachments = { object_picking_colorImageView, object_picking_depthImageView };
  3.     VkFramebufferCreateInfo framebuffer_info{};
  4.     framebuffer_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
  5.     framebuffer_info.renderPass = object_picking_pass;
  6.     framebuffer_info.pAttachments = attachments.data();
  7.     framebuffer_info.attachmentCount = static_cast<uint32_t>(attachments.size());
  8.     framebuffer_info.width = swapChainExtent.width;
  9.     framebuffer_info.height = swapChainExtent.height;
  10.     framebuffer_info.layers = 1;
  11.     if (vkCreateFramebuffer(device, &framebuffer_info, nullptr, &object_picking_fb) != VK_SUCCESS) {
  12.         throw std::runtime_error("failed to create framebuffer!");
  13.     }
Add Comment
Please, Sign In to add comment