Skip to content

Commit dfae05e

Browse files
committed
extensions/ext: Add VK_EXT_device_generated_commands
1 parent 020ef0c commit dfae05e

File tree

3 files changed

+146
-0
lines changed

3 files changed

+146
-0
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Added `VK_EXT_metal_objects` device extension (#942)
13+
- Added `VK_EXT_device_generated_commands` device extension (#946)
1314

1415
## [0.38.0] - 2024-04-01
1516

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_device_generated_commands.html>
2+
3+
use crate::prelude::*;
4+
use crate::vk;
5+
use crate::RawPtr;
6+
use core::mem;
7+
8+
impl crate::ext::device_generated_commands::Device {
9+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetGeneratedCommandsMemoryRequirementsEXT.html>
10+
#[doc(alias = "vkGetGeneratedCommandsMemoryRequirementsEXT")]
11+
pub unsafe fn get_generated_commands_memory_requirements(
12+
&self,
13+
info: &vk::GeneratedCommandsMemoryRequirementsInfoEXT<'_>,
14+
memory_requirements: &mut vk::MemoryRequirements2<'_>,
15+
) {
16+
(self.fp.get_generated_commands_memory_requirements_ext)(
17+
self.handle,
18+
info,
19+
memory_requirements,
20+
)
21+
}
22+
23+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPreprocessGeneratedCommandsEXT.html>
24+
#[doc(alias = "vkCmdPreprocessGeneratedCommandsEXT")]
25+
pub unsafe fn cmd_preprocess_generated_commands(
26+
&self,
27+
command_buffer: vk::CommandBuffer,
28+
generated_commands_info: &vk::GeneratedCommandsInfoEXT<'_>,
29+
state_command_buffer: vk::CommandBuffer,
30+
) {
31+
(self.fp.cmd_preprocess_generated_commands_ext)(
32+
command_buffer,
33+
generated_commands_info,
34+
state_command_buffer,
35+
)
36+
}
37+
38+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdExecuteGeneratedCommandsEXT.html>
39+
#[doc(alias = "vkCmdExecuteGeneratedCommandsEXT")]
40+
pub unsafe fn cmd_execute_generated_commands(
41+
&self,
42+
command_buffer: vk::CommandBuffer,
43+
is_preprocessed: bool,
44+
generated_commands_info: &vk::GeneratedCommandsInfoEXT<'_>,
45+
) {
46+
(self.fp.cmd_execute_generated_commands_ext)(
47+
command_buffer,
48+
is_preprocessed.into(),
49+
generated_commands_info,
50+
)
51+
}
52+
53+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateIndirectCommandsLayoutEXT.html>
54+
#[doc(alias = "vkCreateIndirectCommandsLayoutEXT")]
55+
pub unsafe fn create_indirect_commands_layout(
56+
&self,
57+
create_info: &vk::IndirectCommandsLayoutCreateInfoEXT<'_>,
58+
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
59+
) -> VkResult<vk::IndirectCommandsLayoutEXT> {
60+
let mut indirect_commands_layout = mem::MaybeUninit::uninit();
61+
(self.fp.create_indirect_commands_layout_ext)(
62+
self.handle,
63+
create_info,
64+
allocation_callbacks.as_raw_ptr(),
65+
indirect_commands_layout.as_mut_ptr(),
66+
)
67+
.assume_init_on_success(indirect_commands_layout)
68+
}
69+
70+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyIndirectCommandsLayoutEXT.html>
71+
#[doc(alias = "vkDestroyIndirectCommandsLayoutEXT")]
72+
pub unsafe fn destroy_indirect_commands_layout(
73+
&self,
74+
indirect_commands_layout: vk::IndirectCommandsLayoutEXT,
75+
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
76+
) {
77+
(self.fp.destroy_indirect_commands_layout_ext)(
78+
self.handle,
79+
indirect_commands_layout,
80+
allocation_callbacks.as_raw_ptr(),
81+
)
82+
}
83+
84+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateIndirectExecutionSetEXT.html>
85+
#[doc(alias = "vkCreateIndirectExecutionSetEXT")]
86+
pub unsafe fn create_indirect_execution_set(
87+
&self,
88+
create_info: &vk::IndirectExecutionSetCreateInfoEXT<'_>,
89+
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
90+
) -> VkResult<vk::IndirectExecutionSetEXT> {
91+
let mut indirect_execution_set = mem::MaybeUninit::uninit();
92+
(self.fp.create_indirect_execution_set_ext)(
93+
self.handle,
94+
create_info,
95+
allocation_callbacks.as_raw_ptr(),
96+
indirect_execution_set.as_mut_ptr(),
97+
)
98+
.assume_init_on_success(indirect_execution_set)
99+
}
100+
101+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyIndirectExecutionSetEXT.html>
102+
#[doc(alias = "vkDestroyIndirectExecutionSetEXT")]
103+
pub unsafe fn destroy_indirect_execution_set(
104+
&self,
105+
indirect_execution_set: vk::IndirectExecutionSetEXT,
106+
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
107+
) {
108+
(self.fp.destroy_indirect_execution_set_ext)(
109+
self.handle,
110+
indirect_execution_set,
111+
allocation_callbacks.as_raw_ptr(),
112+
)
113+
}
114+
115+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkUpdateIndirectExecutionSetPipelineEXT.html>
116+
#[doc(alias = "vkUpdateIndirectExecutionSetPipelineEXT")]
117+
pub unsafe fn update_indirect_execution_set_pipeline(
118+
&self,
119+
indirect_execution_set: vk::IndirectExecutionSetEXT,
120+
execution_set_writes: &[vk::WriteIndirectExecutionSetPipelineEXT<'_>],
121+
) {
122+
(self.fp.update_indirect_execution_set_pipeline_ext)(
123+
self.handle,
124+
indirect_execution_set,
125+
execution_set_writes.len() as u32,
126+
execution_set_writes.as_ptr(),
127+
)
128+
}
129+
130+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkUpdateIndirectExecutionSetShaderEXT.html>
131+
#[doc(alias = "vkUpdateIndirectExecutionSetShaderEXT")]
132+
pub unsafe fn update_indirect_execution_set_shader(
133+
&self,
134+
indirect_execution_set: vk::IndirectExecutionSetEXT,
135+
execution_set_writes: &[vk::WriteIndirectExecutionSetShaderEXT<'_>],
136+
) {
137+
(self.fp.update_indirect_execution_set_shader_ext)(
138+
self.handle,
139+
indirect_execution_set,
140+
execution_set_writes.len() as u32,
141+
execution_set_writes.as_ptr(),
142+
)
143+
}
144+
}

ash/src/extensions/ext/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod debug_marker;
77
pub mod debug_report;
88
pub mod debug_utils;
99
pub mod descriptor_buffer;
10+
pub mod device_generated_commands;
1011
pub mod extended_dynamic_state;
1112
pub mod extended_dynamic_state2;
1213
pub mod extended_dynamic_state3;

0 commit comments

Comments
 (0)