erupt/generated/extensions/
google_display_timing.rs

1// DO NOT EDIT: @generated by erupt's generator
2///<s>Vulkan Manual Page</s> · Constant
3#[doc(alias = "VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION")]
4pub const GOOGLE_DISPLAY_TIMING_SPEC_VERSION: u32 = 1;
5///<s>Vulkan Manual Page</s> · Constant
6#[doc(alias = "VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME")]
7pub const GOOGLE_DISPLAY_TIMING_EXTENSION_NAME: *const std::os::raw::c_char = crate::cstr!(
8    "VK_GOOGLE_display_timing"
9);
10///<s>Vulkan Manual Page</s> · Constant
11pub const FN_GET_REFRESH_CYCLE_DURATION_GOOGLE: *const std::os::raw::c_char = crate::cstr!(
12    "vkGetRefreshCycleDurationGOOGLE"
13);
14///<s>Vulkan Manual Page</s> · Constant
15pub const FN_GET_PAST_PRESENTATION_TIMING_GOOGLE: *const std::os::raw::c_char = crate::cstr!(
16    "vkGetPastPresentationTimingGOOGLE"
17);
18///Provided by [`crate::extensions::google_display_timing`]
19impl crate::vk1_0::StructureType {
20    pub const PRESENT_TIMES_INFO_GOOGLE: Self = Self(1000092000);
21}
22///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRefreshCycleDurationGOOGLE.html) · Function
23#[allow(non_camel_case_types)]
24pub type PFN_vkGetRefreshCycleDurationGOOGLE = unsafe extern "system" fn(
25    device: crate::vk1_0::Device,
26    swapchain: crate::extensions::khr_swapchain::SwapchainKHR,
27    p_display_timing_properties: *mut crate::extensions::google_display_timing::RefreshCycleDurationGOOGLE,
28) -> crate::vk1_0::Result;
29///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPastPresentationTimingGOOGLE.html) · Function
30#[allow(non_camel_case_types)]
31pub type PFN_vkGetPastPresentationTimingGOOGLE = unsafe extern "system" fn(
32    device: crate::vk1_0::Device,
33    swapchain: crate::extensions::khr_swapchain::SwapchainKHR,
34    p_presentation_timing_count: *mut u32,
35    p_presentation_timings: *mut crate::extensions::google_display_timing::PastPresentationTimingGOOGLE,
36) -> crate::vk1_0::Result;
37impl<'a> crate::ExtendableFrom<'a, PresentTimesInfoGOOGLE>
38for crate::extensions::khr_swapchain::PresentInfoKHRBuilder<'a> {}
39impl<'a> crate::ExtendableFrom<'a, PresentTimesInfoGOOGLEBuilder<'_>>
40for crate::extensions::khr_swapchain::PresentInfoKHRBuilder<'a> {}
41///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkRefreshCycleDurationGOOGLE.html) · Structure
42#[doc(alias = "VkRefreshCycleDurationGOOGLE")]
43#[derive(Copy, Clone, Hash, PartialEq, Eq)]
44#[repr(C)]
45pub struct RefreshCycleDurationGOOGLE {
46    pub refresh_duration: u64,
47}
48impl Default for RefreshCycleDurationGOOGLE {
49    fn default() -> Self {
50        Self {
51            refresh_duration: Default::default(),
52        }
53    }
54}
55impl std::fmt::Debug for RefreshCycleDurationGOOGLE {
56    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
57        f.debug_struct("RefreshCycleDurationGOOGLE")
58            .field("refresh_duration", &self.refresh_duration)
59            .finish()
60    }
61}
62impl RefreshCycleDurationGOOGLE {
63    #[inline]
64    pub fn into_builder<'a>(self) -> RefreshCycleDurationGOOGLEBuilder<'a> {
65        RefreshCycleDurationGOOGLEBuilder(self, std::marker::PhantomData)
66    }
67}
68#[derive(Copy, Clone)]
69///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkRefreshCycleDurationGOOGLE.html) · Builder of [`RefreshCycleDurationGOOGLE`]
70#[repr(transparent)]
71pub struct RefreshCycleDurationGOOGLEBuilder<'a>(
72    RefreshCycleDurationGOOGLE,
73    std::marker::PhantomData<&'a ()>,
74);
75impl<'a> RefreshCycleDurationGOOGLEBuilder<'a> {
76    #[inline]
77    pub fn new() -> RefreshCycleDurationGOOGLEBuilder<'a> {
78        RefreshCycleDurationGOOGLEBuilder(Default::default(), std::marker::PhantomData)
79    }
80    #[inline]
81    #[must_use]
82    pub fn refresh_duration(mut self, refresh_duration: u64) -> Self {
83        self.0.refresh_duration = refresh_duration as _;
84        self
85    }
86    #[inline]
87    pub fn build(self) -> RefreshCycleDurationGOOGLE {
88        self.0
89    }
90}
91impl<'a> std::default::Default for RefreshCycleDurationGOOGLEBuilder<'a> {
92    fn default() -> RefreshCycleDurationGOOGLEBuilder<'a> {
93        Self::new()
94    }
95}
96impl<'a> std::fmt::Debug for RefreshCycleDurationGOOGLEBuilder<'a> {
97    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
98        std::fmt::Debug::fmt(&self.0, f)
99    }
100}
101impl<'a> std::ops::Deref for RefreshCycleDurationGOOGLEBuilder<'a> {
102    type Target = RefreshCycleDurationGOOGLE;
103    fn deref(&self) -> &Self::Target {
104        &self.0
105    }
106}
107impl<'a> std::ops::DerefMut for RefreshCycleDurationGOOGLEBuilder<'a> {
108    fn deref_mut(&mut self) -> &mut Self::Target {
109        &mut self.0
110    }
111}
112///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPastPresentationTimingGOOGLE.html) · Structure
113#[doc(alias = "VkPastPresentationTimingGOOGLE")]
114#[derive(Copy, Clone, Hash, PartialEq, Eq)]
115#[repr(C)]
116pub struct PastPresentationTimingGOOGLE {
117    pub present_id: u32,
118    pub desired_present_time: u64,
119    pub actual_present_time: u64,
120    pub earliest_present_time: u64,
121    pub present_margin: u64,
122}
123impl Default for PastPresentationTimingGOOGLE {
124    fn default() -> Self {
125        Self {
126            present_id: Default::default(),
127            desired_present_time: Default::default(),
128            actual_present_time: Default::default(),
129            earliest_present_time: Default::default(),
130            present_margin: Default::default(),
131        }
132    }
133}
134impl std::fmt::Debug for PastPresentationTimingGOOGLE {
135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
136        f.debug_struct("PastPresentationTimingGOOGLE")
137            .field("present_id", &self.present_id)
138            .field("desired_present_time", &self.desired_present_time)
139            .field("actual_present_time", &self.actual_present_time)
140            .field("earliest_present_time", &self.earliest_present_time)
141            .field("present_margin", &self.present_margin)
142            .finish()
143    }
144}
145impl PastPresentationTimingGOOGLE {
146    #[inline]
147    pub fn into_builder<'a>(self) -> PastPresentationTimingGOOGLEBuilder<'a> {
148        PastPresentationTimingGOOGLEBuilder(self, std::marker::PhantomData)
149    }
150}
151#[derive(Copy, Clone)]
152///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPastPresentationTimingGOOGLE.html) · Builder of [`PastPresentationTimingGOOGLE`]
153#[repr(transparent)]
154pub struct PastPresentationTimingGOOGLEBuilder<'a>(
155    PastPresentationTimingGOOGLE,
156    std::marker::PhantomData<&'a ()>,
157);
158impl<'a> PastPresentationTimingGOOGLEBuilder<'a> {
159    #[inline]
160    pub fn new() -> PastPresentationTimingGOOGLEBuilder<'a> {
161        PastPresentationTimingGOOGLEBuilder(Default::default(), std::marker::PhantomData)
162    }
163    #[inline]
164    #[must_use]
165    pub fn present_id(mut self, present_id: u32) -> Self {
166        self.0.present_id = present_id as _;
167        self
168    }
169    #[inline]
170    #[must_use]
171    pub fn desired_present_time(mut self, desired_present_time: u64) -> Self {
172        self.0.desired_present_time = desired_present_time as _;
173        self
174    }
175    #[inline]
176    #[must_use]
177    pub fn actual_present_time(mut self, actual_present_time: u64) -> Self {
178        self.0.actual_present_time = actual_present_time as _;
179        self
180    }
181    #[inline]
182    #[must_use]
183    pub fn earliest_present_time(mut self, earliest_present_time: u64) -> Self {
184        self.0.earliest_present_time = earliest_present_time as _;
185        self
186    }
187    #[inline]
188    #[must_use]
189    pub fn present_margin(mut self, present_margin: u64) -> Self {
190        self.0.present_margin = present_margin as _;
191        self
192    }
193    #[inline]
194    pub fn build(self) -> PastPresentationTimingGOOGLE {
195        self.0
196    }
197}
198impl<'a> std::default::Default for PastPresentationTimingGOOGLEBuilder<'a> {
199    fn default() -> PastPresentationTimingGOOGLEBuilder<'a> {
200        Self::new()
201    }
202}
203impl<'a> std::fmt::Debug for PastPresentationTimingGOOGLEBuilder<'a> {
204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
205        std::fmt::Debug::fmt(&self.0, f)
206    }
207}
208impl<'a> std::ops::Deref for PastPresentationTimingGOOGLEBuilder<'a> {
209    type Target = PastPresentationTimingGOOGLE;
210    fn deref(&self) -> &Self::Target {
211        &self.0
212    }
213}
214impl<'a> std::ops::DerefMut for PastPresentationTimingGOOGLEBuilder<'a> {
215    fn deref_mut(&mut self) -> &mut Self::Target {
216        &mut self.0
217    }
218}
219///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPresentTimesInfoGOOGLE.html) · Structure
220#[doc(alias = "VkPresentTimesInfoGOOGLE")]
221#[derive(Copy, Clone)]
222#[repr(C)]
223pub struct PresentTimesInfoGOOGLE {
224    pub s_type: crate::vk1_0::StructureType,
225    pub p_next: *const std::ffi::c_void,
226    pub swapchain_count: u32,
227    pub p_times: *const crate::extensions::google_display_timing::PresentTimeGOOGLE,
228}
229impl PresentTimesInfoGOOGLE {
230    pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::PRESENT_TIMES_INFO_GOOGLE;
231}
232impl Default for PresentTimesInfoGOOGLE {
233    fn default() -> Self {
234        Self {
235            s_type: Self::STRUCTURE_TYPE,
236            p_next: std::ptr::null(),
237            swapchain_count: Default::default(),
238            p_times: std::ptr::null(),
239        }
240    }
241}
242impl std::fmt::Debug for PresentTimesInfoGOOGLE {
243    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
244        f.debug_struct("PresentTimesInfoGOOGLE")
245            .field("s_type", &self.s_type)
246            .field("p_next", &self.p_next)
247            .field("swapchain_count", &self.swapchain_count)
248            .field("p_times", &self.p_times)
249            .finish()
250    }
251}
252impl PresentTimesInfoGOOGLE {
253    #[inline]
254    pub fn into_builder<'a>(self) -> PresentTimesInfoGOOGLEBuilder<'a> {
255        PresentTimesInfoGOOGLEBuilder(self, std::marker::PhantomData)
256    }
257}
258#[derive(Copy, Clone)]
259///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPresentTimesInfoGOOGLE.html) · Builder of [`PresentTimesInfoGOOGLE`]
260#[repr(transparent)]
261pub struct PresentTimesInfoGOOGLEBuilder<'a>(
262    PresentTimesInfoGOOGLE,
263    std::marker::PhantomData<&'a ()>,
264);
265impl<'a> PresentTimesInfoGOOGLEBuilder<'a> {
266    #[inline]
267    pub fn new() -> PresentTimesInfoGOOGLEBuilder<'a> {
268        PresentTimesInfoGOOGLEBuilder(Default::default(), std::marker::PhantomData)
269    }
270    #[inline]
271    #[must_use]
272    pub fn times(
273        mut self,
274        times: &'a [crate::extensions::google_display_timing::PresentTimeGOOGLEBuilder],
275    ) -> Self {
276        self.0.p_times = times.as_ptr() as _;
277        self.0.swapchain_count = times.len() as _;
278        self
279    }
280    #[inline]
281    /// Discards all lifetime information.
282    /// Use the `Deref` and `DerefMut` implementations if possible.
283    pub fn build_dangling(self) -> PresentTimesInfoGOOGLE {
284        self.0
285    }
286}
287impl<'a> std::default::Default for PresentTimesInfoGOOGLEBuilder<'a> {
288    fn default() -> PresentTimesInfoGOOGLEBuilder<'a> {
289        Self::new()
290    }
291}
292impl<'a> std::fmt::Debug for PresentTimesInfoGOOGLEBuilder<'a> {
293    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
294        std::fmt::Debug::fmt(&self.0, f)
295    }
296}
297impl<'a> std::ops::Deref for PresentTimesInfoGOOGLEBuilder<'a> {
298    type Target = PresentTimesInfoGOOGLE;
299    fn deref(&self) -> &Self::Target {
300        &self.0
301    }
302}
303impl<'a> std::ops::DerefMut for PresentTimesInfoGOOGLEBuilder<'a> {
304    fn deref_mut(&mut self) -> &mut Self::Target {
305        &mut self.0
306    }
307}
308///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPresentTimeGOOGLE.html) · Structure
309#[doc(alias = "VkPresentTimeGOOGLE")]
310#[derive(Copy, Clone, Hash, PartialEq, Eq)]
311#[repr(C)]
312pub struct PresentTimeGOOGLE {
313    pub present_id: u32,
314    pub desired_present_time: u64,
315}
316impl Default for PresentTimeGOOGLE {
317    fn default() -> Self {
318        Self {
319            present_id: Default::default(),
320            desired_present_time: Default::default(),
321        }
322    }
323}
324impl std::fmt::Debug for PresentTimeGOOGLE {
325    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
326        f.debug_struct("PresentTimeGOOGLE")
327            .field("present_id", &self.present_id)
328            .field("desired_present_time", &self.desired_present_time)
329            .finish()
330    }
331}
332impl PresentTimeGOOGLE {
333    #[inline]
334    pub fn into_builder<'a>(self) -> PresentTimeGOOGLEBuilder<'a> {
335        PresentTimeGOOGLEBuilder(self, std::marker::PhantomData)
336    }
337}
338#[derive(Copy, Clone)]
339///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPresentTimeGOOGLE.html) · Builder of [`PresentTimeGOOGLE`]
340#[repr(transparent)]
341pub struct PresentTimeGOOGLEBuilder<'a>(
342    PresentTimeGOOGLE,
343    std::marker::PhantomData<&'a ()>,
344);
345impl<'a> PresentTimeGOOGLEBuilder<'a> {
346    #[inline]
347    pub fn new() -> PresentTimeGOOGLEBuilder<'a> {
348        PresentTimeGOOGLEBuilder(Default::default(), std::marker::PhantomData)
349    }
350    #[inline]
351    #[must_use]
352    pub fn present_id(mut self, present_id: u32) -> Self {
353        self.0.present_id = present_id as _;
354        self
355    }
356    #[inline]
357    #[must_use]
358    pub fn desired_present_time(mut self, desired_present_time: u64) -> Self {
359        self.0.desired_present_time = desired_present_time as _;
360        self
361    }
362    #[inline]
363    pub fn build(self) -> PresentTimeGOOGLE {
364        self.0
365    }
366}
367impl<'a> std::default::Default for PresentTimeGOOGLEBuilder<'a> {
368    fn default() -> PresentTimeGOOGLEBuilder<'a> {
369        Self::new()
370    }
371}
372impl<'a> std::fmt::Debug for PresentTimeGOOGLEBuilder<'a> {
373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
374        std::fmt::Debug::fmt(&self.0, f)
375    }
376}
377impl<'a> std::ops::Deref for PresentTimeGOOGLEBuilder<'a> {
378    type Target = PresentTimeGOOGLE;
379    fn deref(&self) -> &Self::Target {
380        &self.0
381    }
382}
383impl<'a> std::ops::DerefMut for PresentTimeGOOGLEBuilder<'a> {
384    fn deref_mut(&mut self) -> &mut Self::Target {
385        &mut self.0
386    }
387}
388///Provided by [`crate::extensions::google_display_timing`]
389impl crate::DeviceLoader {
390    #[inline]
391    #[track_caller]
392    ///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRefreshCycleDurationGOOGLE.html) · Function
393    #[doc(alias = "vkGetRefreshCycleDurationGOOGLE")]
394    pub unsafe fn get_refresh_cycle_duration_google(
395        &self,
396        swapchain: crate::extensions::khr_swapchain::SwapchainKHR,
397    ) -> crate::utils::VulkanResult<
398            crate::extensions::google_display_timing::RefreshCycleDurationGOOGLE,
399        > {
400        let _function = self
401            .get_refresh_cycle_duration_google
402            .expect(crate::NOT_LOADED_MESSAGE);
403        let mut display_timing_properties = Default::default();
404        let _return = _function(
405            self.handle,
406            swapchain as _,
407            &mut display_timing_properties,
408        );
409        crate::utils::VulkanResult::new(_return, display_timing_properties)
410    }
411    #[inline]
412    #[track_caller]
413    ///[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPastPresentationTimingGOOGLE.html) · Function
414    #[doc(alias = "vkGetPastPresentationTimingGOOGLE")]
415    pub unsafe fn get_past_presentation_timing_google(
416        &self,
417        swapchain: crate::extensions::khr_swapchain::SwapchainKHR,
418        presentation_timing_count: Option<u32>,
419    ) -> crate::utils::VulkanResult<
420            crate::SmallVec<
421                crate::extensions::google_display_timing::PastPresentationTimingGOOGLE,
422            >,
423        > {
424        let _function = self
425            .get_past_presentation_timing_google
426            .expect(crate::NOT_LOADED_MESSAGE);
427        let mut presentation_timing_count = match presentation_timing_count {
428            Some(v) => v,
429            None => {
430                let mut v = Default::default();
431                _function(self.handle, swapchain as _, &mut v, std::ptr::null_mut());
432                v
433            }
434        };
435        let mut presentation_timings = crate::SmallVec::from_elem(
436            Default::default(),
437            presentation_timing_count as _,
438        );
439        let _return = _function(
440            self.handle,
441            swapchain as _,
442            &mut presentation_timing_count,
443            presentation_timings.as_mut_ptr(),
444        );
445        crate::utils::VulkanResult::new(_return, presentation_timings)
446    }
447}