From 9900d1a48f187da75a8829034631728a431fc5ce Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 24 Mar 2024 21:23:24 +0100 Subject: [PATCH] extensions/khr: Add VK_KHR_maintenance6 --- Changelog.md | 1 + ash/src/extensions/khr/maintenance6.rs | 94 +++++++++++++++++++++++ ash/src/extensions/khr/mod.rs | 1 + ash/src/extensions/khr/push_descriptor.rs | 4 +- 4 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 ash/src/extensions/khr/maintenance6.rs diff --git a/Changelog.md b/Changelog.md index b7f34a902..1fd2ff40d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `VK_KHR_dynamic_rendering_local_read` device extension (#888) - Added `VK_KHR_line_rasterization` device extension (#889) - Added `VK_KHR_calibrated_timestamps` device extension (#890) +- Added `VK_KHR_maintenance6` device extension (#891) ### Changed diff --git a/ash/src/extensions/khr/maintenance6.rs b/ash/src/extensions/khr/maintenance6.rs new file mode 100644 index 000000000..f7e3a4cba --- /dev/null +++ b/ash/src/extensions/khr/maintenance6.rs @@ -0,0 +1,94 @@ +//! + +use crate::vk; +use core::mem; +pub use vk::khr::maintenance6::NAME; + +#[derive(Clone)] +pub struct Device { + fp: vk::khr::maintenance6::DeviceFn, +} + +impl Device { + pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self { + let handle = device.handle(); + let fp = vk::khr::maintenance6::DeviceFn::load(|name| unsafe { + mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr())) + }); + Self { fp } + } + + /// + #[inline] + pub unsafe fn cmd_bind_descriptor_sets2( + &self, + command_buffer: vk::CommandBuffer, + bind_descriptor_sets_info: &vk::BindDescriptorSetsInfoKHR<'_>, + ) { + (self.fp.cmd_bind_descriptor_sets2_khr)(command_buffer, bind_descriptor_sets_info) + } + + /// + #[inline] + pub unsafe fn cmd_push_constants2( + &self, + command_buffer: vk::CommandBuffer, + push_constants_info: &vk::PushConstantsInfoKHR<'_>, + ) { + (self.fp.cmd_push_constants2_khr)(command_buffer, push_constants_info) + } + + /// + #[inline] + pub unsafe fn cmd_push_descriptor_set2( + &self, + command_buffer: vk::CommandBuffer, + push_descriptor_set_info: &vk::PushDescriptorSetInfoKHR<'_>, + ) { + (self.fp.cmd_push_descriptor_set2_khr)(command_buffer, push_descriptor_set_info) + } + + /// + #[inline] + pub unsafe fn cmd_push_descriptor_set_with_template2( + &self, + command_buffer: vk::CommandBuffer, + push_descriptor_set_with_template_info: &vk::PushDescriptorSetWithTemplateInfoKHR<'_>, + ) { + (self.fp.cmd_push_descriptor_set_with_template2_khr)( + command_buffer, + push_descriptor_set_with_template_info, + ) + } + + /// + #[inline] + pub unsafe fn cmd_set_descriptor_buffer_offsets2( + &self, + command_buffer: vk::CommandBuffer, + set_descriptor_buffer_offsets_info: &vk::SetDescriptorBufferOffsetsInfoEXT<'_>, + ) { + (self.fp.cmd_set_descriptor_buffer_offsets2_ext)( + command_buffer, + set_descriptor_buffer_offsets_info, + ) + } + + /// + #[inline] + pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers2( + &self, + command_buffer: vk::CommandBuffer, + bind_descriptor_buffer_embedded_samplers_info: &vk::BindDescriptorBufferEmbeddedSamplersInfoEXT<'_>, + ) { + (self.fp.cmd_bind_descriptor_buffer_embedded_samplers2_ext)( + command_buffer, + bind_descriptor_buffer_embedded_samplers_info, + ) + } + + #[inline] + pub fn fp(&self) -> &vk::khr::maintenance6::DeviceFn { + &self.fp + } +} diff --git a/ash/src/extensions/khr/mod.rs b/ash/src/extensions/khr/mod.rs index d2e064b77..66f26c39f 100644 --- a/ash/src/extensions/khr/mod.rs +++ b/ash/src/extensions/khr/mod.rs @@ -26,6 +26,7 @@ pub mod maintenance1; pub mod maintenance3; pub mod maintenance4; pub mod maintenance5; +pub mod maintenance6; pub mod performance_query; pub mod pipeline_executable_properties; pub mod present_wait; diff --git a/ash/src/extensions/khr/push_descriptor.rs b/ash/src/extensions/khr/push_descriptor.rs index 3dfd73e5e..9ea70974a 100644 --- a/ash/src/extensions/khr/push_descriptor.rs +++ b/ash/src/extensions/khr/push_descriptor.rs @@ -36,7 +36,7 @@ impl Device { set, descriptor_writes.len() as u32, descriptor_writes.as_ptr(), - ); + ) } /// @@ -55,7 +55,7 @@ impl Device { layout, set, p_data, - ); + ) } #[inline]