Debian Codegraph @

third_party/rust/ash/src/extensions/nv/coverage_reduction_mode.rs

raw
1 //! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_coverage_reduction_mode.html>
2
3 use crate::prelude::*;
4 use crate::vk;
5 use core::mem;
6 use core::ptr;
7
8 impl crate::nv::coverage_reduction_mode::Instance {
9 /// Retrieve the number of elements to pass to [`get_physical_device_supported_framebuffer_mixed_samples_combinations()`][Self::get_physical_device_supported_framebuffer_mixed_samples_combinations()]
10 #[inline]
11 pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations_len(
12 &self,
13 physical_device: vk::PhysicalDevice,
14 ) -> VkResult<usize> {
15 let mut count = mem::MaybeUninit::uninit();
16 (self
17 .fp
18 .get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)(
19 physical_device,
20 count.as_mut_ptr(),
21 ptr::null_mut(),
22 )
23 .assume_init_on_success(count)
24 .map(|c| c as usize)
25 }
26
27 /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV.html>
28 ///
29 /// Call [`get_physical_device_supported_framebuffer_mixed_samples_combinations_len()`][Self::get_physical_device_supported_framebuffer_mixed_samples_combinations_len()] to query the number of elements to pass to `out`.
30 /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
31 #[inline]
32 pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations(
33 &self,
34 physical_device: vk::PhysicalDevice,
35 out: &mut [vk::FramebufferMixedSamplesCombinationNV<'_>],
36 ) -> VkResult<()> {
37 let mut count = out.len() as u32;
38 (self
39 .fp
40 .get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)(
41 physical_device,
42 &mut count,
43 out.as_mut_ptr(),
44 )
45 .result()?;
46 assert_eq!(count as usize, out.len());
47 Ok(())
48 }
49 }