MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / setup_framebuffer

Method setup_framebuffer

framework/hpp_api_vulkan_sample.cpp:653–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651}
652
653void 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
683void HPPApiVulkanSample::setup_render_pass()
684{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
get_handleMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected