diff --git a/Changelog.md b/Changelog.md index 69ec27626..93fa360b6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added `VK_EXT_metal_objects` device extension (#942) +- Added `VK_EXT_device_generated_commands` device extension (#946) ## [0.38.0] - 2024-04-01 diff --git a/ash/src/extensions/ext/device_generated_commands.rs b/ash/src/extensions/ext/device_generated_commands.rs new file mode 100644 index 000000000..27075c2bd --- /dev/null +++ b/ash/src/extensions/ext/device_generated_commands.rs @@ -0,0 +1,153 @@ +//! + +use crate::prelude::*; +use crate::vk; +use crate::RawPtr; +use core::mem; + +impl crate::ext::device_generated_commands::Device { + /// + #[inline] + #[doc(alias = "vkGetGeneratedCommandsMemoryRequirementsEXT")] + pub unsafe fn get_generated_commands_memory_requirements( + &self, + info: &vk::GeneratedCommandsMemoryRequirementsInfoEXT<'_>, + memory_requirements: &mut vk::MemoryRequirements2<'_>, + ) { + (self.fp.get_generated_commands_memory_requirements_ext)( + self.handle, + info, + memory_requirements, + ) + } + + /// + #[inline] + #[doc(alias = "vkCmdPreprocessGeneratedCommandsEXT")] + pub unsafe fn cmd_preprocess_generated_commands( + &self, + command_buffer: vk::CommandBuffer, + generated_commands_info: &vk::GeneratedCommandsInfoEXT<'_>, + state_command_buffer: vk::CommandBuffer, + ) { + (self.fp.cmd_preprocess_generated_commands_ext)( + command_buffer, + generated_commands_info, + state_command_buffer, + ) + } + + /// + #[inline] + #[doc(alias = "vkCmdExecuteGeneratedCommandsEXT")] + pub unsafe fn cmd_execute_generated_commands( + &self, + command_buffer: vk::CommandBuffer, + is_preprocessed: bool, + generated_commands_info: &vk::GeneratedCommandsInfoEXT<'_>, + ) { + (self.fp.cmd_execute_generated_commands_ext)( + command_buffer, + is_preprocessed.into(), + generated_commands_info, + ) + } + + /// + #[inline] + #[doc(alias = "vkCreateIndirectCommandsLayoutEXT")] + pub unsafe fn create_indirect_commands_layout( + &self, + create_info: &vk::IndirectCommandsLayoutCreateInfoEXT<'_>, + allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, + ) -> VkResult { + let mut indirect_commands_layout = mem::MaybeUninit::uninit(); + (self.fp.create_indirect_commands_layout_ext)( + self.handle, + create_info, + allocation_callbacks.as_raw_ptr(), + indirect_commands_layout.as_mut_ptr(), + ) + .assume_init_on_success(indirect_commands_layout) + } + + /// + #[inline] + #[doc(alias = "vkDestroyIndirectCommandsLayoutEXT")] + pub unsafe fn destroy_indirect_commands_layout( + &self, + indirect_commands_layout: vk::IndirectCommandsLayoutEXT, + allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, + ) { + (self.fp.destroy_indirect_commands_layout_ext)( + self.handle, + indirect_commands_layout, + allocation_callbacks.as_raw_ptr(), + ) + } + + /// + #[inline] + #[doc(alias = "vkCreateIndirectExecutionSetEXT")] + pub unsafe fn create_indirect_execution_set( + &self, + create_info: &vk::IndirectExecutionSetCreateInfoEXT<'_>, + allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, + ) -> VkResult { + let mut indirect_execution_set = mem::MaybeUninit::uninit(); + (self.fp.create_indirect_execution_set_ext)( + self.handle, + create_info, + allocation_callbacks.as_raw_ptr(), + indirect_execution_set.as_mut_ptr(), + ) + .assume_init_on_success(indirect_execution_set) + } + + /// + #[inline] + #[doc(alias = "vkDestroyIndirectExecutionSetEXT")] + pub unsafe fn destroy_indirect_execution_set( + &self, + indirect_execution_set: vk::IndirectExecutionSetEXT, + allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, + ) { + (self.fp.destroy_indirect_execution_set_ext)( + self.handle, + indirect_execution_set, + allocation_callbacks.as_raw_ptr(), + ) + } + + /// + #[inline] + #[doc(alias = "vkUpdateIndirectExecutionSetPipelineEXT")] + pub unsafe fn update_indirect_execution_set_pipeline( + &self, + indirect_execution_set: vk::IndirectExecutionSetEXT, + execution_set_writes: &[vk::WriteIndirectExecutionSetPipelineEXT<'_>], + ) { + (self.fp.update_indirect_execution_set_pipeline_ext)( + self.handle, + indirect_execution_set, + execution_set_writes.len() as u32, + execution_set_writes.as_ptr(), + ) + } + + /// + #[inline] + #[doc(alias = "vkUpdateIndirectExecutionSetShaderEXT")] + pub unsafe fn update_indirect_execution_set_shader( + &self, + indirect_execution_set: vk::IndirectExecutionSetEXT, + execution_set_writes: &[vk::WriteIndirectExecutionSetShaderEXT<'_>], + ) { + (self.fp.update_indirect_execution_set_shader_ext)( + self.handle, + indirect_execution_set, + execution_set_writes.len() as u32, + execution_set_writes.as_ptr(), + ) + } +} diff --git a/ash/src/extensions/ext/mod.rs b/ash/src/extensions/ext/mod.rs index 3f923b227..75d64b59c 100644 --- a/ash/src/extensions/ext/mod.rs +++ b/ash/src/extensions/ext/mod.rs @@ -7,6 +7,7 @@ pub mod debug_marker; pub mod debug_report; pub mod debug_utils; pub mod descriptor_buffer; +pub mod device_generated_commands; pub mod extended_dynamic_state; pub mod extended_dynamic_state2; pub mod extended_dynamic_state3;