Skip to content

Commit d9abf35

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

File tree

3 files changed

+155
-0
lines changed

3 files changed

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

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)