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

Method create_swapchain_buffers

framework/hpp_api_vulkan_sample.cpp:834–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

832}
833
834void HPPApiVulkanSample::create_swapchain_buffers()
835{
836 if (get_render_context().has_swapchain())
837 {
838 auto &images = get_render_context().get_swapchain().get_images();
839
840 // Get the swap chain buffers containing the image and imageview
841 for (auto &swapchain_buffer : swapchain_buffers)
842 {
843 get_device().get_handle().destroyImageView(swapchain_buffer.view);
844 }
845 swapchain_buffers.clear();
846 swapchain_buffers.reserve(images.size());
847 for (auto &image : images)
848 {
849 swapchain_buffers.push_back(
850 {image,
851 vkb::common::create_image_view(get_device().get_handle(), image, vk::ImageViewType::e2D, get_render_context().get_swapchain().get_format())});
852 }
853 }
854 else
855 {
856 auto &frames = get_render_context().get_render_frames();
857
858 // Get the swap chain buffers containing the image and imageview
859 swapchain_buffers.clear();
860 swapchain_buffers.reserve(frames.size());
861 for (auto &frame : frames)
862 {
863 auto &image_view = *frame->get_render_target().get_views().begin();
864 swapchain_buffers.push_back({image_view.get_image().get_handle(), image_view.get_handle()});
865 }
866 }
867}
868
869void HPPApiVulkanSample::update_swapchain_image_usage_flags(std::set<vk::ImageUsageFlagBits> const &image_usage_flags)
870{

Callers

nothing calls this directly

Calls 9

create_image_viewFunction · 0.85
has_swapchainMethod · 0.80
sizeMethod · 0.80
get_handleMethod · 0.45
clearMethod · 0.45
get_formatMethod · 0.45
beginMethod · 0.45
get_render_targetMethod · 0.45
get_imageMethod · 0.45

Tested by

no test coverage detected