Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extensions/ext: Add VK_EXT_device_generated_commands #946

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update Vulkan-Headers to 1.3.296 (#910)
- 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