ash/extensions/khr/
maintenance3.rs

1use crate::vk;
2use crate::{Device, Instance};
3use std::ffi::CStr;
4use std::mem;
5
6#[derive(Clone)]
7pub struct Maintenance3 {
8    handle: vk::Device,
9    fp: vk::KhrMaintenance3Fn,
10}
11
12impl Maintenance3 {
13    pub fn new(instance: &Instance, device: &Device) -> Self {
14        let handle = device.handle();
15        let fp = vk::KhrMaintenance3Fn::load(|name| unsafe {
16            mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
17        });
18        Self { handle, fp }
19    }
20
21    /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>
22    #[inline]
23    pub unsafe fn get_descriptor_set_layout_support(
24        &self,
25        create_info: &vk::DescriptorSetLayoutCreateInfo,
26        out: &mut vk::DescriptorSetLayoutSupportKHR,
27    ) {
28        (self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
29    }
30
31    #[inline]
32    pub const fn name() -> &'static CStr {
33        vk::KhrMaintenance3Fn::name()
34    }
35
36    #[inline]
37    pub fn fp(&self) -> &vk::KhrMaintenance3Fn {
38        &self.fp
39    }
40
41    #[inline]
42    pub fn device(&self) -> vk::Device {
43        self.handle
44    }
45}