| 102 | } |
| 103 | |
| 104 | bool 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 | |
| 153 | bool ShaderObject::prepare(const vkb::ApplicationOptions &options) |
| 154 | { |
no test coverage detected