Add VK_KHR_maintenance extensions (#406)
This commit is contained in:
parent
8444db4fb2
commit
a0a1f5d135
45
ash/src/extensions/khr/maintenance1.rs
Normal file
45
ash/src/extensions/khr/maintenance1.rs
Normal file
|
@ -0,0 +1,45 @@
|
|||
#![allow(dead_code)]
|
||||
use crate::version::{DeviceV1_0, InstanceV1_0};
|
||||
use crate::vk;
|
||||
use std::ffi::CStr;
|
||||
use std::mem;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Maintenance1 {
|
||||
handle: vk::Device,
|
||||
fns: vk::KhrMaintenance1Fn,
|
||||
}
|
||||
|
||||
impl Maintenance1 {
|
||||
pub fn new<I: InstanceV1_0, D: DeviceV1_0>(instance: &I, device: &D) -> Maintenance1 {
|
||||
let fns = vk::KhrMaintenance1Fn::load(|name| unsafe {
|
||||
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
|
||||
});
|
||||
Maintenance1 {
|
||||
handle: device.handle(),
|
||||
fns,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name() -> &'static CStr {
|
||||
vk::KhrMaintenance1Fn::name()
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkTrimCommandPoolKHR.html>"]
|
||||
unsafe fn trim_command_pool(
|
||||
&self,
|
||||
command_pool: vk::CommandPool,
|
||||
flags: vk::CommandPoolTrimFlagsKHR,
|
||||
) {
|
||||
self.fns
|
||||
.trim_command_pool_khr(self.handle, command_pool, flags);
|
||||
}
|
||||
|
||||
pub fn fp(&self) -> &vk::KhrMaintenance1Fn {
|
||||
&self.fns
|
||||
}
|
||||
|
||||
pub fn device(&self) -> vk::Device {
|
||||
self.handle
|
||||
}
|
||||
}
|
45
ash/src/extensions/khr/maintenance3.rs
Normal file
45
ash/src/extensions/khr/maintenance3.rs
Normal file
|
@ -0,0 +1,45 @@
|
|||
#![allow(dead_code)]
|
||||
use crate::version::{DeviceV1_0, InstanceV1_0};
|
||||
use crate::vk;
|
||||
use std::ffi::CStr;
|
||||
use std::mem;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Maintenance3 {
|
||||
handle: vk::Device,
|
||||
fns: vk::KhrMaintenance3Fn,
|
||||
}
|
||||
|
||||
impl Maintenance3 {
|
||||
pub fn new<I: InstanceV1_0, D: DeviceV1_0>(instance: &I, device: &D) -> Maintenance3 {
|
||||
let fns = vk::KhrMaintenance3Fn::load(|name| unsafe {
|
||||
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
|
||||
});
|
||||
Maintenance3 {
|
||||
handle: device.handle(),
|
||||
fns,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name() -> &'static CStr {
|
||||
vk::KhrMaintenance3Fn::name()
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>"]
|
||||
unsafe fn get_descriptor_set_layout_support(
|
||||
&self,
|
||||
create_info: &vk::DescriptorSetLayoutCreateInfo,
|
||||
out: &mut vk::DescriptorSetLayoutSupportKHR,
|
||||
) {
|
||||
self.fns
|
||||
.get_descriptor_set_layout_support_khr(self.handle, create_info, out);
|
||||
}
|
||||
|
||||
pub fn fp(&self) -> &vk::KhrMaintenance3Fn {
|
||||
&self.fns
|
||||
}
|
||||
|
||||
pub fn device(&self) -> vk::Device {
|
||||
self.handle
|
||||
}
|
||||
}
|
|
@ -5,6 +5,8 @@ pub use self::display::Display;
|
|||
pub use self::display_swapchain::DisplaySwapchain;
|
||||
pub use self::draw_indirect_count::DrawIndirectCount;
|
||||
pub use self::external_memory_fd::ExternalMemoryFd;
|
||||
pub use self::maintenance1::Maintenance1;
|
||||
pub use self::maintenance3::Maintenance3;
|
||||
pub use self::pipeline_executable_properties::PipelineExecutableProperties;
|
||||
pub use self::push_descriptor::PushDescriptor;
|
||||
pub use self::ray_tracing_pipeline::RayTracingPipeline;
|
||||
|
@ -23,6 +25,8 @@ mod display;
|
|||
mod display_swapchain;
|
||||
mod draw_indirect_count;
|
||||
mod external_memory_fd;
|
||||
mod maintenance1;
|
||||
mod maintenance3;
|
||||
mod pipeline_executable_properties;
|
||||
mod push_descriptor;
|
||||
mod ray_tracing_pipeline;
|
||||
|
|
Loading…
Reference in a new issue