Skip to content

Commit

Permalink
extensions/ext: Add VK_EXT_device_generated_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Sep 26, 2024
1 parent 020ef0c commit d9abf35
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;

impl crate::ext::device_generated_commands::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetGeneratedCommandsMemoryRequirementsEXT.html>
#[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,
)
}

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

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

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateIndirectCommandsLayoutEXT.html>
#[inline]
#[doc(alias = "vkCreateIndirectCommandsLayoutEXT")]
pub unsafe fn create_indirect_commands_layout(
&self,
create_info: &vk::IndirectCommandsLayoutCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::IndirectCommandsLayoutEXT> {
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)
}

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

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateIndirectExecutionSetEXT.html>
#[inline]
#[doc(alias = "vkCreateIndirectExecutionSetEXT")]
pub unsafe fn create_indirect_execution_set(
&self,
create_info: &vk::IndirectExecutionSetCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::IndirectExecutionSetEXT> {
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)
}

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

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

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkUpdateIndirectExecutionSetShaderEXT.html>
#[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(),
)
}
}
1 change: 1 addition & 0 deletions ash/src/extensions/ext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d9abf35

Please sign in to comment.