1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
// generated file, do not modify manually
#![allow(unused_qualifications)]
#![allow(mismatched_lifetime_syntaxes)]
use crate::sys;
use crate::sys::ffi::*;
use crate::vk::*;
use crate::vk;
use crate::{Abi, Vk, Sys};
/// `VK_EXT_extended_dynamic_state` DeviceCommands
#[derive(Debug, Clone, Copy)]
pub struct Device(pub sys::ext::extended_dynamic_state::DeviceCommands);
impl Device {
pub fn load(get: impl FnMut(&::core::ffi::CStr) -> Option<crate::ProcAddr>) -> Self {
Self(unsafe { sys::ext::extended_dynamic_state::DeviceCommands::load(get) })
}
}
impl Device {
/// ```c
/// void vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, VkBuffer const* pBuffers, VkDeviceSize const* pOffsets, VkDeviceSize const* pSizes, VkDeviceSize const* pStrides)
/// ```
pub unsafe fn cmd_bind_vertex_buffers2(
&self,
command_buffer: vk::CommandBuffer,
first_binding: uint32_t,
buffers: &[Option<vk::Buffer>],
offsets: &[DeviceSize],
sizes: Option<&[DeviceSize]>,
strides: Option<&[DeviceSize]>,
) -> () {
unsafe {
self.0.CmdBindVertexBuffers2EXT(
command_buffer.abi(),
first_binding.abi(),
buffers.len() as _,
buffers.abi(),
offsets.abi(),
sizes.abi(),
strides.abi(),
);
}
}
/// ```c
/// void vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode)
/// ```
pub unsafe fn cmd_set_cull_mode(
&self,
command_buffer: vk::CommandBuffer,
cull_mode: CullModeFlags,
) -> () {
unsafe {
self.0.CmdSetCullModeEXT(
command_buffer.abi(),
cull_mode.abi(),
);
}
}
/// ```c
/// void vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable)
/// ```
pub unsafe fn cmd_set_depth_bounds_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool,
) -> () {
unsafe {
self.0.CmdSetDepthBoundsTestEnableEXT(
command_buffer.abi(),
depth_bounds_test_enable.abi(),
);
}
}
/// ```c
/// void vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp)
/// ```
pub unsafe fn cmd_set_depth_compare_op(
&self,
command_buffer: vk::CommandBuffer,
depth_compare_op: CompareOp,
) -> () {
unsafe {
self.0.CmdSetDepthCompareOpEXT(
command_buffer.abi(),
depth_compare_op.abi(),
);
}
}
/// ```c
/// void vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable)
/// ```
pub unsafe fn cmd_set_depth_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_test_enable: bool,
) -> () {
unsafe {
self.0.CmdSetDepthTestEnableEXT(
command_buffer.abi(),
depth_test_enable.abi(),
);
}
}
/// ```c
/// void vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable)
/// ```
pub unsafe fn cmd_set_depth_write_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_write_enable: bool,
) -> () {
unsafe {
self.0.CmdSetDepthWriteEnableEXT(
command_buffer.abi(),
depth_write_enable.abi(),
);
}
}
/// ```c
/// void vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace)
/// ```
pub unsafe fn cmd_set_front_face(
&self,
command_buffer: vk::CommandBuffer,
front_face: FrontFace,
) -> () {
unsafe {
self.0.CmdSetFrontFaceEXT(
command_buffer.abi(),
front_face.abi(),
);
}
}
/// ```c
/// void vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology)
/// ```
pub unsafe fn cmd_set_primitive_topology(
&self,
command_buffer: vk::CommandBuffer,
primitive_topology: PrimitiveTopology,
) -> () {
unsafe {
self.0.CmdSetPrimitiveTopologyEXT(
command_buffer.abi(),
primitive_topology.abi(),
);
}
}
/// ```c
/// void vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, VkRect2D const* pScissors)
/// ```
pub unsafe fn cmd_set_scissor_with_count(
&self,
command_buffer: vk::CommandBuffer,
scissors: &[Rect2D],
) -> () {
unsafe {
self.0.CmdSetScissorWithCountEXT(
command_buffer.abi(),
scissors.len() as _,
scissors.abi(),
);
}
}
/// ```c
/// void vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp)
/// ```
pub unsafe fn cmd_set_stencil_op(
&self,
command_buffer: vk::CommandBuffer,
face_mask: StencilFaceFlags,
fail_op: StencilOp,
pass_op: StencilOp,
depth_fail_op: StencilOp,
compare_op: CompareOp,
) -> () {
unsafe {
self.0.CmdSetStencilOpEXT(
command_buffer.abi(),
face_mask.abi(),
fail_op.abi(),
pass_op.abi(),
depth_fail_op.abi(),
compare_op.abi(),
);
}
}
/// ```c
/// void vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable)
/// ```
pub unsafe fn cmd_set_stencil_test_enable(
&self,
command_buffer: vk::CommandBuffer,
stencil_test_enable: bool,
) -> () {
unsafe {
self.0.CmdSetStencilTestEnableEXT(
command_buffer.abi(),
stencil_test_enable.abi(),
);
}
}
/// ```c
/// void vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, VkViewport const* pViewports)
/// ```
pub unsafe fn cmd_set_viewport_with_count(
&self,
command_buffer: vk::CommandBuffer,
viewports: &[Viewport],
) -> () {
unsafe {
self.0.CmdSetViewportWithCountEXT(
command_buffer.abi(),
viewports.len() as _,
viewports.abi(),
);
}
}
}
impl crate::CommandScope<vk::Device> for vk::extensions::ext::extended_dynamic_state {
type Commands = Device;
}
/// Device object
pub trait ExtExtendedDynamicStateDevice {
fn raw(&self) -> vk::Device;
fn commands(&self) -> &Device;
}
impl crate::HndScope<vk::Device> for vk::extensions::ext::extended_dynamic_state {
type Impl = _hs_Device::Device;
}
mod _hs_Device {
use super::*;
#[derive(Debug)]
pub struct Device(pub(crate) ::alloc::sync::Arc<super::Device>, pub(crate) crate::hnd::Device<vk::core>);
impl Clone for Device {
fn clone(&self) -> Self { Self(self.0.clone(), self.1.clone()) }
}
impl crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
pub unsafe fn new(base: &crate::hnd::Device<vk::core>) -> Self {
unsafe {
Self(Device(
::alloc::sync::Arc::new(super::Device::load(|name| unsafe { base.get_proc_addr(name) })),
base.clone(),
))
}
}
}
impl crate::Extension<crate::hnd::Device<vk::core>> for vk::extensions::ext::extended_dynamic_state {
type Output = crate::hnd::Device<vk::extensions::ext::extended_dynamic_state>;
unsafe fn make(target: &crate::hnd::Device<vk::core>) -> Self::Output {
unsafe { crate::hnd::Device::<vk::extensions::ext::extended_dynamic_state>::new(target) }
}
}
impl crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
pub fn raw(&self) -> vk::Device { self.0.1.raw() }
pub fn commands(&self) -> &::alloc::sync::Arc<super::Device> { &self.0.0 }
pub fn core(&self) -> &crate::hnd::Device<vk::core> { &self.0.1 }
}
impl ::core::fmt::Debug for crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.write_fmt(format_args!("Device({:p})", self.raw()))
}
}
impl ::core::fmt::Pointer for crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.raw().fmt(f)
}
}
impl ::core::ops::Deref for crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
type Target = super::Device;
fn deref(&self) -> &Self::Target { self.commands() }
}
impl super::ExtExtendedDynamicStateDevice for crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
fn raw(&self) -> vk::Device { self.raw() }
fn commands(&self) -> &super::Device { self.commands() }
}
impl crate::HndCtx<vk::extensions::ext::extended_dynamic_state, vk::Device> for crate::hnd::Device<vk::extensions::ext::extended_dynamic_state> {
type Ctx = Self;
fn ctx(&self) -> Self::Ctx { self.clone() }
fn raw(&self) -> vk::Device { self.raw() }
fn commands(&self) -> &::alloc::sync::Arc<super::Device> { self.commands() }
}
}
/// CommandBuffer object
pub trait ExtExtendedDynamicStateCommandBuffer {
fn raw(&self) -> vk::CommandBuffer;
fn commands(&self) -> &Device;
/// ```c
/// void vkCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, VkBuffer const* pBuffers, VkDeviceSize const* pOffsets, VkDeviceSize const* pSizes, VkDeviceSize const* pStrides)
/// ```
unsafe fn bind_vertex_buffers2(
&self,
first_binding: uint32_t,
buffers: &[Option<vk::Buffer>],
offsets: &[DeviceSize],
sizes: Option<&[DeviceSize]>,
strides: Option<&[DeviceSize]>,
) -> () {
unsafe {
self.commands().cmd_bind_vertex_buffers2(
self.raw(),
first_binding,
buffers,
offsets,
sizes,
strides,
)
}
}
/// ```c
/// void vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode)
/// ```
unsafe fn set_cull_mode(
&self,
cull_mode: CullModeFlags,
) -> () {
unsafe {
self.commands().cmd_set_cull_mode(
self.raw(),
cull_mode,
)
}
}
/// ```c
/// void vkCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable)
/// ```
unsafe fn set_depth_bounds_test_enable(
&self,
depth_bounds_test_enable: bool,
) -> () {
unsafe {
self.commands().cmd_set_depth_bounds_test_enable(
self.raw(),
depth_bounds_test_enable,
)
}
}
/// ```c
/// void vkCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp)
/// ```
unsafe fn set_depth_compare_op(
&self,
depth_compare_op: CompareOp,
) -> () {
unsafe {
self.commands().cmd_set_depth_compare_op(
self.raw(),
depth_compare_op,
)
}
}
/// ```c
/// void vkCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable)
/// ```
unsafe fn set_depth_test_enable(
&self,
depth_test_enable: bool,
) -> () {
unsafe {
self.commands().cmd_set_depth_test_enable(
self.raw(),
depth_test_enable,
)
}
}
/// ```c
/// void vkCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable)
/// ```
unsafe fn set_depth_write_enable(
&self,
depth_write_enable: bool,
) -> () {
unsafe {
self.commands().cmd_set_depth_write_enable(
self.raw(),
depth_write_enable,
)
}
}
/// ```c
/// void vkCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace)
/// ```
unsafe fn set_front_face(
&self,
front_face: FrontFace,
) -> () {
unsafe {
self.commands().cmd_set_front_face(
self.raw(),
front_face,
)
}
}
/// ```c
/// void vkCmdSetPrimitiveTopology(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology)
/// ```
unsafe fn set_primitive_topology(
&self,
primitive_topology: PrimitiveTopology,
) -> () {
unsafe {
self.commands().cmd_set_primitive_topology(
self.raw(),
primitive_topology,
)
}
}
/// ```c
/// void vkCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, VkRect2D const* pScissors)
/// ```
unsafe fn set_scissor_with_count(
&self,
scissors: &[Rect2D],
) -> () {
unsafe {
self.commands().cmd_set_scissor_with_count(
self.raw(),
scissors,
)
}
}
/// ```c
/// void vkCmdSetStencilOp(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp)
/// ```
unsafe fn set_stencil_op(
&self,
face_mask: StencilFaceFlags,
fail_op: StencilOp,
pass_op: StencilOp,
depth_fail_op: StencilOp,
compare_op: CompareOp,
) -> () {
unsafe {
self.commands().cmd_set_stencil_op(
self.raw(),
face_mask,
fail_op,
pass_op,
depth_fail_op,
compare_op,
)
}
}
/// ```c
/// void vkCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable)
/// ```
unsafe fn set_stencil_test_enable(
&self,
stencil_test_enable: bool,
) -> () {
unsafe {
self.commands().cmd_set_stencil_test_enable(
self.raw(),
stencil_test_enable,
)
}
}
/// ```c
/// void vkCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, VkViewport const* pViewports)
/// ```
unsafe fn set_viewport_with_count(
&self,
viewports: &[Viewport],
) -> () {
unsafe {
self.commands().cmd_set_viewport_with_count(
self.raw(),
viewports,
)
}
}
}