| 651 | } |
| 652 | |
| 653 | void HPPApiVulkanSample::setup_framebuffer() |
| 654 | { |
| 655 | std::array<vk::ImageView, 2> attachments; |
| 656 | |
| 657 | // Depth/Stencil attachment is the same for all frame buffers |
| 658 | attachments[1] = depth_stencil.view; |
| 659 | |
| 660 | vk::FramebufferCreateInfo framebuffer_create_info{.renderPass = render_pass, |
| 661 | .attachmentCount = static_cast<uint32_t>(attachments.size()), |
| 662 | .pAttachments = attachments.data(), |
| 663 | .width = get_render_context().get_surface_extent().width, |
| 664 | .height = get_render_context().get_surface_extent().height, |
| 665 | .layers = 1}; |
| 666 | |
| 667 | // Delete existing frame buffers |
| 668 | for (auto &framebuffer : framebuffers) |
| 669 | { |
| 670 | get_device().get_handle().destroyFramebuffer(framebuffer); |
| 671 | } |
| 672 | framebuffers.clear(); |
| 673 | |
| 674 | // Create frame buffers for every swap chain image |
| 675 | framebuffers.reserve(swapchain_buffers.size()); |
| 676 | for (auto &buffer : swapchain_buffers) |
| 677 | { |
| 678 | attachments[0] = buffer.view; |
| 679 | framebuffers.push_back(get_device().get_handle().createFramebuffer(framebuffer_create_info)); |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | void HPPApiVulkanSample::setup_render_pass() |
| 684 | { |
nothing calls this directly
no test coverage detected