| 1 | //! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_GOOGLE_display_timing.html> |
| 2 | |
| 3 | use crate::prelude::*; |
| 4 | use crate::vk; |
| 5 | use alloc::vec::Vec; |
| 6 | use core::mem; |
| 7 | |
| 8 | impl crate::google::display_timing::Device { |
| 9 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPastPresentationTimingGOOGLE.html> |
| 10 | #[inline] |
| 11 | pub unsafe fn get_past_presentation_timing( |
| 12 | &self, |
| 13 | swapchain: vk::SwapchainKHR, |
| 14 | ) -> VkResult<Vec<vk::PastPresentationTimingGOOGLE>> { |
| 15 | read_into_uninitialized_vector(|count, data| { |
| 16 | (self.fp.get_past_presentation_timing_google)(self.handle, swapchain, count, data) |
| 17 | }) |
| 18 | } |
| 19 | |
| 20 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRefreshCycleDurationGOOGLE.html> |
| 21 | #[inline] |
| 22 | pub unsafe fn get_refresh_cycle_duration( |
| 23 | &self, |
| 24 | swapchain: vk::SwapchainKHR, |
| 25 | ) -> VkResult<vk::RefreshCycleDurationGOOGLE> { |
| 26 | let mut properties = mem::MaybeUninit::uninit(); |
| 27 | (self.fp.get_refresh_cycle_duration_google)(self.handle, swapchain, properties.as_mut_ptr()) |
| 28 | .assume_init_on_success(properties) |
| 29 | } |
| 30 | } |