ash/extensions/ext/
extended_dynamic_state.rs

1//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state.html>
2
3use crate::vk;
4use core::ptr;
5
6impl crate::ext::extended_dynamic_state::Device {
7    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullModeEXT.html>
8    #[inline]
9    pub unsafe fn cmd_set_cull_mode(
10        &self,
11        command_buffer: vk::CommandBuffer,
12        cull_mode: vk::CullModeFlags,
13    ) {
14        (self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
15    }
16
17    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
18    #[inline]
19    pub unsafe fn cmd_set_front_face(
20        &self,
21        command_buffer: vk::CommandBuffer,
22        front_face: vk::FrontFace,
23    ) {
24        (self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
25    }
26
27    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
28    #[inline]
29    pub unsafe fn cmd_set_primitive_topology(
30        &self,
31        command_buffer: vk::CommandBuffer,
32        primitive_topology: vk::PrimitiveTopology,
33    ) {
34        (self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
35    }
36
37    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
38    #[inline]
39    pub unsafe fn cmd_set_viewport_with_count(
40        &self,
41        command_buffer: vk::CommandBuffer,
42        viewports: &[vk::Viewport],
43    ) {
44        (self.fp.cmd_set_viewport_with_count_ext)(
45            command_buffer,
46            viewports.len() as u32,
47            viewports.as_ptr(),
48        )
49    }
50
51    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCountEXT.html>
52    #[inline]
53    pub unsafe fn cmd_set_scissor_with_count(
54        &self,
55        command_buffer: vk::CommandBuffer,
56        scissors: &[vk::Rect2D],
57    ) {
58        (self.fp.cmd_set_scissor_with_count_ext)(
59            command_buffer,
60            scissors.len() as u32,
61            scissors.as_ptr(),
62        )
63    }
64
65    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>
66    #[inline]
67    pub unsafe fn cmd_bind_vertex_buffers2(
68        &self,
69        command_buffer: vk::CommandBuffer,
70        first_binding: u32,
71        buffers: &[vk::Buffer],
72        offsets: &[vk::DeviceSize],
73        sizes: Option<&[vk::DeviceSize]>,
74        strides: Option<&[vk::DeviceSize]>,
75    ) {
76        assert_eq!(offsets.len(), buffers.len());
77        let p_sizes = if let Some(sizes) = sizes {
78            assert_eq!(sizes.len(), buffers.len());
79            sizes.as_ptr()
80        } else {
81            ptr::null()
82        };
83        let p_strides = if let Some(strides) = strides {
84            assert_eq!(strides.len(), buffers.len());
85            strides.as_ptr()
86        } else {
87            ptr::null()
88        };
89        (self.fp.cmd_bind_vertex_buffers2_ext)(
90            command_buffer,
91            first_binding,
92            buffers.len() as u32,
93            buffers.as_ptr(),
94            offsets.as_ptr(),
95            p_sizes,
96            p_strides,
97        )
98    }
99
100    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>
101    #[inline]
102    pub unsafe fn cmd_set_depth_test_enable(
103        &self,
104        command_buffer: vk::CommandBuffer,
105        depth_test_enable: bool,
106    ) {
107        (self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
108    }
109
110    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
111    #[inline]
112    pub unsafe fn cmd_set_depth_write_enable(
113        &self,
114        command_buffer: vk::CommandBuffer,
115        depth_write_enable: bool,
116    ) {
117        (self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
118    }
119
120    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
121    #[inline]
122    pub unsafe fn cmd_set_depth_compare_op(
123        &self,
124        command_buffer: vk::CommandBuffer,
125        depth_compare_op: vk::CompareOp,
126    ) {
127        (self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
128    }
129
130    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
131    #[inline]
132    pub unsafe fn cmd_set_depth_bounds_test_enable(
133        &self,
134        command_buffer: vk::CommandBuffer,
135        depth_bounds_test_enable: bool,
136    ) {
137        (self.fp.cmd_set_depth_bounds_test_enable_ext)(
138            command_buffer,
139            depth_bounds_test_enable.into(),
140        )
141    }
142
143    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
144    #[inline]
145    pub unsafe fn cmd_set_stencil_test_enable(
146        &self,
147        command_buffer: vk::CommandBuffer,
148        stencil_test_enable: bool,
149    ) {
150        (self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
151    }
152
153    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
154    #[inline]
155    pub unsafe fn cmd_set_stencil_op(
156        &self,
157        command_buffer: vk::CommandBuffer,
158        face_mask: vk::StencilFaceFlags,
159        fail_op: vk::StencilOp,
160        pass_op: vk::StencilOp,
161        depth_fail_op: vk::StencilOp,
162        compare_op: vk::CompareOp,
163    ) {
164        (self.fp.cmd_set_stencil_op_ext)(
165            command_buffer,
166            face_mask,
167            fail_op,
168            pass_op,
169            depth_fail_op,
170            compare_op,
171        )
172    }
173}