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

Method resize

samples/extensions/shader_object/shader_object.cpp:104–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool ShaderObject::resize(const uint32_t _width, const uint32_t _height)
105{
106 if (!has_device())
107 {
108 return false;
109 }
110
111 ApiVulkanSample::resize(width, height);
112
113 auto vkdevice = get_device().get_handle();
114 get_device().wait_idle();
115
116 // Destroy Post Processing Image
117 vkDestroyImageView(vkdevice, post_process_image.image_view, nullptr);
118 vkFreeMemory(vkdevice, post_process_image.memory, nullptr);
119 vkDestroyImage(vkdevice, post_process_image.image, nullptr);
120
121 // Destroy output images
122 for (auto image : output_images)
123 {
124 vkDestroyImageView(vkdevice, image.image_view, nullptr);
125 vkFreeMemory(vkdevice, image.memory, nullptr);
126 vkDestroyImage(vkdevice, image.image, nullptr);
127 }
128
129 // Destroy depth output images
130 for (auto image : depth_images)
131 {
132 vkDestroyImageView(vkdevice, image.image_view, nullptr);
133 vkFreeMemory(vkdevice, image.memory, nullptr);
134 vkDestroyImage(vkdevice, image.image, nullptr);
135 }
136
137 output_images.clear();
138 depth_images.clear();
139
140 // Create new output images
141 create_images();
142
143 initialize_descriptor_sets();
144
145 update_uniform_buffers();
146
147 // Update swapchain to allow transfer dst to blit to it
148 update_swapchain_image_usage_flags({VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_TRANSFER_DST_BIT});
149
150 return true;
151}
152
153bool ShaderObject::prepare(const vkb::ApplicationOptions &options)
154{

Callers 5

setup_framebufferMethod · 0.45
CalculateMipLevelDataMethod · 0.45
calculate_mip_levelsMethod · 0.45
reset_mip_tableMethod · 0.45

Calls 3

get_handleMethod · 0.45
wait_idleMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected