Skip to content

Commit

Permalink
extensions/khr: Add VK_KHR_maintenance6
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Mar 25, 2024
1 parent 2394fba commit 9900d1a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
94 changes: 94 additions & 0 deletions ash/src/extensions/khr/maintenance6.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance6.html>

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 }
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorSets2KHR.html>
#[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)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushConstants2KHR.html>
#[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)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSet2KHR.html>
#[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)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetWithTemplate2KHR.html>
#[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,
)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDescriptorBufferOffsets2EXT.html>
#[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,
)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.html>
#[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
}
}
1 change: 1 addition & 0 deletions ash/src/extensions/khr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/khr/push_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Device {
set,
descriptor_writes.len() as u32,
descriptor_writes.as_ptr(),
);
)
}

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetWithTemplateKHR.html>
Expand All @@ -55,7 +55,7 @@ impl Device {
layout,
set,
p_data,
);
)
}

#[inline]
Expand Down

0 comments on commit 9900d1a

Please sign in to comment.