| 955 | |
| 956 | template <vkb::BindingType bindingType> |
| 957 | inline void RenderContext<bindingType>::update_swapchain_impl(vk::Extent2D const &extent, vk::SurfaceTransformFlagBitsKHR transform) |
| 958 | { |
| 959 | if (!swapchain) |
| 960 | { |
| 961 | LOGW("Can't update the swapchains extent and surface transform. No swapchain, offscreen rendering detected, skipping."); |
| 962 | return; |
| 963 | } |
| 964 | |
| 965 | device.get_resource_cache().clear_framebuffers(); |
| 966 | |
| 967 | auto width = extent.width; |
| 968 | auto height = extent.height; |
| 969 | if (transform == vk::SurfaceTransformFlagBitsKHR::eRotate90 || transform == vk::SurfaceTransformFlagBitsKHR::eRotate270) |
| 970 | { |
| 971 | // Pre-rotation: always use native orientation i.e. if rotated, use width and height of identity transform |
| 972 | std::swap(width, height); |
| 973 | } |
| 974 | |
| 975 | swapchain = std::make_unique<vkb::core::HPPSwapchain>(*swapchain, vk::Extent2D{width, height}, transform); |
| 976 | |
| 977 | // Save the preTransform attribute for future rotations |
| 978 | pre_transform = transform; |
| 979 | |
| 980 | recreate(); |
| 981 | } |
| 982 | |
| 983 | template <vkb::BindingType bindingType> |
| 984 | inline void RenderContext<bindingType>::update_swapchain(const ImageCompressionFlagsType compression, |
nothing calls this directly
no test coverage detected