1 use crate::vk::aliases::*;
2 use crate::vk::bitflags::*;
3 use crate::vk::constants::*;
4 use crate::vk::enums::*;
5 use crate::vk::native::*;
6 use crate::vk::platform_types::*;
7 use crate::vk::prelude::*;
8 use crate::vk::{ptr_chain_iter, Handle};
9 use std::fmt;
10 use std::os::raw::*;
11 #[deprecated = "This define is deprecated. VK_MAKE_API_VERSION should be used instead."]
12 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_MAKE_VERSION.html>"]
make_version(major: u32, minor: u32, patch: u32) -> u3213 pub const fn make_version(major: u32, minor: u32, patch: u32) -> u32 {
14 ((major) << 22) | ((minor) << 12) | (patch)
15 }
16 #[deprecated = "This define is deprecated. VK_API_VERSION_MAJOR should be used instead."]
17 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_VERSION_MAJOR.html>"]
version_major(version: u32) -> u3218 pub const fn version_major(version: u32) -> u32 {
19 (version) >> 22
20 }
21 #[deprecated = "This define is deprecated. VK_API_VERSION_MINOR should be used instead."]
22 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_VERSION_MINOR.html>"]
version_minor(version: u32) -> u3223 pub const fn version_minor(version: u32) -> u32 {
24 ((version) >> 12) & 0x3ffu32
25 }
26 #[deprecated = "This define is deprecated. VK_API_VERSION_PATCH should be used instead."]
27 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_VERSION_PATCH.html>"]
version_patch(version: u32) -> u3228 pub const fn version_patch(version: u32) -> u32 {
29 (version) & 0xfffu32
30 }
31 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_MAKE_API_VERSION.html>"]
make_api_version(variant: u32, major: u32, minor: u32, patch: u32) -> u3232 pub const fn make_api_version(variant: u32, major: u32, minor: u32, patch: u32) -> u32 {
33 ((variant) << 29) | ((major) << 22) | ((minor) << 12) | (patch)
34 }
35 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_VARIANT.html>"]
api_version_variant(version: u32) -> u3236 pub const fn api_version_variant(version: u32) -> u32 {
37 (version) >> 29
38 }
39 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_MAJOR.html>"]
api_version_major(version: u32) -> u3240 pub const fn api_version_major(version: u32) -> u32 {
41 ((version) >> 22) & 0x7fu32
42 }
43 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_MINOR.html>"]
api_version_minor(version: u32) -> u3244 pub const fn api_version_minor(version: u32) -> u32 {
45 ((version) >> 12) & 0x3ffu32
46 }
47 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_PATCH.html>"]
api_version_patch(version: u32) -> u3248 pub const fn api_version_patch(version: u32) -> u32 {
49 (version) & 0xfffu32
50 }
51 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_1_0.html>"]
52 pub const API_VERSION_1_0: u32 = make_api_version(0, 1, 0, 0);
53 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_1_1.html>"]
54 pub const API_VERSION_1_1: u32 = make_api_version(0, 1, 1, 0);
55 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_API_VERSION_1_2.html>"]
56 pub const API_VERSION_1_2: u32 = make_api_version(0, 1, 2, 0);
57 pub const HEADER_VERSION: u32 = 203u32;
58 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_HEADER_VERSION_COMPLETE.html>"]
59 pub const HEADER_VERSION_COMPLETE: u32 = make_api_version(0, 1, 2, HEADER_VERSION);
60 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampleMask.html>"]
61 pub type SampleMask = u32;
62 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBool32.html>"]
63 pub type Bool32 = u32;
64 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFlags.html>"]
65 pub type Flags = u32;
66 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFlags64.html>"]
67 pub type Flags64 = u64;
68 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceSize.html>"]
69 pub type DeviceSize = u64;
70 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceAddress.html>"]
71 pub type DeviceAddress = u64;
72 #[repr(transparent)]
73 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
74 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryPoolCreateFlags.html>"]
75 pub struct QueryPoolCreateFlags(pub(crate) Flags);
76 vk_bitflags_wrapped!(QueryPoolCreateFlags, Flags);
77 #[repr(transparent)]
78 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
79 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineDynamicStateCreateFlags.html>"]
80 pub struct PipelineDynamicStateCreateFlags(pub(crate) Flags);
81 vk_bitflags_wrapped!(PipelineDynamicStateCreateFlags, Flags);
82 #[repr(transparent)]
83 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
84 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineMultisampleStateCreateFlags.html>"]
85 pub struct PipelineMultisampleStateCreateFlags(pub(crate) Flags);
86 vk_bitflags_wrapped!(PipelineMultisampleStateCreateFlags, Flags);
87 #[repr(transparent)]
88 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
89 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineRasterizationStateCreateFlags.html>"]
90 pub struct PipelineRasterizationStateCreateFlags(pub(crate) Flags);
91 vk_bitflags_wrapped!(PipelineRasterizationStateCreateFlags, Flags);
92 #[repr(transparent)]
93 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
94 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineViewportStateCreateFlags.html>"]
95 pub struct PipelineViewportStateCreateFlags(pub(crate) Flags);
96 vk_bitflags_wrapped!(PipelineViewportStateCreateFlags, Flags);
97 #[repr(transparent)]
98 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
99 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineTessellationStateCreateFlags.html>"]
100 pub struct PipelineTessellationStateCreateFlags(pub(crate) Flags);
101 vk_bitflags_wrapped!(PipelineTessellationStateCreateFlags, Flags);
102 #[repr(transparent)]
103 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
104 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineInputAssemblyStateCreateFlags.html>"]
105 pub struct PipelineInputAssemblyStateCreateFlags(pub(crate) Flags);
106 vk_bitflags_wrapped!(PipelineInputAssemblyStateCreateFlags, Flags);
107 #[repr(transparent)]
108 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
109 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineVertexInputStateCreateFlags.html>"]
110 pub struct PipelineVertexInputStateCreateFlags(pub(crate) Flags);
111 vk_bitflags_wrapped!(PipelineVertexInputStateCreateFlags, Flags);
112 #[repr(transparent)]
113 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
114 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferViewCreateFlags.html>"]
115 pub struct BufferViewCreateFlags(pub(crate) Flags);
116 vk_bitflags_wrapped!(BufferViewCreateFlags, Flags);
117 #[repr(transparent)]
118 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
119 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkInstanceCreateFlags.html>"]
120 pub struct InstanceCreateFlags(pub(crate) Flags);
121 vk_bitflags_wrapped!(InstanceCreateFlags, Flags);
122 #[repr(transparent)]
123 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
124 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceCreateFlags.html>"]
125 pub struct DeviceCreateFlags(pub(crate) Flags);
126 vk_bitflags_wrapped!(DeviceCreateFlags, Flags);
127 #[repr(transparent)]
128 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
129 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryMapFlags.html>"]
130 pub struct MemoryMapFlags(pub(crate) Flags);
131 vk_bitflags_wrapped!(MemoryMapFlags, Flags);
132 #[repr(transparent)]
133 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
134 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPoolResetFlags.html>"]
135 pub struct DescriptorPoolResetFlags(pub(crate) Flags);
136 vk_bitflags_wrapped!(DescriptorPoolResetFlags, Flags);
137 #[repr(transparent)]
138 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
139 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorUpdateTemplateCreateFlags.html>"]
140 pub struct DescriptorUpdateTemplateCreateFlags(pub(crate) Flags);
141 vk_bitflags_wrapped!(DescriptorUpdateTemplateCreateFlags, Flags);
142 #[repr(transparent)]
143 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
144 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureMotionInfoFlagsNV.html>"]
145 pub struct AccelerationStructureMotionInfoFlagsNV(pub(crate) Flags);
146 vk_bitflags_wrapped!(AccelerationStructureMotionInfoFlagsNV, Flags);
147 #[repr(transparent)]
148 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
149 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureMotionInstanceFlagsNV.html>"]
150 pub struct AccelerationStructureMotionInstanceFlagsNV(pub(crate) Flags);
151 vk_bitflags_wrapped!(AccelerationStructureMotionInstanceFlagsNV, Flags);
152 #[repr(transparent)]
153 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
154 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayModeCreateFlagsKHR.html>"]
155 pub struct DisplayModeCreateFlagsKHR(pub(crate) Flags);
156 vk_bitflags_wrapped!(DisplayModeCreateFlagsKHR, Flags);
157 #[repr(transparent)]
158 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
159 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplaySurfaceCreateFlagsKHR.html>"]
160 pub struct DisplaySurfaceCreateFlagsKHR(pub(crate) Flags);
161 vk_bitflags_wrapped!(DisplaySurfaceCreateFlagsKHR, Flags);
162 #[repr(transparent)]
163 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
164 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAndroidSurfaceCreateFlagsKHR.html>"]
165 pub struct AndroidSurfaceCreateFlagsKHR(pub(crate) Flags);
166 vk_bitflags_wrapped!(AndroidSurfaceCreateFlagsKHR, Flags);
167 #[repr(transparent)]
168 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
169 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkViSurfaceCreateFlagsNN.html>"]
170 pub struct ViSurfaceCreateFlagsNN(pub(crate) Flags);
171 vk_bitflags_wrapped!(ViSurfaceCreateFlagsNN, Flags);
172 #[repr(transparent)]
173 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
174 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkWaylandSurfaceCreateFlagsKHR.html>"]
175 pub struct WaylandSurfaceCreateFlagsKHR(pub(crate) Flags);
176 vk_bitflags_wrapped!(WaylandSurfaceCreateFlagsKHR, Flags);
177 #[repr(transparent)]
178 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
179 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkWin32SurfaceCreateFlagsKHR.html>"]
180 pub struct Win32SurfaceCreateFlagsKHR(pub(crate) Flags);
181 vk_bitflags_wrapped!(Win32SurfaceCreateFlagsKHR, Flags);
182 #[repr(transparent)]
183 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
184 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkXlibSurfaceCreateFlagsKHR.html>"]
185 pub struct XlibSurfaceCreateFlagsKHR(pub(crate) Flags);
186 vk_bitflags_wrapped!(XlibSurfaceCreateFlagsKHR, Flags);
187 #[repr(transparent)]
188 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
189 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkXcbSurfaceCreateFlagsKHR.html>"]
190 pub struct XcbSurfaceCreateFlagsKHR(pub(crate) Flags);
191 vk_bitflags_wrapped!(XcbSurfaceCreateFlagsKHR, Flags);
192 #[repr(transparent)]
193 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
194 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDirectFBSurfaceCreateFlagsEXT.html>"]
195 pub struct DirectFBSurfaceCreateFlagsEXT(pub(crate) Flags);
196 vk_bitflags_wrapped!(DirectFBSurfaceCreateFlagsEXT, Flags);
197 #[repr(transparent)]
198 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
199 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIOSSurfaceCreateFlagsMVK.html>"]
200 pub struct IOSSurfaceCreateFlagsMVK(pub(crate) Flags);
201 vk_bitflags_wrapped!(IOSSurfaceCreateFlagsMVK, Flags);
202 #[repr(transparent)]
203 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
204 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMacOSSurfaceCreateFlagsMVK.html>"]
205 pub struct MacOSSurfaceCreateFlagsMVK(pub(crate) Flags);
206 vk_bitflags_wrapped!(MacOSSurfaceCreateFlagsMVK, Flags);
207 #[repr(transparent)]
208 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
209 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMetalSurfaceCreateFlagsEXT.html>"]
210 pub struct MetalSurfaceCreateFlagsEXT(pub(crate) Flags);
211 vk_bitflags_wrapped!(MetalSurfaceCreateFlagsEXT, Flags);
212 #[repr(transparent)]
213 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
214 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImagePipeSurfaceCreateFlagsFUCHSIA.html>"]
215 pub struct ImagePipeSurfaceCreateFlagsFUCHSIA(pub(crate) Flags);
216 vk_bitflags_wrapped!(ImagePipeSurfaceCreateFlagsFUCHSIA, Flags);
217 #[repr(transparent)]
218 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
219 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkStreamDescriptorSurfaceCreateFlagsGGP.html>"]
220 pub struct StreamDescriptorSurfaceCreateFlagsGGP(pub(crate) Flags);
221 vk_bitflags_wrapped!(StreamDescriptorSurfaceCreateFlagsGGP, Flags);
222 #[repr(transparent)]
223 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
224 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkHeadlessSurfaceCreateFlagsEXT.html>"]
225 pub struct HeadlessSurfaceCreateFlagsEXT(pub(crate) Flags);
226 vk_bitflags_wrapped!(HeadlessSurfaceCreateFlagsEXT, Flags);
227 #[repr(transparent)]
228 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
229 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkScreenSurfaceCreateFlagsQNX.html>"]
230 pub struct ScreenSurfaceCreateFlagsQNX(pub(crate) Flags);
231 vk_bitflags_wrapped!(ScreenSurfaceCreateFlagsQNX, Flags);
232 #[repr(transparent)]
233 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
234 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandPoolTrimFlags.html>"]
235 pub struct CommandPoolTrimFlags(pub(crate) Flags);
236 vk_bitflags_wrapped!(CommandPoolTrimFlags, Flags);
237 #[repr(transparent)]
238 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
239 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineViewportSwizzleStateCreateFlagsNV.html>"]
240 pub struct PipelineViewportSwizzleStateCreateFlagsNV(pub(crate) Flags);
241 vk_bitflags_wrapped!(PipelineViewportSwizzleStateCreateFlagsNV, Flags);
242 #[repr(transparent)]
243 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
244 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineDiscardRectangleStateCreateFlagsEXT.html>"]
245 pub struct PipelineDiscardRectangleStateCreateFlagsEXT(pub(crate) Flags);
246 vk_bitflags_wrapped!(PipelineDiscardRectangleStateCreateFlagsEXT, Flags);
247 #[repr(transparent)]
248 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
249 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCoverageToColorStateCreateFlagsNV.html>"]
250 pub struct PipelineCoverageToColorStateCreateFlagsNV(pub(crate) Flags);
251 vk_bitflags_wrapped!(PipelineCoverageToColorStateCreateFlagsNV, Flags);
252 #[repr(transparent)]
253 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
254 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCoverageModulationStateCreateFlagsNV.html>"]
255 pub struct PipelineCoverageModulationStateCreateFlagsNV(pub(crate) Flags);
256 vk_bitflags_wrapped!(PipelineCoverageModulationStateCreateFlagsNV, Flags);
257 #[repr(transparent)]
258 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
259 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCoverageReductionStateCreateFlagsNV.html>"]
260 pub struct PipelineCoverageReductionStateCreateFlagsNV(pub(crate) Flags);
261 vk_bitflags_wrapped!(PipelineCoverageReductionStateCreateFlagsNV, Flags);
262 #[repr(transparent)]
263 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
264 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationCacheCreateFlagsEXT.html>"]
265 pub struct ValidationCacheCreateFlagsEXT(pub(crate) Flags);
266 vk_bitflags_wrapped!(ValidationCacheCreateFlagsEXT, Flags);
267 #[repr(transparent)]
268 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
269 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessengerCreateFlagsEXT.html>"]
270 pub struct DebugUtilsMessengerCreateFlagsEXT(pub(crate) Flags);
271 vk_bitflags_wrapped!(DebugUtilsMessengerCreateFlagsEXT, Flags);
272 #[repr(transparent)]
273 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
274 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessengerCallbackDataFlagsEXT.html>"]
275 pub struct DebugUtilsMessengerCallbackDataFlagsEXT(pub(crate) Flags);
276 vk_bitflags_wrapped!(DebugUtilsMessengerCallbackDataFlagsEXT, Flags);
277 #[repr(transparent)]
278 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
279 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceMemoryReportFlagsEXT.html>"]
280 pub struct DeviceMemoryReportFlagsEXT(pub(crate) Flags);
281 vk_bitflags_wrapped!(DeviceMemoryReportFlagsEXT, Flags);
282 #[repr(transparent)]
283 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
284 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineRasterizationConservativeStateCreateFlagsEXT.html>"]
285 pub struct PipelineRasterizationConservativeStateCreateFlagsEXT(pub(crate) Flags);
286 vk_bitflags_wrapped!(PipelineRasterizationConservativeStateCreateFlagsEXT, Flags);
287 #[repr(transparent)]
288 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
289 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineRasterizationStateStreamCreateFlagsEXT.html>"]
290 pub struct PipelineRasterizationStateStreamCreateFlagsEXT(pub(crate) Flags);
291 vk_bitflags_wrapped!(PipelineRasterizationStateStreamCreateFlagsEXT, Flags);
292 #[repr(transparent)]
293 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
294 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineRasterizationDepthClipStateCreateFlagsEXT.html>"]
295 pub struct PipelineRasterizationDepthClipStateCreateFlagsEXT(pub(crate) Flags);
296 vk_bitflags_wrapped!(PipelineRasterizationDepthClipStateCreateFlagsEXT, Flags);
297 #[repr(transparent)]
298 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
299 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoBeginCodingFlagsKHR.html>"]
300 pub struct VideoBeginCodingFlagsKHR(pub(crate) Flags);
301 vk_bitflags_wrapped!(VideoBeginCodingFlagsKHR, Flags);
302 #[repr(transparent)]
303 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
304 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEndCodingFlagsKHR.html>"]
305 pub struct VideoEndCodingFlagsKHR(pub(crate) Flags);
306 vk_bitflags_wrapped!(VideoEndCodingFlagsKHR, Flags);
307 #[repr(transparent)]
308 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
309 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH264CreateFlagsEXT.html>"]
310 pub struct VideoDecodeH264CreateFlagsEXT(pub(crate) Flags);
311 vk_bitflags_wrapped!(VideoDecodeH264CreateFlagsEXT, Flags);
312 #[repr(transparent)]
313 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
314 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH265CreateFlagsEXT.html>"]
315 pub struct VideoDecodeH265CreateFlagsEXT(pub(crate) Flags);
316 vk_bitflags_wrapped!(VideoDecodeH265CreateFlagsEXT, Flags);
317 #[repr(transparent)]
318 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
319 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH265CapabilityFlagsEXT.html>"]
320 pub struct VideoEncodeH265CapabilityFlagsEXT(pub(crate) Flags);
321 vk_bitflags_wrapped!(VideoEncodeH265CapabilityFlagsEXT, Flags);
322 #[repr(transparent)]
323 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
324 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH265CreateFlagsEXT.html>"]
325 pub struct VideoEncodeH265CreateFlagsEXT(pub(crate) Flags);
326 vk_bitflags_wrapped!(VideoEncodeH265CreateFlagsEXT, Flags);
327 define_handle!(
328 Instance,
329 INSTANCE,
330 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkInstance.html>"
331 );
332 define_handle ! (PhysicalDevice , PHYSICAL_DEVICE , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDevice.html>") ;
333 define_handle!(
334 Device,
335 DEVICE,
336 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDevice.html>"
337 );
338 define_handle!(
339 Queue,
340 QUEUE,
341 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueue.html>"
342 );
343 define_handle ! (CommandBuffer , COMMAND_BUFFER , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandBuffer.html>") ;
344 handle_nondispatchable ! (DeviceMemory , DEVICE_MEMORY , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceMemory.html>") ;
345 handle_nondispatchable ! (CommandPool , COMMAND_POOL , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandPool.html>") ;
346 handle_nondispatchable!(
347 Buffer,
348 BUFFER,
349 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBuffer.html>"
350 );
351 handle_nondispatchable!(
352 BufferView,
353 BUFFER_VIEW,
354 doc =
355 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferView.html>"
356 );
357 handle_nondispatchable!(
358 Image,
359 IMAGE,
360 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImage.html>"
361 );
362 handle_nondispatchable!(
363 ImageView,
364 IMAGE_VIEW,
365 doc =
366 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageView.html>"
367 );
368 handle_nondispatchable ! (ShaderModule , SHADER_MODULE , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderModule.html>") ;
369 handle_nondispatchable!(
370 Pipeline,
371 PIPELINE,
372 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipeline.html>"
373 );
374 handle_nondispatchable ! (PipelineLayout , PIPELINE_LAYOUT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineLayout.html>") ;
375 handle_nondispatchable!(
376 Sampler,
377 SAMPLER,
378 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampler.html>"
379 );
380 handle_nondispatchable ! (DescriptorSet , DESCRIPTOR_SET , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSet.html>") ;
381 handle_nondispatchable ! (DescriptorSetLayout , DESCRIPTOR_SET_LAYOUT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayout.html>") ;
382 handle_nondispatchable ! (DescriptorPool , DESCRIPTOR_POOL , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPool.html>") ;
383 handle_nondispatchable!(
384 Fence,
385 FENCE,
386 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFence.html>"
387 );
388 handle_nondispatchable!(
389 Semaphore,
390 SEMAPHORE,
391 doc =
392 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphore.html>"
393 );
394 handle_nondispatchable!(
395 Event,
396 EVENT,
397 doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkEvent.html>"
398 );
399 handle_nondispatchable!(
400 QueryPool,
401 QUERY_POOL,
402 doc =
403 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryPool.html>"
404 );
405 handle_nondispatchable ! (Framebuffer , FRAMEBUFFER , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFramebuffer.html>") ;
406 handle_nondispatchable!(
407 RenderPass,
408 RENDER_PASS,
409 doc =
410 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkRenderPass.html>"
411 );
412 handle_nondispatchable ! (PipelineCache , PIPELINE_CACHE , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCache.html>") ;
413 handle_nondispatchable ! (IndirectCommandsLayoutNV , INDIRECT_COMMANDS_LAYOUT_NV , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIndirectCommandsLayoutNV.html>") ;
414 handle_nondispatchable ! (DescriptorUpdateTemplate , DESCRIPTOR_UPDATE_TEMPLATE , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorUpdateTemplate.html>") ;
415 handle_nondispatchable ! (SamplerYcbcrConversion , SAMPLER_YCBCR_CONVERSION , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerYcbcrConversion.html>") ;
416 handle_nondispatchable ! (ValidationCacheEXT , VALIDATION_CACHE_EXT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkValidationCacheEXT.html>") ;
417 handle_nondispatchable ! (AccelerationStructureKHR , ACCELERATION_STRUCTURE_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureKHR.html>") ;
418 handle_nondispatchable ! (AccelerationStructureNV , ACCELERATION_STRUCTURE_NV , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureNV.html>") ;
419 handle_nondispatchable ! (PerformanceConfigurationINTEL , PERFORMANCE_CONFIGURATION_INTEL , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceConfigurationINTEL.html>") ;
420 handle_nondispatchable ! (BufferCollectionFUCHSIA , BUFFER_COLLECTION_FUCHSIA , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferCollectionFUCHSIA.html>") ;
421 handle_nondispatchable ! (DeferredOperationKHR , DEFERRED_OPERATION_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeferredOperationKHR.html>") ;
422 handle_nondispatchable ! (PrivateDataSlotEXT , PRIVATE_DATA_SLOT_EXT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPrivateDataSlotEXT.html>") ;
423 handle_nondispatchable ! (CuModuleNVX , CU_MODULE_NVX , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCuModuleNVX.html>") ;
424 handle_nondispatchable ! (CuFunctionNVX , CU_FUNCTION_NVX , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCuFunctionNVX.html>") ;
425 handle_nondispatchable!(
426 DisplayKHR,
427 DISPLAY_KHR,
428 doc =
429 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayKHR.html>"
430 );
431 handle_nondispatchable ! (DisplayModeKHR , DISPLAY_MODE_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayModeKHR.html>") ;
432 handle_nondispatchable!(
433 SurfaceKHR,
434 SURFACE_KHR,
435 doc =
436 "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSurfaceKHR.html>"
437 );
438 handle_nondispatchable ! (SwapchainKHR , SWAPCHAIN_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSwapchainKHR.html>") ;
439 handle_nondispatchable ! (DebugReportCallbackEXT , DEBUG_REPORT_CALLBACK_EXT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugReportCallbackEXT.html>") ;
440 handle_nondispatchable ! (DebugUtilsMessengerEXT , DEBUG_UTILS_MESSENGER_EXT , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessengerEXT.html>") ;
441 handle_nondispatchable ! (VideoSessionKHR , VIDEO_SESSION_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoSessionKHR.html>") ;
442 handle_nondispatchable ! (VideoSessionParametersKHR , VIDEO_SESSION_PARAMETERS_KHR , doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoSessionParametersKHR.html>") ;
443 #[allow(non_camel_case_types)]
444 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkInternalAllocationNotification.html>"]
445 pub type PFN_vkInternalAllocationNotification = Option<
446 unsafe extern "system" fn(
447 p_user_data: *mut c_void,
448 size: usize,
449 allocation_type: InternalAllocationType,
450 allocation_scope: SystemAllocationScope,
451 ),
452 >;
453 #[allow(non_camel_case_types)]
454 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkInternalFreeNotification.html>"]
455 pub type PFN_vkInternalFreeNotification = Option<
456 unsafe extern "system" fn(
457 p_user_data: *mut c_void,
458 size: usize,
459 allocation_type: InternalAllocationType,
460 allocation_scope: SystemAllocationScope,
461 ),
462 >;
463 #[allow(non_camel_case_types)]
464 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkReallocationFunction.html>"]
465 pub type PFN_vkReallocationFunction = Option<
466 unsafe extern "system" fn(
467 p_user_data: *mut c_void,
468 p_original: *mut c_void,
469 size: usize,
470 alignment: usize,
471 allocation_scope: SystemAllocationScope,
472 ) -> *mut c_void,
473 >;
474 #[allow(non_camel_case_types)]
475 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkAllocationFunction.html>"]
476 pub type PFN_vkAllocationFunction = Option<
477 unsafe extern "system" fn(
478 p_user_data: *mut c_void,
479 size: usize,
480 alignment: usize,
481 allocation_scope: SystemAllocationScope,
482 ) -> *mut c_void,
483 >;
484 #[allow(non_camel_case_types)]
485 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkFreeFunction.html>"]
486 pub type PFN_vkFreeFunction =
487 Option<unsafe extern "system" fn(p_user_data: *mut c_void, p_memory: *mut c_void)>;
488 #[allow(non_camel_case_types)]
489 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkVoidFunction.html>"]
490 pub type PFN_vkVoidFunction = Option<unsafe extern "system" fn()>;
491 #[allow(non_camel_case_types)]
492 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkDebugReportCallbackEXT.html>"]
493 pub type PFN_vkDebugReportCallbackEXT = Option<
494 unsafe extern "system" fn(
495 flags: DebugReportFlagsEXT,
496 object_type: DebugReportObjectTypeEXT,
497 object: u64,
498 location: usize,
499 message_code: i32,
500 p_layer_prefix: *const c_char,
501 p_message: *const c_char,
502 p_user_data: *mut c_void,
503 ) -> Bool32,
504 >;
505 #[allow(non_camel_case_types)]
506 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkDebugUtilsMessengerCallbackEXT.html>"]
507 pub type PFN_vkDebugUtilsMessengerCallbackEXT = Option<
508 unsafe extern "system" fn(
509 message_severity: DebugUtilsMessageSeverityFlagsEXT,
510 message_types: DebugUtilsMessageTypeFlagsEXT,
511 p_callback_data: *const DebugUtilsMessengerCallbackDataEXT,
512 p_user_data: *mut c_void,
513 ) -> Bool32,
514 >;
515 #[allow(non_camel_case_types)]
516 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/PFN_vkDeviceMemoryReportCallbackEXT.html>"]
517 pub type PFN_vkDeviceMemoryReportCallbackEXT = Option<
518 unsafe extern "system" fn(
519 p_callback_data: *const DeviceMemoryReportCallbackDataEXT,
520 p_user_data: *mut c_void,
521 ),
522 >;
523 #[repr(C)]
524 #[cfg_attr(feature = "debug", derive(Debug))]
525 #[derive(Copy, Clone)]
526 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBaseOutStructure.html>"]
527 pub struct BaseOutStructure {
528 pub s_type: StructureType,
529 pub p_next: *mut Self,
530 }
531 impl ::std::default::Default for BaseOutStructure {
default() -> Self532 fn default() -> Self {
533 Self {
534 s_type: unsafe { ::std::mem::zeroed() },
535 p_next: ::std::ptr::null_mut(),
536 }
537 }
538 }
539 #[repr(C)]
540 #[cfg_attr(feature = "debug", derive(Debug))]
541 #[derive(Copy, Clone)]
542 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBaseInStructure.html>"]
543 pub struct BaseInStructure {
544 pub s_type: StructureType,
545 pub p_next: *const Self,
546 }
547 impl ::std::default::Default for BaseInStructure {
default() -> Self548 fn default() -> Self {
549 Self {
550 s_type: unsafe { ::std::mem::zeroed() },
551 p_next: ::std::ptr::null(),
552 }
553 }
554 }
555 #[repr(C)]
556 #[cfg_attr(feature = "debug", derive(Debug))]
557 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
558 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkOffset2D.html>"]
559 pub struct Offset2D {
560 pub x: i32,
561 pub y: i32,
562 }
563 impl Offset2D {
builder<'a>() -> Offset2DBuilder<'a>564 pub fn builder<'a>() -> Offset2DBuilder<'a> {
565 Offset2DBuilder {
566 inner: Self::default(),
567 marker: ::std::marker::PhantomData,
568 }
569 }
570 }
571 #[repr(transparent)]
572 pub struct Offset2DBuilder<'a> {
573 inner: Offset2D,
574 marker: ::std::marker::PhantomData<&'a ()>,
575 }
576 impl<'a> ::std::ops::Deref for Offset2DBuilder<'a> {
577 type Target = Offset2D;
deref(&self) -> &Self::Target578 fn deref(&self) -> &Self::Target {
579 &self.inner
580 }
581 }
582 impl<'a> ::std::ops::DerefMut for Offset2DBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target583 fn deref_mut(&mut self) -> &mut Self::Target {
584 &mut self.inner
585 }
586 }
587 impl<'a> Offset2DBuilder<'a> {
x(mut self, x: i32) -> Self588 pub fn x(mut self, x: i32) -> Self {
589 self.inner.x = x;
590 self
591 }
y(mut self, y: i32) -> Self592 pub fn y(mut self, y: i32) -> Self {
593 self.inner.y = y;
594 self
595 }
596 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
597 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
598 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Offset2D599 pub fn build(self) -> Offset2D {
600 self.inner
601 }
602 }
603 #[repr(C)]
604 #[cfg_attr(feature = "debug", derive(Debug))]
605 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
606 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkOffset3D.html>"]
607 pub struct Offset3D {
608 pub x: i32,
609 pub y: i32,
610 pub z: i32,
611 }
612 impl Offset3D {
builder<'a>() -> Offset3DBuilder<'a>613 pub fn builder<'a>() -> Offset3DBuilder<'a> {
614 Offset3DBuilder {
615 inner: Self::default(),
616 marker: ::std::marker::PhantomData,
617 }
618 }
619 }
620 #[repr(transparent)]
621 pub struct Offset3DBuilder<'a> {
622 inner: Offset3D,
623 marker: ::std::marker::PhantomData<&'a ()>,
624 }
625 impl<'a> ::std::ops::Deref for Offset3DBuilder<'a> {
626 type Target = Offset3D;
deref(&self) -> &Self::Target627 fn deref(&self) -> &Self::Target {
628 &self.inner
629 }
630 }
631 impl<'a> ::std::ops::DerefMut for Offset3DBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target632 fn deref_mut(&mut self) -> &mut Self::Target {
633 &mut self.inner
634 }
635 }
636 impl<'a> Offset3DBuilder<'a> {
x(mut self, x: i32) -> Self637 pub fn x(mut self, x: i32) -> Self {
638 self.inner.x = x;
639 self
640 }
y(mut self, y: i32) -> Self641 pub fn y(mut self, y: i32) -> Self {
642 self.inner.y = y;
643 self
644 }
z(mut self, z: i32) -> Self645 pub fn z(mut self, z: i32) -> Self {
646 self.inner.z = z;
647 self
648 }
649 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
650 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
651 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Offset3D652 pub fn build(self) -> Offset3D {
653 self.inner
654 }
655 }
656 #[repr(C)]
657 #[cfg_attr(feature = "debug", derive(Debug))]
658 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
659 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExtent2D.html>"]
660 pub struct Extent2D {
661 pub width: u32,
662 pub height: u32,
663 }
664 impl Extent2D {
builder<'a>() -> Extent2DBuilder<'a>665 pub fn builder<'a>() -> Extent2DBuilder<'a> {
666 Extent2DBuilder {
667 inner: Self::default(),
668 marker: ::std::marker::PhantomData,
669 }
670 }
671 }
672 #[repr(transparent)]
673 pub struct Extent2DBuilder<'a> {
674 inner: Extent2D,
675 marker: ::std::marker::PhantomData<&'a ()>,
676 }
677 impl<'a> ::std::ops::Deref for Extent2DBuilder<'a> {
678 type Target = Extent2D;
deref(&self) -> &Self::Target679 fn deref(&self) -> &Self::Target {
680 &self.inner
681 }
682 }
683 impl<'a> ::std::ops::DerefMut for Extent2DBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target684 fn deref_mut(&mut self) -> &mut Self::Target {
685 &mut self.inner
686 }
687 }
688 impl<'a> Extent2DBuilder<'a> {
width(mut self, width: u32) -> Self689 pub fn width(mut self, width: u32) -> Self {
690 self.inner.width = width;
691 self
692 }
height(mut self, height: u32) -> Self693 pub fn height(mut self, height: u32) -> Self {
694 self.inner.height = height;
695 self
696 }
697 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
698 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
699 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Extent2D700 pub fn build(self) -> Extent2D {
701 self.inner
702 }
703 }
704 #[repr(C)]
705 #[cfg_attr(feature = "debug", derive(Debug))]
706 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
707 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExtent3D.html>"]
708 pub struct Extent3D {
709 pub width: u32,
710 pub height: u32,
711 pub depth: u32,
712 }
713 impl Extent3D {
builder<'a>() -> Extent3DBuilder<'a>714 pub fn builder<'a>() -> Extent3DBuilder<'a> {
715 Extent3DBuilder {
716 inner: Self::default(),
717 marker: ::std::marker::PhantomData,
718 }
719 }
720 }
721 #[repr(transparent)]
722 pub struct Extent3DBuilder<'a> {
723 inner: Extent3D,
724 marker: ::std::marker::PhantomData<&'a ()>,
725 }
726 impl<'a> ::std::ops::Deref for Extent3DBuilder<'a> {
727 type Target = Extent3D;
deref(&self) -> &Self::Target728 fn deref(&self) -> &Self::Target {
729 &self.inner
730 }
731 }
732 impl<'a> ::std::ops::DerefMut for Extent3DBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target733 fn deref_mut(&mut self) -> &mut Self::Target {
734 &mut self.inner
735 }
736 }
737 impl<'a> Extent3DBuilder<'a> {
width(mut self, width: u32) -> Self738 pub fn width(mut self, width: u32) -> Self {
739 self.inner.width = width;
740 self
741 }
height(mut self, height: u32) -> Self742 pub fn height(mut self, height: u32) -> Self {
743 self.inner.height = height;
744 self
745 }
depth(mut self, depth: u32) -> Self746 pub fn depth(mut self, depth: u32) -> Self {
747 self.inner.depth = depth;
748 self
749 }
750 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
751 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
752 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Extent3D753 pub fn build(self) -> Extent3D {
754 self.inner
755 }
756 }
757 #[repr(C)]
758 #[cfg_attr(feature = "debug", derive(Debug))]
759 #[derive(Copy, Clone, Default)]
760 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkViewport.html>"]
761 pub struct Viewport {
762 pub x: f32,
763 pub y: f32,
764 pub width: f32,
765 pub height: f32,
766 pub min_depth: f32,
767 pub max_depth: f32,
768 }
769 impl Viewport {
builder<'a>() -> ViewportBuilder<'a>770 pub fn builder<'a>() -> ViewportBuilder<'a> {
771 ViewportBuilder {
772 inner: Self::default(),
773 marker: ::std::marker::PhantomData,
774 }
775 }
776 }
777 #[repr(transparent)]
778 pub struct ViewportBuilder<'a> {
779 inner: Viewport,
780 marker: ::std::marker::PhantomData<&'a ()>,
781 }
782 impl<'a> ::std::ops::Deref for ViewportBuilder<'a> {
783 type Target = Viewport;
deref(&self) -> &Self::Target784 fn deref(&self) -> &Self::Target {
785 &self.inner
786 }
787 }
788 impl<'a> ::std::ops::DerefMut for ViewportBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target789 fn deref_mut(&mut self) -> &mut Self::Target {
790 &mut self.inner
791 }
792 }
793 impl<'a> ViewportBuilder<'a> {
x(mut self, x: f32) -> Self794 pub fn x(mut self, x: f32) -> Self {
795 self.inner.x = x;
796 self
797 }
y(mut self, y: f32) -> Self798 pub fn y(mut self, y: f32) -> Self {
799 self.inner.y = y;
800 self
801 }
width(mut self, width: f32) -> Self802 pub fn width(mut self, width: f32) -> Self {
803 self.inner.width = width;
804 self
805 }
height(mut self, height: f32) -> Self806 pub fn height(mut self, height: f32) -> Self {
807 self.inner.height = height;
808 self
809 }
min_depth(mut self, min_depth: f32) -> Self810 pub fn min_depth(mut self, min_depth: f32) -> Self {
811 self.inner.min_depth = min_depth;
812 self
813 }
max_depth(mut self, max_depth: f32) -> Self814 pub fn max_depth(mut self, max_depth: f32) -> Self {
815 self.inner.max_depth = max_depth;
816 self
817 }
818 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
819 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
820 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Viewport821 pub fn build(self) -> Viewport {
822 self.inner
823 }
824 }
825 #[repr(C)]
826 #[cfg_attr(feature = "debug", derive(Debug))]
827 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
828 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkRect2D.html>"]
829 pub struct Rect2D {
830 pub offset: Offset2D,
831 pub extent: Extent2D,
832 }
833 impl Rect2D {
builder<'a>() -> Rect2DBuilder<'a>834 pub fn builder<'a>() -> Rect2DBuilder<'a> {
835 Rect2DBuilder {
836 inner: Self::default(),
837 marker: ::std::marker::PhantomData,
838 }
839 }
840 }
841 #[repr(transparent)]
842 pub struct Rect2DBuilder<'a> {
843 inner: Rect2D,
844 marker: ::std::marker::PhantomData<&'a ()>,
845 }
846 impl<'a> ::std::ops::Deref for Rect2DBuilder<'a> {
847 type Target = Rect2D;
deref(&self) -> &Self::Target848 fn deref(&self) -> &Self::Target {
849 &self.inner
850 }
851 }
852 impl<'a> ::std::ops::DerefMut for Rect2DBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target853 fn deref_mut(&mut self) -> &mut Self::Target {
854 &mut self.inner
855 }
856 }
857 impl<'a> Rect2DBuilder<'a> {
offset(mut self, offset: Offset2D) -> Self858 pub fn offset(mut self, offset: Offset2D) -> Self {
859 self.inner.offset = offset;
860 self
861 }
extent(mut self, extent: Extent2D) -> Self862 pub fn extent(mut self, extent: Extent2D) -> Self {
863 self.inner.extent = extent;
864 self
865 }
866 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
867 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
868 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> Rect2D869 pub fn build(self) -> Rect2D {
870 self.inner
871 }
872 }
873 #[repr(C)]
874 #[cfg_attr(feature = "debug", derive(Debug))]
875 #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
876 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkClearRect.html>"]
877 pub struct ClearRect {
878 pub rect: Rect2D,
879 pub base_array_layer: u32,
880 pub layer_count: u32,
881 }
882 impl ClearRect {
builder<'a>() -> ClearRectBuilder<'a>883 pub fn builder<'a>() -> ClearRectBuilder<'a> {
884 ClearRectBuilder {
885 inner: Self::default(),
886 marker: ::std::marker::PhantomData,
887 }
888 }
889 }
890 #[repr(transparent)]
891 pub struct ClearRectBuilder<'a> {
892 inner: ClearRect,
893 marker: ::std::marker::PhantomData<&'a ()>,
894 }
895 impl<'a> ::std::ops::Deref for ClearRectBuilder<'a> {
896 type Target = ClearRect;
deref(&self) -> &Self::Target897 fn deref(&self) -> &Self::Target {
898 &self.inner
899 }
900 }
901 impl<'a> ::std::ops::DerefMut for ClearRectBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target902 fn deref_mut(&mut self) -> &mut Self::Target {
903 &mut self.inner
904 }
905 }
906 impl<'a> ClearRectBuilder<'a> {
rect(mut self, rect: Rect2D) -> Self907 pub fn rect(mut self, rect: Rect2D) -> Self {
908 self.inner.rect = rect;
909 self
910 }
base_array_layer(mut self, base_array_layer: u32) -> Self911 pub fn base_array_layer(mut self, base_array_layer: u32) -> Self {
912 self.inner.base_array_layer = base_array_layer;
913 self
914 }
layer_count(mut self, layer_count: u32) -> Self915 pub fn layer_count(mut self, layer_count: u32) -> Self {
916 self.inner.layer_count = layer_count;
917 self
918 }
919 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
920 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
921 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ClearRect922 pub fn build(self) -> ClearRect {
923 self.inner
924 }
925 }
926 #[repr(C)]
927 #[cfg_attr(feature = "debug", derive(Debug))]
928 #[derive(Copy, Clone, Default)]
929 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkComponentMapping.html>"]
930 pub struct ComponentMapping {
931 pub r: ComponentSwizzle,
932 pub g: ComponentSwizzle,
933 pub b: ComponentSwizzle,
934 pub a: ComponentSwizzle,
935 }
936 impl ComponentMapping {
builder<'a>() -> ComponentMappingBuilder<'a>937 pub fn builder<'a>() -> ComponentMappingBuilder<'a> {
938 ComponentMappingBuilder {
939 inner: Self::default(),
940 marker: ::std::marker::PhantomData,
941 }
942 }
943 }
944 #[repr(transparent)]
945 pub struct ComponentMappingBuilder<'a> {
946 inner: ComponentMapping,
947 marker: ::std::marker::PhantomData<&'a ()>,
948 }
949 impl<'a> ::std::ops::Deref for ComponentMappingBuilder<'a> {
950 type Target = ComponentMapping;
deref(&self) -> &Self::Target951 fn deref(&self) -> &Self::Target {
952 &self.inner
953 }
954 }
955 impl<'a> ::std::ops::DerefMut for ComponentMappingBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target956 fn deref_mut(&mut self) -> &mut Self::Target {
957 &mut self.inner
958 }
959 }
960 impl<'a> ComponentMappingBuilder<'a> {
r(mut self, r: ComponentSwizzle) -> Self961 pub fn r(mut self, r: ComponentSwizzle) -> Self {
962 self.inner.r = r;
963 self
964 }
g(mut self, g: ComponentSwizzle) -> Self965 pub fn g(mut self, g: ComponentSwizzle) -> Self {
966 self.inner.g = g;
967 self
968 }
b(mut self, b: ComponentSwizzle) -> Self969 pub fn b(mut self, b: ComponentSwizzle) -> Self {
970 self.inner.b = b;
971 self
972 }
a(mut self, a: ComponentSwizzle) -> Self973 pub fn a(mut self, a: ComponentSwizzle) -> Self {
974 self.inner.a = a;
975 self
976 }
977 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
978 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
979 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ComponentMapping980 pub fn build(self) -> ComponentMapping {
981 self.inner
982 }
983 }
984 #[repr(C)]
985 #[derive(Copy, Clone)]
986 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceProperties.html>"]
987 pub struct PhysicalDeviceProperties {
988 pub api_version: u32,
989 pub driver_version: u32,
990 pub vendor_id: u32,
991 pub device_id: u32,
992 pub device_type: PhysicalDeviceType,
993 pub device_name: [c_char; MAX_PHYSICAL_DEVICE_NAME_SIZE],
994 pub pipeline_cache_uuid: [u8; UUID_SIZE],
995 pub limits: PhysicalDeviceLimits,
996 pub sparse_properties: PhysicalDeviceSparseProperties,
997 }
998 #[cfg(feature = "debug")]
999 impl fmt::Debug for PhysicalDeviceProperties {
fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result1000 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
1001 fmt.debug_struct("PhysicalDeviceProperties")
1002 .field("api_version", &self.api_version)
1003 .field("driver_version", &self.driver_version)
1004 .field("vendor_id", &self.vendor_id)
1005 .field("device_id", &self.device_id)
1006 .field("device_type", &self.device_type)
1007 .field("device_name", &unsafe {
1008 ::std::ffi::CStr::from_ptr(self.device_name.as_ptr() as *const c_char)
1009 })
1010 .field("pipeline_cache_uuid", &self.pipeline_cache_uuid)
1011 .field("limits", &self.limits)
1012 .field("sparse_properties", &self.sparse_properties)
1013 .finish()
1014 }
1015 }
1016 impl ::std::default::Default for PhysicalDeviceProperties {
default() -> Self1017 fn default() -> Self {
1018 Self {
1019 api_version: u32::default(),
1020 driver_version: u32::default(),
1021 vendor_id: u32::default(),
1022 device_id: u32::default(),
1023 device_type: PhysicalDeviceType::default(),
1024 device_name: unsafe { ::std::mem::zeroed() },
1025 pipeline_cache_uuid: unsafe { ::std::mem::zeroed() },
1026 limits: PhysicalDeviceLimits::default(),
1027 sparse_properties: PhysicalDeviceSparseProperties::default(),
1028 }
1029 }
1030 }
1031 impl PhysicalDeviceProperties {
builder<'a>() -> PhysicalDevicePropertiesBuilder<'a>1032 pub fn builder<'a>() -> PhysicalDevicePropertiesBuilder<'a> {
1033 PhysicalDevicePropertiesBuilder {
1034 inner: Self::default(),
1035 marker: ::std::marker::PhantomData,
1036 }
1037 }
1038 }
1039 #[repr(transparent)]
1040 pub struct PhysicalDevicePropertiesBuilder<'a> {
1041 inner: PhysicalDeviceProperties,
1042 marker: ::std::marker::PhantomData<&'a ()>,
1043 }
1044 impl<'a> ::std::ops::Deref for PhysicalDevicePropertiesBuilder<'a> {
1045 type Target = PhysicalDeviceProperties;
deref(&self) -> &Self::Target1046 fn deref(&self) -> &Self::Target {
1047 &self.inner
1048 }
1049 }
1050 impl<'a> ::std::ops::DerefMut for PhysicalDevicePropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1051 fn deref_mut(&mut self) -> &mut Self::Target {
1052 &mut self.inner
1053 }
1054 }
1055 impl<'a> PhysicalDevicePropertiesBuilder<'a> {
api_version(mut self, api_version: u32) -> Self1056 pub fn api_version(mut self, api_version: u32) -> Self {
1057 self.inner.api_version = api_version;
1058 self
1059 }
driver_version(mut self, driver_version: u32) -> Self1060 pub fn driver_version(mut self, driver_version: u32) -> Self {
1061 self.inner.driver_version = driver_version;
1062 self
1063 }
vendor_id(mut self, vendor_id: u32) -> Self1064 pub fn vendor_id(mut self, vendor_id: u32) -> Self {
1065 self.inner.vendor_id = vendor_id;
1066 self
1067 }
device_id(mut self, device_id: u32) -> Self1068 pub fn device_id(mut self, device_id: u32) -> Self {
1069 self.inner.device_id = device_id;
1070 self
1071 }
device_type(mut self, device_type: PhysicalDeviceType) -> Self1072 pub fn device_type(mut self, device_type: PhysicalDeviceType) -> Self {
1073 self.inner.device_type = device_type;
1074 self
1075 }
device_name(mut self, device_name: [c_char; MAX_PHYSICAL_DEVICE_NAME_SIZE]) -> Self1076 pub fn device_name(mut self, device_name: [c_char; MAX_PHYSICAL_DEVICE_NAME_SIZE]) -> Self {
1077 self.inner.device_name = device_name;
1078 self
1079 }
pipeline_cache_uuid(mut self, pipeline_cache_uuid: [u8; UUID_SIZE]) -> Self1080 pub fn pipeline_cache_uuid(mut self, pipeline_cache_uuid: [u8; UUID_SIZE]) -> Self {
1081 self.inner.pipeline_cache_uuid = pipeline_cache_uuid;
1082 self
1083 }
limits(mut self, limits: PhysicalDeviceLimits) -> Self1084 pub fn limits(mut self, limits: PhysicalDeviceLimits) -> Self {
1085 self.inner.limits = limits;
1086 self
1087 }
sparse_properties(mut self, sparse_properties: PhysicalDeviceSparseProperties) -> Self1088 pub fn sparse_properties(mut self, sparse_properties: PhysicalDeviceSparseProperties) -> Self {
1089 self.inner.sparse_properties = sparse_properties;
1090 self
1091 }
1092 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1093 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1094 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PhysicalDeviceProperties1095 pub fn build(self) -> PhysicalDeviceProperties {
1096 self.inner
1097 }
1098 }
1099 #[repr(C)]
1100 #[derive(Copy, Clone)]
1101 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExtensionProperties.html>"]
1102 pub struct ExtensionProperties {
1103 pub extension_name: [c_char; MAX_EXTENSION_NAME_SIZE],
1104 pub spec_version: u32,
1105 }
1106 #[cfg(feature = "debug")]
1107 impl fmt::Debug for ExtensionProperties {
fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result1108 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
1109 fmt.debug_struct("ExtensionProperties")
1110 .field("extension_name", &unsafe {
1111 ::std::ffi::CStr::from_ptr(self.extension_name.as_ptr() as *const c_char)
1112 })
1113 .field("spec_version", &self.spec_version)
1114 .finish()
1115 }
1116 }
1117 impl ::std::default::Default for ExtensionProperties {
default() -> Self1118 fn default() -> Self {
1119 Self {
1120 extension_name: unsafe { ::std::mem::zeroed() },
1121 spec_version: u32::default(),
1122 }
1123 }
1124 }
1125 impl ExtensionProperties {
builder<'a>() -> ExtensionPropertiesBuilder<'a>1126 pub fn builder<'a>() -> ExtensionPropertiesBuilder<'a> {
1127 ExtensionPropertiesBuilder {
1128 inner: Self::default(),
1129 marker: ::std::marker::PhantomData,
1130 }
1131 }
1132 }
1133 #[repr(transparent)]
1134 pub struct ExtensionPropertiesBuilder<'a> {
1135 inner: ExtensionProperties,
1136 marker: ::std::marker::PhantomData<&'a ()>,
1137 }
1138 impl<'a> ::std::ops::Deref for ExtensionPropertiesBuilder<'a> {
1139 type Target = ExtensionProperties;
deref(&self) -> &Self::Target1140 fn deref(&self) -> &Self::Target {
1141 &self.inner
1142 }
1143 }
1144 impl<'a> ::std::ops::DerefMut for ExtensionPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1145 fn deref_mut(&mut self) -> &mut Self::Target {
1146 &mut self.inner
1147 }
1148 }
1149 impl<'a> ExtensionPropertiesBuilder<'a> {
extension_name(mut self, extension_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self1150 pub fn extension_name(mut self, extension_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self {
1151 self.inner.extension_name = extension_name;
1152 self
1153 }
spec_version(mut self, spec_version: u32) -> Self1154 pub fn spec_version(mut self, spec_version: u32) -> Self {
1155 self.inner.spec_version = spec_version;
1156 self
1157 }
1158 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1159 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1160 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ExtensionProperties1161 pub fn build(self) -> ExtensionProperties {
1162 self.inner
1163 }
1164 }
1165 #[repr(C)]
1166 #[derive(Copy, Clone)]
1167 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkLayerProperties.html>"]
1168 pub struct LayerProperties {
1169 pub layer_name: [c_char; MAX_EXTENSION_NAME_SIZE],
1170 pub spec_version: u32,
1171 pub implementation_version: u32,
1172 pub description: [c_char; MAX_DESCRIPTION_SIZE],
1173 }
1174 #[cfg(feature = "debug")]
1175 impl fmt::Debug for LayerProperties {
fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result1176 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
1177 fmt.debug_struct("LayerProperties")
1178 .field("layer_name", &unsafe {
1179 ::std::ffi::CStr::from_ptr(self.layer_name.as_ptr() as *const c_char)
1180 })
1181 .field("spec_version", &self.spec_version)
1182 .field("implementation_version", &self.implementation_version)
1183 .field("description", &unsafe {
1184 ::std::ffi::CStr::from_ptr(self.description.as_ptr() as *const c_char)
1185 })
1186 .finish()
1187 }
1188 }
1189 impl ::std::default::Default for LayerProperties {
default() -> Self1190 fn default() -> Self {
1191 Self {
1192 layer_name: unsafe { ::std::mem::zeroed() },
1193 spec_version: u32::default(),
1194 implementation_version: u32::default(),
1195 description: unsafe { ::std::mem::zeroed() },
1196 }
1197 }
1198 }
1199 impl LayerProperties {
builder<'a>() -> LayerPropertiesBuilder<'a>1200 pub fn builder<'a>() -> LayerPropertiesBuilder<'a> {
1201 LayerPropertiesBuilder {
1202 inner: Self::default(),
1203 marker: ::std::marker::PhantomData,
1204 }
1205 }
1206 }
1207 #[repr(transparent)]
1208 pub struct LayerPropertiesBuilder<'a> {
1209 inner: LayerProperties,
1210 marker: ::std::marker::PhantomData<&'a ()>,
1211 }
1212 impl<'a> ::std::ops::Deref for LayerPropertiesBuilder<'a> {
1213 type Target = LayerProperties;
deref(&self) -> &Self::Target1214 fn deref(&self) -> &Self::Target {
1215 &self.inner
1216 }
1217 }
1218 impl<'a> ::std::ops::DerefMut for LayerPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1219 fn deref_mut(&mut self) -> &mut Self::Target {
1220 &mut self.inner
1221 }
1222 }
1223 impl<'a> LayerPropertiesBuilder<'a> {
layer_name(mut self, layer_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self1224 pub fn layer_name(mut self, layer_name: [c_char; MAX_EXTENSION_NAME_SIZE]) -> Self {
1225 self.inner.layer_name = layer_name;
1226 self
1227 }
spec_version(mut self, spec_version: u32) -> Self1228 pub fn spec_version(mut self, spec_version: u32) -> Self {
1229 self.inner.spec_version = spec_version;
1230 self
1231 }
implementation_version(mut self, implementation_version: u32) -> Self1232 pub fn implementation_version(mut self, implementation_version: u32) -> Self {
1233 self.inner.implementation_version = implementation_version;
1234 self
1235 }
description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self1236 pub fn description(mut self, description: [c_char; MAX_DESCRIPTION_SIZE]) -> Self {
1237 self.inner.description = description;
1238 self
1239 }
1240 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1241 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1242 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> LayerProperties1243 pub fn build(self) -> LayerProperties {
1244 self.inner
1245 }
1246 }
1247 #[repr(C)]
1248 #[cfg_attr(feature = "debug", derive(Debug))]
1249 #[derive(Copy, Clone)]
1250 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkApplicationInfo.html>"]
1251 pub struct ApplicationInfo {
1252 pub s_type: StructureType,
1253 pub p_next: *const c_void,
1254 pub p_application_name: *const c_char,
1255 pub application_version: u32,
1256 pub p_engine_name: *const c_char,
1257 pub engine_version: u32,
1258 pub api_version: u32,
1259 }
1260 impl ::std::default::Default for ApplicationInfo {
default() -> Self1261 fn default() -> Self {
1262 Self {
1263 s_type: StructureType::APPLICATION_INFO,
1264 p_next: ::std::ptr::null(),
1265 p_application_name: ::std::ptr::null(),
1266 application_version: u32::default(),
1267 p_engine_name: ::std::ptr::null(),
1268 engine_version: u32::default(),
1269 api_version: u32::default(),
1270 }
1271 }
1272 }
1273 impl ApplicationInfo {
builder<'a>() -> ApplicationInfoBuilder<'a>1274 pub fn builder<'a>() -> ApplicationInfoBuilder<'a> {
1275 ApplicationInfoBuilder {
1276 inner: Self::default(),
1277 marker: ::std::marker::PhantomData,
1278 }
1279 }
1280 }
1281 #[repr(transparent)]
1282 pub struct ApplicationInfoBuilder<'a> {
1283 inner: ApplicationInfo,
1284 marker: ::std::marker::PhantomData<&'a ()>,
1285 }
1286 impl<'a> ::std::ops::Deref for ApplicationInfoBuilder<'a> {
1287 type Target = ApplicationInfo;
deref(&self) -> &Self::Target1288 fn deref(&self) -> &Self::Target {
1289 &self.inner
1290 }
1291 }
1292 impl<'a> ::std::ops::DerefMut for ApplicationInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1293 fn deref_mut(&mut self) -> &mut Self::Target {
1294 &mut self.inner
1295 }
1296 }
1297 impl<'a> ApplicationInfoBuilder<'a> {
application_name(mut self, application_name: &'a ::std::ffi::CStr) -> Self1298 pub fn application_name(mut self, application_name: &'a ::std::ffi::CStr) -> Self {
1299 self.inner.p_application_name = application_name.as_ptr();
1300 self
1301 }
application_version(mut self, application_version: u32) -> Self1302 pub fn application_version(mut self, application_version: u32) -> Self {
1303 self.inner.application_version = application_version;
1304 self
1305 }
engine_name(mut self, engine_name: &'a ::std::ffi::CStr) -> Self1306 pub fn engine_name(mut self, engine_name: &'a ::std::ffi::CStr) -> Self {
1307 self.inner.p_engine_name = engine_name.as_ptr();
1308 self
1309 }
engine_version(mut self, engine_version: u32) -> Self1310 pub fn engine_version(mut self, engine_version: u32) -> Self {
1311 self.inner.engine_version = engine_version;
1312 self
1313 }
api_version(mut self, api_version: u32) -> Self1314 pub fn api_version(mut self, api_version: u32) -> Self {
1315 self.inner.api_version = api_version;
1316 self
1317 }
1318 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1319 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1320 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ApplicationInfo1321 pub fn build(self) -> ApplicationInfo {
1322 self.inner
1323 }
1324 }
1325 #[repr(C)]
1326 #[derive(Copy, Clone)]
1327 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAllocationCallbacks.html>"]
1328 pub struct AllocationCallbacks {
1329 pub p_user_data: *mut c_void,
1330 pub pfn_allocation: PFN_vkAllocationFunction,
1331 pub pfn_reallocation: PFN_vkReallocationFunction,
1332 pub pfn_free: PFN_vkFreeFunction,
1333 pub pfn_internal_allocation: PFN_vkInternalAllocationNotification,
1334 pub pfn_internal_free: PFN_vkInternalFreeNotification,
1335 }
1336 #[cfg(feature = "debug")]
1337 impl fmt::Debug for AllocationCallbacks {
fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result1338 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
1339 fmt.debug_struct("AllocationCallbacks")
1340 .field("p_user_data", &self.p_user_data)
1341 .field(
1342 "pfn_allocation",
1343 &(self.pfn_allocation.map(|x| x as *const ())),
1344 )
1345 .field(
1346 "pfn_reallocation",
1347 &(self.pfn_reallocation.map(|x| x as *const ())),
1348 )
1349 .field("pfn_free", &(self.pfn_free.map(|x| x as *const ())))
1350 .field(
1351 "pfn_internal_allocation",
1352 &(self.pfn_internal_allocation.map(|x| x as *const ())),
1353 )
1354 .field(
1355 "pfn_internal_free",
1356 &(self.pfn_internal_free.map(|x| x as *const ())),
1357 )
1358 .finish()
1359 }
1360 }
1361 impl ::std::default::Default for AllocationCallbacks {
default() -> Self1362 fn default() -> Self {
1363 Self {
1364 p_user_data: ::std::ptr::null_mut(),
1365 pfn_allocation: PFN_vkAllocationFunction::default(),
1366 pfn_reallocation: PFN_vkReallocationFunction::default(),
1367 pfn_free: PFN_vkFreeFunction::default(),
1368 pfn_internal_allocation: PFN_vkInternalAllocationNotification::default(),
1369 pfn_internal_free: PFN_vkInternalFreeNotification::default(),
1370 }
1371 }
1372 }
1373 impl AllocationCallbacks {
builder<'a>() -> AllocationCallbacksBuilder<'a>1374 pub fn builder<'a>() -> AllocationCallbacksBuilder<'a> {
1375 AllocationCallbacksBuilder {
1376 inner: Self::default(),
1377 marker: ::std::marker::PhantomData,
1378 }
1379 }
1380 }
1381 #[repr(transparent)]
1382 pub struct AllocationCallbacksBuilder<'a> {
1383 inner: AllocationCallbacks,
1384 marker: ::std::marker::PhantomData<&'a ()>,
1385 }
1386 impl<'a> ::std::ops::Deref for AllocationCallbacksBuilder<'a> {
1387 type Target = AllocationCallbacks;
deref(&self) -> &Self::Target1388 fn deref(&self) -> &Self::Target {
1389 &self.inner
1390 }
1391 }
1392 impl<'a> ::std::ops::DerefMut for AllocationCallbacksBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1393 fn deref_mut(&mut self) -> &mut Self::Target {
1394 &mut self.inner
1395 }
1396 }
1397 impl<'a> AllocationCallbacksBuilder<'a> {
user_data(mut self, user_data: *mut c_void) -> Self1398 pub fn user_data(mut self, user_data: *mut c_void) -> Self {
1399 self.inner.p_user_data = user_data;
1400 self
1401 }
pfn_allocation(mut self, pfn_allocation: PFN_vkAllocationFunction) -> Self1402 pub fn pfn_allocation(mut self, pfn_allocation: PFN_vkAllocationFunction) -> Self {
1403 self.inner.pfn_allocation = pfn_allocation;
1404 self
1405 }
pfn_reallocation(mut self, pfn_reallocation: PFN_vkReallocationFunction) -> Self1406 pub fn pfn_reallocation(mut self, pfn_reallocation: PFN_vkReallocationFunction) -> Self {
1407 self.inner.pfn_reallocation = pfn_reallocation;
1408 self
1409 }
pfn_free(mut self, pfn_free: PFN_vkFreeFunction) -> Self1410 pub fn pfn_free(mut self, pfn_free: PFN_vkFreeFunction) -> Self {
1411 self.inner.pfn_free = pfn_free;
1412 self
1413 }
pfn_internal_allocation( mut self, pfn_internal_allocation: PFN_vkInternalAllocationNotification, ) -> Self1414 pub fn pfn_internal_allocation(
1415 mut self,
1416 pfn_internal_allocation: PFN_vkInternalAllocationNotification,
1417 ) -> Self {
1418 self.inner.pfn_internal_allocation = pfn_internal_allocation;
1419 self
1420 }
pfn_internal_free(mut self, pfn_internal_free: PFN_vkInternalFreeNotification) -> Self1421 pub fn pfn_internal_free(mut self, pfn_internal_free: PFN_vkInternalFreeNotification) -> Self {
1422 self.inner.pfn_internal_free = pfn_internal_free;
1423 self
1424 }
1425 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1426 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1427 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> AllocationCallbacks1428 pub fn build(self) -> AllocationCallbacks {
1429 self.inner
1430 }
1431 }
1432 #[repr(C)]
1433 #[cfg_attr(feature = "debug", derive(Debug))]
1434 #[derive(Copy, Clone)]
1435 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceQueueCreateInfo.html>"]
1436 pub struct DeviceQueueCreateInfo {
1437 pub s_type: StructureType,
1438 pub p_next: *const c_void,
1439 pub flags: DeviceQueueCreateFlags,
1440 pub queue_family_index: u32,
1441 pub queue_count: u32,
1442 pub p_queue_priorities: *const f32,
1443 }
1444 impl ::std::default::Default for DeviceQueueCreateInfo {
default() -> Self1445 fn default() -> Self {
1446 Self {
1447 s_type: StructureType::DEVICE_QUEUE_CREATE_INFO,
1448 p_next: ::std::ptr::null(),
1449 flags: DeviceQueueCreateFlags::default(),
1450 queue_family_index: u32::default(),
1451 queue_count: u32::default(),
1452 p_queue_priorities: ::std::ptr::null(),
1453 }
1454 }
1455 }
1456 impl DeviceQueueCreateInfo {
builder<'a>() -> DeviceQueueCreateInfoBuilder<'a>1457 pub fn builder<'a>() -> DeviceQueueCreateInfoBuilder<'a> {
1458 DeviceQueueCreateInfoBuilder {
1459 inner: Self::default(),
1460 marker: ::std::marker::PhantomData,
1461 }
1462 }
1463 }
1464 #[repr(transparent)]
1465 pub struct DeviceQueueCreateInfoBuilder<'a> {
1466 inner: DeviceQueueCreateInfo,
1467 marker: ::std::marker::PhantomData<&'a ()>,
1468 }
1469 pub unsafe trait ExtendsDeviceQueueCreateInfo {}
1470 impl<'a> ::std::ops::Deref for DeviceQueueCreateInfoBuilder<'a> {
1471 type Target = DeviceQueueCreateInfo;
deref(&self) -> &Self::Target1472 fn deref(&self) -> &Self::Target {
1473 &self.inner
1474 }
1475 }
1476 impl<'a> ::std::ops::DerefMut for DeviceQueueCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1477 fn deref_mut(&mut self) -> &mut Self::Target {
1478 &mut self.inner
1479 }
1480 }
1481 impl<'a> DeviceQueueCreateInfoBuilder<'a> {
flags(mut self, flags: DeviceQueueCreateFlags) -> Self1482 pub fn flags(mut self, flags: DeviceQueueCreateFlags) -> Self {
1483 self.inner.flags = flags;
1484 self
1485 }
queue_family_index(mut self, queue_family_index: u32) -> Self1486 pub fn queue_family_index(mut self, queue_family_index: u32) -> Self {
1487 self.inner.queue_family_index = queue_family_index;
1488 self
1489 }
queue_priorities(mut self, queue_priorities: &'a [f32]) -> Self1490 pub fn queue_priorities(mut self, queue_priorities: &'a [f32]) -> Self {
1491 self.inner.queue_count = queue_priorities.len() as _;
1492 self.inner.p_queue_priorities = queue_priorities.as_ptr();
1493 self
1494 }
1495 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
1496 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
1497 #[doc = r" valid extension structs can be pushed into the chain."]
1498 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
1499 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsDeviceQueueCreateInfo>(mut self, next: &'a mut T) -> Self1500 pub fn push_next<T: ExtendsDeviceQueueCreateInfo>(mut self, next: &'a mut T) -> Self {
1501 unsafe {
1502 let next_ptr = next as *mut T as *mut BaseOutStructure;
1503 let last_next = ptr_chain_iter(next).last().unwrap();
1504 (*last_next).p_next = self.inner.p_next as _;
1505 self.inner.p_next = next_ptr as _;
1506 }
1507 self
1508 }
1509 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1510 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1511 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DeviceQueueCreateInfo1512 pub fn build(self) -> DeviceQueueCreateInfo {
1513 self.inner
1514 }
1515 }
1516 #[repr(C)]
1517 #[cfg_attr(feature = "debug", derive(Debug))]
1518 #[derive(Copy, Clone)]
1519 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceCreateInfo.html>"]
1520 pub struct DeviceCreateInfo {
1521 pub s_type: StructureType,
1522 pub p_next: *const c_void,
1523 pub flags: DeviceCreateFlags,
1524 pub queue_create_info_count: u32,
1525 pub p_queue_create_infos: *const DeviceQueueCreateInfo,
1526 pub enabled_layer_count: u32,
1527 pub pp_enabled_layer_names: *const *const c_char,
1528 pub enabled_extension_count: u32,
1529 pub pp_enabled_extension_names: *const *const c_char,
1530 pub p_enabled_features: *const PhysicalDeviceFeatures,
1531 }
1532 impl ::std::default::Default for DeviceCreateInfo {
default() -> Self1533 fn default() -> Self {
1534 Self {
1535 s_type: StructureType::DEVICE_CREATE_INFO,
1536 p_next: ::std::ptr::null(),
1537 flags: DeviceCreateFlags::default(),
1538 queue_create_info_count: u32::default(),
1539 p_queue_create_infos: ::std::ptr::null(),
1540 enabled_layer_count: u32::default(),
1541 pp_enabled_layer_names: ::std::ptr::null(),
1542 enabled_extension_count: u32::default(),
1543 pp_enabled_extension_names: ::std::ptr::null(),
1544 p_enabled_features: ::std::ptr::null(),
1545 }
1546 }
1547 }
1548 impl DeviceCreateInfo {
builder<'a>() -> DeviceCreateInfoBuilder<'a>1549 pub fn builder<'a>() -> DeviceCreateInfoBuilder<'a> {
1550 DeviceCreateInfoBuilder {
1551 inner: Self::default(),
1552 marker: ::std::marker::PhantomData,
1553 }
1554 }
1555 }
1556 #[repr(transparent)]
1557 pub struct DeviceCreateInfoBuilder<'a> {
1558 inner: DeviceCreateInfo,
1559 marker: ::std::marker::PhantomData<&'a ()>,
1560 }
1561 pub unsafe trait ExtendsDeviceCreateInfo {}
1562 impl<'a> ::std::ops::Deref for DeviceCreateInfoBuilder<'a> {
1563 type Target = DeviceCreateInfo;
deref(&self) -> &Self::Target1564 fn deref(&self) -> &Self::Target {
1565 &self.inner
1566 }
1567 }
1568 impl<'a> ::std::ops::DerefMut for DeviceCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1569 fn deref_mut(&mut self) -> &mut Self::Target {
1570 &mut self.inner
1571 }
1572 }
1573 impl<'a> DeviceCreateInfoBuilder<'a> {
flags(mut self, flags: DeviceCreateFlags) -> Self1574 pub fn flags(mut self, flags: DeviceCreateFlags) -> Self {
1575 self.inner.flags = flags;
1576 self
1577 }
queue_create_infos(mut self, queue_create_infos: &'a [DeviceQueueCreateInfo]) -> Self1578 pub fn queue_create_infos(mut self, queue_create_infos: &'a [DeviceQueueCreateInfo]) -> Self {
1579 self.inner.queue_create_info_count = queue_create_infos.len() as _;
1580 self.inner.p_queue_create_infos = queue_create_infos.as_ptr();
1581 self
1582 }
enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self1583 pub fn enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self {
1584 self.inner.enabled_layer_count = enabled_layer_names.len() as _;
1585 self.inner.pp_enabled_layer_names = enabled_layer_names.as_ptr();
1586 self
1587 }
enabled_extension_names(mut self, enabled_extension_names: &'a [*const c_char]) -> Self1588 pub fn enabled_extension_names(mut self, enabled_extension_names: &'a [*const c_char]) -> Self {
1589 self.inner.enabled_extension_count = enabled_extension_names.len() as _;
1590 self.inner.pp_enabled_extension_names = enabled_extension_names.as_ptr();
1591 self
1592 }
enabled_features(mut self, enabled_features: &'a PhysicalDeviceFeatures) -> Self1593 pub fn enabled_features(mut self, enabled_features: &'a PhysicalDeviceFeatures) -> Self {
1594 self.inner.p_enabled_features = enabled_features;
1595 self
1596 }
1597 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
1598 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
1599 #[doc = r" valid extension structs can be pushed into the chain."]
1600 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
1601 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsDeviceCreateInfo>(mut self, next: &'a mut T) -> Self1602 pub fn push_next<T: ExtendsDeviceCreateInfo>(mut self, next: &'a mut T) -> Self {
1603 unsafe {
1604 let next_ptr = next as *mut T as *mut BaseOutStructure;
1605 let last_next = ptr_chain_iter(next).last().unwrap();
1606 (*last_next).p_next = self.inner.p_next as _;
1607 self.inner.p_next = next_ptr as _;
1608 }
1609 self
1610 }
1611 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1612 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1613 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DeviceCreateInfo1614 pub fn build(self) -> DeviceCreateInfo {
1615 self.inner
1616 }
1617 }
1618 #[repr(C)]
1619 #[cfg_attr(feature = "debug", derive(Debug))]
1620 #[derive(Copy, Clone)]
1621 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkInstanceCreateInfo.html>"]
1622 pub struct InstanceCreateInfo {
1623 pub s_type: StructureType,
1624 pub p_next: *const c_void,
1625 pub flags: InstanceCreateFlags,
1626 pub p_application_info: *const ApplicationInfo,
1627 pub enabled_layer_count: u32,
1628 pub pp_enabled_layer_names: *const *const c_char,
1629 pub enabled_extension_count: u32,
1630 pub pp_enabled_extension_names: *const *const c_char,
1631 }
1632 impl ::std::default::Default for InstanceCreateInfo {
default() -> Self1633 fn default() -> Self {
1634 Self {
1635 s_type: StructureType::INSTANCE_CREATE_INFO,
1636 p_next: ::std::ptr::null(),
1637 flags: InstanceCreateFlags::default(),
1638 p_application_info: ::std::ptr::null(),
1639 enabled_layer_count: u32::default(),
1640 pp_enabled_layer_names: ::std::ptr::null(),
1641 enabled_extension_count: u32::default(),
1642 pp_enabled_extension_names: ::std::ptr::null(),
1643 }
1644 }
1645 }
1646 impl InstanceCreateInfo {
builder<'a>() -> InstanceCreateInfoBuilder<'a>1647 pub fn builder<'a>() -> InstanceCreateInfoBuilder<'a> {
1648 InstanceCreateInfoBuilder {
1649 inner: Self::default(),
1650 marker: ::std::marker::PhantomData,
1651 }
1652 }
1653 }
1654 #[repr(transparent)]
1655 pub struct InstanceCreateInfoBuilder<'a> {
1656 inner: InstanceCreateInfo,
1657 marker: ::std::marker::PhantomData<&'a ()>,
1658 }
1659 pub unsafe trait ExtendsInstanceCreateInfo {}
1660 impl<'a> ::std::ops::Deref for InstanceCreateInfoBuilder<'a> {
1661 type Target = InstanceCreateInfo;
deref(&self) -> &Self::Target1662 fn deref(&self) -> &Self::Target {
1663 &self.inner
1664 }
1665 }
1666 impl<'a> ::std::ops::DerefMut for InstanceCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1667 fn deref_mut(&mut self) -> &mut Self::Target {
1668 &mut self.inner
1669 }
1670 }
1671 impl<'a> InstanceCreateInfoBuilder<'a> {
flags(mut self, flags: InstanceCreateFlags) -> Self1672 pub fn flags(mut self, flags: InstanceCreateFlags) -> Self {
1673 self.inner.flags = flags;
1674 self
1675 }
application_info(mut self, application_info: &'a ApplicationInfo) -> Self1676 pub fn application_info(mut self, application_info: &'a ApplicationInfo) -> Self {
1677 self.inner.p_application_info = application_info;
1678 self
1679 }
enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self1680 pub fn enabled_layer_names(mut self, enabled_layer_names: &'a [*const c_char]) -> Self {
1681 self.inner.enabled_layer_count = enabled_layer_names.len() as _;
1682 self.inner.pp_enabled_layer_names = enabled_layer_names.as_ptr();
1683 self
1684 }
enabled_extension_names(mut self, enabled_extension_names: &'a [*const c_char]) -> Self1685 pub fn enabled_extension_names(mut self, enabled_extension_names: &'a [*const c_char]) -> Self {
1686 self.inner.enabled_extension_count = enabled_extension_names.len() as _;
1687 self.inner.pp_enabled_extension_names = enabled_extension_names.as_ptr();
1688 self
1689 }
1690 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
1691 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
1692 #[doc = r" valid extension structs can be pushed into the chain."]
1693 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
1694 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsInstanceCreateInfo>(mut self, next: &'a mut T) -> Self1695 pub fn push_next<T: ExtendsInstanceCreateInfo>(mut self, next: &'a mut T) -> Self {
1696 unsafe {
1697 let next_ptr = next as *mut T as *mut BaseOutStructure;
1698 let last_next = ptr_chain_iter(next).last().unwrap();
1699 (*last_next).p_next = self.inner.p_next as _;
1700 self.inner.p_next = next_ptr as _;
1701 }
1702 self
1703 }
1704 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1705 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1706 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> InstanceCreateInfo1707 pub fn build(self) -> InstanceCreateInfo {
1708 self.inner
1709 }
1710 }
1711 #[repr(C)]
1712 #[cfg_attr(feature = "debug", derive(Debug))]
1713 #[derive(Copy, Clone, Default)]
1714 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueueFamilyProperties.html>"]
1715 pub struct QueueFamilyProperties {
1716 pub queue_flags: QueueFlags,
1717 pub queue_count: u32,
1718 pub timestamp_valid_bits: u32,
1719 pub min_image_transfer_granularity: Extent3D,
1720 }
1721 impl QueueFamilyProperties {
builder<'a>() -> QueueFamilyPropertiesBuilder<'a>1722 pub fn builder<'a>() -> QueueFamilyPropertiesBuilder<'a> {
1723 QueueFamilyPropertiesBuilder {
1724 inner: Self::default(),
1725 marker: ::std::marker::PhantomData,
1726 }
1727 }
1728 }
1729 #[repr(transparent)]
1730 pub struct QueueFamilyPropertiesBuilder<'a> {
1731 inner: QueueFamilyProperties,
1732 marker: ::std::marker::PhantomData<&'a ()>,
1733 }
1734 impl<'a> ::std::ops::Deref for QueueFamilyPropertiesBuilder<'a> {
1735 type Target = QueueFamilyProperties;
deref(&self) -> &Self::Target1736 fn deref(&self) -> &Self::Target {
1737 &self.inner
1738 }
1739 }
1740 impl<'a> ::std::ops::DerefMut for QueueFamilyPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1741 fn deref_mut(&mut self) -> &mut Self::Target {
1742 &mut self.inner
1743 }
1744 }
1745 impl<'a> QueueFamilyPropertiesBuilder<'a> {
queue_flags(mut self, queue_flags: QueueFlags) -> Self1746 pub fn queue_flags(mut self, queue_flags: QueueFlags) -> Self {
1747 self.inner.queue_flags = queue_flags;
1748 self
1749 }
queue_count(mut self, queue_count: u32) -> Self1750 pub fn queue_count(mut self, queue_count: u32) -> Self {
1751 self.inner.queue_count = queue_count;
1752 self
1753 }
timestamp_valid_bits(mut self, timestamp_valid_bits: u32) -> Self1754 pub fn timestamp_valid_bits(mut self, timestamp_valid_bits: u32) -> Self {
1755 self.inner.timestamp_valid_bits = timestamp_valid_bits;
1756 self
1757 }
min_image_transfer_granularity( mut self, min_image_transfer_granularity: Extent3D, ) -> Self1758 pub fn min_image_transfer_granularity(
1759 mut self,
1760 min_image_transfer_granularity: Extent3D,
1761 ) -> Self {
1762 self.inner.min_image_transfer_granularity = min_image_transfer_granularity;
1763 self
1764 }
1765 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1766 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1767 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> QueueFamilyProperties1768 pub fn build(self) -> QueueFamilyProperties {
1769 self.inner
1770 }
1771 }
1772 #[repr(C)]
1773 #[cfg_attr(feature = "debug", derive(Debug))]
1774 #[derive(Copy, Clone)]
1775 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceMemoryProperties.html>"]
1776 pub struct PhysicalDeviceMemoryProperties {
1777 pub memory_type_count: u32,
1778 pub memory_types: [MemoryType; MAX_MEMORY_TYPES],
1779 pub memory_heap_count: u32,
1780 pub memory_heaps: [MemoryHeap; MAX_MEMORY_HEAPS],
1781 }
1782 impl ::std::default::Default for PhysicalDeviceMemoryProperties {
default() -> Self1783 fn default() -> Self {
1784 Self {
1785 memory_type_count: u32::default(),
1786 memory_types: unsafe { ::std::mem::zeroed() },
1787 memory_heap_count: u32::default(),
1788 memory_heaps: unsafe { ::std::mem::zeroed() },
1789 }
1790 }
1791 }
1792 impl PhysicalDeviceMemoryProperties {
builder<'a>() -> PhysicalDeviceMemoryPropertiesBuilder<'a>1793 pub fn builder<'a>() -> PhysicalDeviceMemoryPropertiesBuilder<'a> {
1794 PhysicalDeviceMemoryPropertiesBuilder {
1795 inner: Self::default(),
1796 marker: ::std::marker::PhantomData,
1797 }
1798 }
1799 }
1800 #[repr(transparent)]
1801 pub struct PhysicalDeviceMemoryPropertiesBuilder<'a> {
1802 inner: PhysicalDeviceMemoryProperties,
1803 marker: ::std::marker::PhantomData<&'a ()>,
1804 }
1805 impl<'a> ::std::ops::Deref for PhysicalDeviceMemoryPropertiesBuilder<'a> {
1806 type Target = PhysicalDeviceMemoryProperties;
deref(&self) -> &Self::Target1807 fn deref(&self) -> &Self::Target {
1808 &self.inner
1809 }
1810 }
1811 impl<'a> ::std::ops::DerefMut for PhysicalDeviceMemoryPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1812 fn deref_mut(&mut self) -> &mut Self::Target {
1813 &mut self.inner
1814 }
1815 }
1816 impl<'a> PhysicalDeviceMemoryPropertiesBuilder<'a> {
memory_type_count(mut self, memory_type_count: u32) -> Self1817 pub fn memory_type_count(mut self, memory_type_count: u32) -> Self {
1818 self.inner.memory_type_count = memory_type_count;
1819 self
1820 }
memory_types(mut self, memory_types: [MemoryType; MAX_MEMORY_TYPES]) -> Self1821 pub fn memory_types(mut self, memory_types: [MemoryType; MAX_MEMORY_TYPES]) -> Self {
1822 self.inner.memory_types = memory_types;
1823 self
1824 }
memory_heap_count(mut self, memory_heap_count: u32) -> Self1825 pub fn memory_heap_count(mut self, memory_heap_count: u32) -> Self {
1826 self.inner.memory_heap_count = memory_heap_count;
1827 self
1828 }
memory_heaps(mut self, memory_heaps: [MemoryHeap; MAX_MEMORY_HEAPS]) -> Self1829 pub fn memory_heaps(mut self, memory_heaps: [MemoryHeap; MAX_MEMORY_HEAPS]) -> Self {
1830 self.inner.memory_heaps = memory_heaps;
1831 self
1832 }
1833 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1834 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1835 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PhysicalDeviceMemoryProperties1836 pub fn build(self) -> PhysicalDeviceMemoryProperties {
1837 self.inner
1838 }
1839 }
1840 #[repr(C)]
1841 #[cfg_attr(feature = "debug", derive(Debug))]
1842 #[derive(Copy, Clone)]
1843 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryAllocateInfo.html>"]
1844 pub struct MemoryAllocateInfo {
1845 pub s_type: StructureType,
1846 pub p_next: *const c_void,
1847 pub allocation_size: DeviceSize,
1848 pub memory_type_index: u32,
1849 }
1850 impl ::std::default::Default for MemoryAllocateInfo {
default() -> Self1851 fn default() -> Self {
1852 Self {
1853 s_type: StructureType::MEMORY_ALLOCATE_INFO,
1854 p_next: ::std::ptr::null(),
1855 allocation_size: DeviceSize::default(),
1856 memory_type_index: u32::default(),
1857 }
1858 }
1859 }
1860 impl MemoryAllocateInfo {
builder<'a>() -> MemoryAllocateInfoBuilder<'a>1861 pub fn builder<'a>() -> MemoryAllocateInfoBuilder<'a> {
1862 MemoryAllocateInfoBuilder {
1863 inner: Self::default(),
1864 marker: ::std::marker::PhantomData,
1865 }
1866 }
1867 }
1868 #[repr(transparent)]
1869 pub struct MemoryAllocateInfoBuilder<'a> {
1870 inner: MemoryAllocateInfo,
1871 marker: ::std::marker::PhantomData<&'a ()>,
1872 }
1873 pub unsafe trait ExtendsMemoryAllocateInfo {}
1874 impl<'a> ::std::ops::Deref for MemoryAllocateInfoBuilder<'a> {
1875 type Target = MemoryAllocateInfo;
deref(&self) -> &Self::Target1876 fn deref(&self) -> &Self::Target {
1877 &self.inner
1878 }
1879 }
1880 impl<'a> ::std::ops::DerefMut for MemoryAllocateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1881 fn deref_mut(&mut self) -> &mut Self::Target {
1882 &mut self.inner
1883 }
1884 }
1885 impl<'a> MemoryAllocateInfoBuilder<'a> {
allocation_size(mut self, allocation_size: DeviceSize) -> Self1886 pub fn allocation_size(mut self, allocation_size: DeviceSize) -> Self {
1887 self.inner.allocation_size = allocation_size;
1888 self
1889 }
memory_type_index(mut self, memory_type_index: u32) -> Self1890 pub fn memory_type_index(mut self, memory_type_index: u32) -> Self {
1891 self.inner.memory_type_index = memory_type_index;
1892 self
1893 }
1894 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
1895 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
1896 #[doc = r" valid extension structs can be pushed into the chain."]
1897 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
1898 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsMemoryAllocateInfo>(mut self, next: &'a mut T) -> Self1899 pub fn push_next<T: ExtendsMemoryAllocateInfo>(mut self, next: &'a mut T) -> Self {
1900 unsafe {
1901 let next_ptr = next as *mut T as *mut BaseOutStructure;
1902 let last_next = ptr_chain_iter(next).last().unwrap();
1903 (*last_next).p_next = self.inner.p_next as _;
1904 self.inner.p_next = next_ptr as _;
1905 }
1906 self
1907 }
1908 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1909 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1910 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MemoryAllocateInfo1911 pub fn build(self) -> MemoryAllocateInfo {
1912 self.inner
1913 }
1914 }
1915 #[repr(C)]
1916 #[cfg_attr(feature = "debug", derive(Debug))]
1917 #[derive(Copy, Clone, Default)]
1918 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryRequirements.html>"]
1919 pub struct MemoryRequirements {
1920 pub size: DeviceSize,
1921 pub alignment: DeviceSize,
1922 pub memory_type_bits: u32,
1923 }
1924 impl MemoryRequirements {
builder<'a>() -> MemoryRequirementsBuilder<'a>1925 pub fn builder<'a>() -> MemoryRequirementsBuilder<'a> {
1926 MemoryRequirementsBuilder {
1927 inner: Self::default(),
1928 marker: ::std::marker::PhantomData,
1929 }
1930 }
1931 }
1932 #[repr(transparent)]
1933 pub struct MemoryRequirementsBuilder<'a> {
1934 inner: MemoryRequirements,
1935 marker: ::std::marker::PhantomData<&'a ()>,
1936 }
1937 impl<'a> ::std::ops::Deref for MemoryRequirementsBuilder<'a> {
1938 type Target = MemoryRequirements;
deref(&self) -> &Self::Target1939 fn deref(&self) -> &Self::Target {
1940 &self.inner
1941 }
1942 }
1943 impl<'a> ::std::ops::DerefMut for MemoryRequirementsBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1944 fn deref_mut(&mut self) -> &mut Self::Target {
1945 &mut self.inner
1946 }
1947 }
1948 impl<'a> MemoryRequirementsBuilder<'a> {
size(mut self, size: DeviceSize) -> Self1949 pub fn size(mut self, size: DeviceSize) -> Self {
1950 self.inner.size = size;
1951 self
1952 }
alignment(mut self, alignment: DeviceSize) -> Self1953 pub fn alignment(mut self, alignment: DeviceSize) -> Self {
1954 self.inner.alignment = alignment;
1955 self
1956 }
memory_type_bits(mut self, memory_type_bits: u32) -> Self1957 pub fn memory_type_bits(mut self, memory_type_bits: u32) -> Self {
1958 self.inner.memory_type_bits = memory_type_bits;
1959 self
1960 }
1961 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
1962 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
1963 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MemoryRequirements1964 pub fn build(self) -> MemoryRequirements {
1965 self.inner
1966 }
1967 }
1968 #[repr(C)]
1969 #[cfg_attr(feature = "debug", derive(Debug))]
1970 #[derive(Copy, Clone, Default)]
1971 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageFormatProperties.html>"]
1972 pub struct SparseImageFormatProperties {
1973 pub aspect_mask: ImageAspectFlags,
1974 pub image_granularity: Extent3D,
1975 pub flags: SparseImageFormatFlags,
1976 }
1977 impl SparseImageFormatProperties {
builder<'a>() -> SparseImageFormatPropertiesBuilder<'a>1978 pub fn builder<'a>() -> SparseImageFormatPropertiesBuilder<'a> {
1979 SparseImageFormatPropertiesBuilder {
1980 inner: Self::default(),
1981 marker: ::std::marker::PhantomData,
1982 }
1983 }
1984 }
1985 #[repr(transparent)]
1986 pub struct SparseImageFormatPropertiesBuilder<'a> {
1987 inner: SparseImageFormatProperties,
1988 marker: ::std::marker::PhantomData<&'a ()>,
1989 }
1990 impl<'a> ::std::ops::Deref for SparseImageFormatPropertiesBuilder<'a> {
1991 type Target = SparseImageFormatProperties;
deref(&self) -> &Self::Target1992 fn deref(&self) -> &Self::Target {
1993 &self.inner
1994 }
1995 }
1996 impl<'a> ::std::ops::DerefMut for SparseImageFormatPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target1997 fn deref_mut(&mut self) -> &mut Self::Target {
1998 &mut self.inner
1999 }
2000 }
2001 impl<'a> SparseImageFormatPropertiesBuilder<'a> {
aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self2002 pub fn aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self {
2003 self.inner.aspect_mask = aspect_mask;
2004 self
2005 }
image_granularity(mut self, image_granularity: Extent3D) -> Self2006 pub fn image_granularity(mut self, image_granularity: Extent3D) -> Self {
2007 self.inner.image_granularity = image_granularity;
2008 self
2009 }
flags(mut self, flags: SparseImageFormatFlags) -> Self2010 pub fn flags(mut self, flags: SparseImageFormatFlags) -> Self {
2011 self.inner.flags = flags;
2012 self
2013 }
2014 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2015 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2016 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseImageFormatProperties2017 pub fn build(self) -> SparseImageFormatProperties {
2018 self.inner
2019 }
2020 }
2021 #[repr(C)]
2022 #[cfg_attr(feature = "debug", derive(Debug))]
2023 #[derive(Copy, Clone, Default)]
2024 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageMemoryRequirements.html>"]
2025 pub struct SparseImageMemoryRequirements {
2026 pub format_properties: SparseImageFormatProperties,
2027 pub image_mip_tail_first_lod: u32,
2028 pub image_mip_tail_size: DeviceSize,
2029 pub image_mip_tail_offset: DeviceSize,
2030 pub image_mip_tail_stride: DeviceSize,
2031 }
2032 impl SparseImageMemoryRequirements {
builder<'a>() -> SparseImageMemoryRequirementsBuilder<'a>2033 pub fn builder<'a>() -> SparseImageMemoryRequirementsBuilder<'a> {
2034 SparseImageMemoryRequirementsBuilder {
2035 inner: Self::default(),
2036 marker: ::std::marker::PhantomData,
2037 }
2038 }
2039 }
2040 #[repr(transparent)]
2041 pub struct SparseImageMemoryRequirementsBuilder<'a> {
2042 inner: SparseImageMemoryRequirements,
2043 marker: ::std::marker::PhantomData<&'a ()>,
2044 }
2045 impl<'a> ::std::ops::Deref for SparseImageMemoryRequirementsBuilder<'a> {
2046 type Target = SparseImageMemoryRequirements;
deref(&self) -> &Self::Target2047 fn deref(&self) -> &Self::Target {
2048 &self.inner
2049 }
2050 }
2051 impl<'a> ::std::ops::DerefMut for SparseImageMemoryRequirementsBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2052 fn deref_mut(&mut self) -> &mut Self::Target {
2053 &mut self.inner
2054 }
2055 }
2056 impl<'a> SparseImageMemoryRequirementsBuilder<'a> {
format_properties(mut self, format_properties: SparseImageFormatProperties) -> Self2057 pub fn format_properties(mut self, format_properties: SparseImageFormatProperties) -> Self {
2058 self.inner.format_properties = format_properties;
2059 self
2060 }
image_mip_tail_first_lod(mut self, image_mip_tail_first_lod: u32) -> Self2061 pub fn image_mip_tail_first_lod(mut self, image_mip_tail_first_lod: u32) -> Self {
2062 self.inner.image_mip_tail_first_lod = image_mip_tail_first_lod;
2063 self
2064 }
image_mip_tail_size(mut self, image_mip_tail_size: DeviceSize) -> Self2065 pub fn image_mip_tail_size(mut self, image_mip_tail_size: DeviceSize) -> Self {
2066 self.inner.image_mip_tail_size = image_mip_tail_size;
2067 self
2068 }
image_mip_tail_offset(mut self, image_mip_tail_offset: DeviceSize) -> Self2069 pub fn image_mip_tail_offset(mut self, image_mip_tail_offset: DeviceSize) -> Self {
2070 self.inner.image_mip_tail_offset = image_mip_tail_offset;
2071 self
2072 }
image_mip_tail_stride(mut self, image_mip_tail_stride: DeviceSize) -> Self2073 pub fn image_mip_tail_stride(mut self, image_mip_tail_stride: DeviceSize) -> Self {
2074 self.inner.image_mip_tail_stride = image_mip_tail_stride;
2075 self
2076 }
2077 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2078 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2079 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseImageMemoryRequirements2080 pub fn build(self) -> SparseImageMemoryRequirements {
2081 self.inner
2082 }
2083 }
2084 #[repr(C)]
2085 #[cfg_attr(feature = "debug", derive(Debug))]
2086 #[derive(Copy, Clone, Default)]
2087 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryType.html>"]
2088 pub struct MemoryType {
2089 pub property_flags: MemoryPropertyFlags,
2090 pub heap_index: u32,
2091 }
2092 impl MemoryType {
builder<'a>() -> MemoryTypeBuilder<'a>2093 pub fn builder<'a>() -> MemoryTypeBuilder<'a> {
2094 MemoryTypeBuilder {
2095 inner: Self::default(),
2096 marker: ::std::marker::PhantomData,
2097 }
2098 }
2099 }
2100 #[repr(transparent)]
2101 pub struct MemoryTypeBuilder<'a> {
2102 inner: MemoryType,
2103 marker: ::std::marker::PhantomData<&'a ()>,
2104 }
2105 impl<'a> ::std::ops::Deref for MemoryTypeBuilder<'a> {
2106 type Target = MemoryType;
deref(&self) -> &Self::Target2107 fn deref(&self) -> &Self::Target {
2108 &self.inner
2109 }
2110 }
2111 impl<'a> ::std::ops::DerefMut for MemoryTypeBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2112 fn deref_mut(&mut self) -> &mut Self::Target {
2113 &mut self.inner
2114 }
2115 }
2116 impl<'a> MemoryTypeBuilder<'a> {
property_flags(mut self, property_flags: MemoryPropertyFlags) -> Self2117 pub fn property_flags(mut self, property_flags: MemoryPropertyFlags) -> Self {
2118 self.inner.property_flags = property_flags;
2119 self
2120 }
heap_index(mut self, heap_index: u32) -> Self2121 pub fn heap_index(mut self, heap_index: u32) -> Self {
2122 self.inner.heap_index = heap_index;
2123 self
2124 }
2125 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2126 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2127 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MemoryType2128 pub fn build(self) -> MemoryType {
2129 self.inner
2130 }
2131 }
2132 #[repr(C)]
2133 #[cfg_attr(feature = "debug", derive(Debug))]
2134 #[derive(Copy, Clone, Default)]
2135 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryHeap.html>"]
2136 pub struct MemoryHeap {
2137 pub size: DeviceSize,
2138 pub flags: MemoryHeapFlags,
2139 }
2140 impl MemoryHeap {
builder<'a>() -> MemoryHeapBuilder<'a>2141 pub fn builder<'a>() -> MemoryHeapBuilder<'a> {
2142 MemoryHeapBuilder {
2143 inner: Self::default(),
2144 marker: ::std::marker::PhantomData,
2145 }
2146 }
2147 }
2148 #[repr(transparent)]
2149 pub struct MemoryHeapBuilder<'a> {
2150 inner: MemoryHeap,
2151 marker: ::std::marker::PhantomData<&'a ()>,
2152 }
2153 impl<'a> ::std::ops::Deref for MemoryHeapBuilder<'a> {
2154 type Target = MemoryHeap;
deref(&self) -> &Self::Target2155 fn deref(&self) -> &Self::Target {
2156 &self.inner
2157 }
2158 }
2159 impl<'a> ::std::ops::DerefMut for MemoryHeapBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2160 fn deref_mut(&mut self) -> &mut Self::Target {
2161 &mut self.inner
2162 }
2163 }
2164 impl<'a> MemoryHeapBuilder<'a> {
size(mut self, size: DeviceSize) -> Self2165 pub fn size(mut self, size: DeviceSize) -> Self {
2166 self.inner.size = size;
2167 self
2168 }
flags(mut self, flags: MemoryHeapFlags) -> Self2169 pub fn flags(mut self, flags: MemoryHeapFlags) -> Self {
2170 self.inner.flags = flags;
2171 self
2172 }
2173 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2174 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2175 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MemoryHeap2176 pub fn build(self) -> MemoryHeap {
2177 self.inner
2178 }
2179 }
2180 #[repr(C)]
2181 #[cfg_attr(feature = "debug", derive(Debug))]
2182 #[derive(Copy, Clone)]
2183 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMappedMemoryRange.html>"]
2184 pub struct MappedMemoryRange {
2185 pub s_type: StructureType,
2186 pub p_next: *const c_void,
2187 pub memory: DeviceMemory,
2188 pub offset: DeviceSize,
2189 pub size: DeviceSize,
2190 }
2191 impl ::std::default::Default for MappedMemoryRange {
default() -> Self2192 fn default() -> Self {
2193 Self {
2194 s_type: StructureType::MAPPED_MEMORY_RANGE,
2195 p_next: ::std::ptr::null(),
2196 memory: DeviceMemory::default(),
2197 offset: DeviceSize::default(),
2198 size: DeviceSize::default(),
2199 }
2200 }
2201 }
2202 impl MappedMemoryRange {
builder<'a>() -> MappedMemoryRangeBuilder<'a>2203 pub fn builder<'a>() -> MappedMemoryRangeBuilder<'a> {
2204 MappedMemoryRangeBuilder {
2205 inner: Self::default(),
2206 marker: ::std::marker::PhantomData,
2207 }
2208 }
2209 }
2210 #[repr(transparent)]
2211 pub struct MappedMemoryRangeBuilder<'a> {
2212 inner: MappedMemoryRange,
2213 marker: ::std::marker::PhantomData<&'a ()>,
2214 }
2215 impl<'a> ::std::ops::Deref for MappedMemoryRangeBuilder<'a> {
2216 type Target = MappedMemoryRange;
deref(&self) -> &Self::Target2217 fn deref(&self) -> &Self::Target {
2218 &self.inner
2219 }
2220 }
2221 impl<'a> ::std::ops::DerefMut for MappedMemoryRangeBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2222 fn deref_mut(&mut self) -> &mut Self::Target {
2223 &mut self.inner
2224 }
2225 }
2226 impl<'a> MappedMemoryRangeBuilder<'a> {
memory(mut self, memory: DeviceMemory) -> Self2227 pub fn memory(mut self, memory: DeviceMemory) -> Self {
2228 self.inner.memory = memory;
2229 self
2230 }
offset(mut self, offset: DeviceSize) -> Self2231 pub fn offset(mut self, offset: DeviceSize) -> Self {
2232 self.inner.offset = offset;
2233 self
2234 }
size(mut self, size: DeviceSize) -> Self2235 pub fn size(mut self, size: DeviceSize) -> Self {
2236 self.inner.size = size;
2237 self
2238 }
2239 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2240 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2241 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MappedMemoryRange2242 pub fn build(self) -> MappedMemoryRange {
2243 self.inner
2244 }
2245 }
2246 #[repr(C)]
2247 #[cfg_attr(feature = "debug", derive(Debug))]
2248 #[derive(Copy, Clone, Default)]
2249 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFormatProperties.html>"]
2250 pub struct FormatProperties {
2251 pub linear_tiling_features: FormatFeatureFlags,
2252 pub optimal_tiling_features: FormatFeatureFlags,
2253 pub buffer_features: FormatFeatureFlags,
2254 }
2255 impl FormatProperties {
builder<'a>() -> FormatPropertiesBuilder<'a>2256 pub fn builder<'a>() -> FormatPropertiesBuilder<'a> {
2257 FormatPropertiesBuilder {
2258 inner: Self::default(),
2259 marker: ::std::marker::PhantomData,
2260 }
2261 }
2262 }
2263 #[repr(transparent)]
2264 pub struct FormatPropertiesBuilder<'a> {
2265 inner: FormatProperties,
2266 marker: ::std::marker::PhantomData<&'a ()>,
2267 }
2268 impl<'a> ::std::ops::Deref for FormatPropertiesBuilder<'a> {
2269 type Target = FormatProperties;
deref(&self) -> &Self::Target2270 fn deref(&self) -> &Self::Target {
2271 &self.inner
2272 }
2273 }
2274 impl<'a> ::std::ops::DerefMut for FormatPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2275 fn deref_mut(&mut self) -> &mut Self::Target {
2276 &mut self.inner
2277 }
2278 }
2279 impl<'a> FormatPropertiesBuilder<'a> {
linear_tiling_features(mut self, linear_tiling_features: FormatFeatureFlags) -> Self2280 pub fn linear_tiling_features(mut self, linear_tiling_features: FormatFeatureFlags) -> Self {
2281 self.inner.linear_tiling_features = linear_tiling_features;
2282 self
2283 }
optimal_tiling_features(mut self, optimal_tiling_features: FormatFeatureFlags) -> Self2284 pub fn optimal_tiling_features(mut self, optimal_tiling_features: FormatFeatureFlags) -> Self {
2285 self.inner.optimal_tiling_features = optimal_tiling_features;
2286 self
2287 }
buffer_features(mut self, buffer_features: FormatFeatureFlags) -> Self2288 pub fn buffer_features(mut self, buffer_features: FormatFeatureFlags) -> Self {
2289 self.inner.buffer_features = buffer_features;
2290 self
2291 }
2292 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2293 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2294 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> FormatProperties2295 pub fn build(self) -> FormatProperties {
2296 self.inner
2297 }
2298 }
2299 #[repr(C)]
2300 #[cfg_attr(feature = "debug", derive(Debug))]
2301 #[derive(Copy, Clone, Default)]
2302 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageFormatProperties.html>"]
2303 pub struct ImageFormatProperties {
2304 pub max_extent: Extent3D,
2305 pub max_mip_levels: u32,
2306 pub max_array_layers: u32,
2307 pub sample_counts: SampleCountFlags,
2308 pub max_resource_size: DeviceSize,
2309 }
2310 impl ImageFormatProperties {
builder<'a>() -> ImageFormatPropertiesBuilder<'a>2311 pub fn builder<'a>() -> ImageFormatPropertiesBuilder<'a> {
2312 ImageFormatPropertiesBuilder {
2313 inner: Self::default(),
2314 marker: ::std::marker::PhantomData,
2315 }
2316 }
2317 }
2318 #[repr(transparent)]
2319 pub struct ImageFormatPropertiesBuilder<'a> {
2320 inner: ImageFormatProperties,
2321 marker: ::std::marker::PhantomData<&'a ()>,
2322 }
2323 impl<'a> ::std::ops::Deref for ImageFormatPropertiesBuilder<'a> {
2324 type Target = ImageFormatProperties;
deref(&self) -> &Self::Target2325 fn deref(&self) -> &Self::Target {
2326 &self.inner
2327 }
2328 }
2329 impl<'a> ::std::ops::DerefMut for ImageFormatPropertiesBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2330 fn deref_mut(&mut self) -> &mut Self::Target {
2331 &mut self.inner
2332 }
2333 }
2334 impl<'a> ImageFormatPropertiesBuilder<'a> {
max_extent(mut self, max_extent: Extent3D) -> Self2335 pub fn max_extent(mut self, max_extent: Extent3D) -> Self {
2336 self.inner.max_extent = max_extent;
2337 self
2338 }
max_mip_levels(mut self, max_mip_levels: u32) -> Self2339 pub fn max_mip_levels(mut self, max_mip_levels: u32) -> Self {
2340 self.inner.max_mip_levels = max_mip_levels;
2341 self
2342 }
max_array_layers(mut self, max_array_layers: u32) -> Self2343 pub fn max_array_layers(mut self, max_array_layers: u32) -> Self {
2344 self.inner.max_array_layers = max_array_layers;
2345 self
2346 }
sample_counts(mut self, sample_counts: SampleCountFlags) -> Self2347 pub fn sample_counts(mut self, sample_counts: SampleCountFlags) -> Self {
2348 self.inner.sample_counts = sample_counts;
2349 self
2350 }
max_resource_size(mut self, max_resource_size: DeviceSize) -> Self2351 pub fn max_resource_size(mut self, max_resource_size: DeviceSize) -> Self {
2352 self.inner.max_resource_size = max_resource_size;
2353 self
2354 }
2355 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2356 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2357 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageFormatProperties2358 pub fn build(self) -> ImageFormatProperties {
2359 self.inner
2360 }
2361 }
2362 #[repr(C)]
2363 #[cfg_attr(feature = "debug", derive(Debug))]
2364 #[derive(Copy, Clone, Default)]
2365 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorBufferInfo.html>"]
2366 pub struct DescriptorBufferInfo {
2367 pub buffer: Buffer,
2368 pub offset: DeviceSize,
2369 pub range: DeviceSize,
2370 }
2371 impl DescriptorBufferInfo {
builder<'a>() -> DescriptorBufferInfoBuilder<'a>2372 pub fn builder<'a>() -> DescriptorBufferInfoBuilder<'a> {
2373 DescriptorBufferInfoBuilder {
2374 inner: Self::default(),
2375 marker: ::std::marker::PhantomData,
2376 }
2377 }
2378 }
2379 #[repr(transparent)]
2380 pub struct DescriptorBufferInfoBuilder<'a> {
2381 inner: DescriptorBufferInfo,
2382 marker: ::std::marker::PhantomData<&'a ()>,
2383 }
2384 impl<'a> ::std::ops::Deref for DescriptorBufferInfoBuilder<'a> {
2385 type Target = DescriptorBufferInfo;
deref(&self) -> &Self::Target2386 fn deref(&self) -> &Self::Target {
2387 &self.inner
2388 }
2389 }
2390 impl<'a> ::std::ops::DerefMut for DescriptorBufferInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2391 fn deref_mut(&mut self) -> &mut Self::Target {
2392 &mut self.inner
2393 }
2394 }
2395 impl<'a> DescriptorBufferInfoBuilder<'a> {
buffer(mut self, buffer: Buffer) -> Self2396 pub fn buffer(mut self, buffer: Buffer) -> Self {
2397 self.inner.buffer = buffer;
2398 self
2399 }
offset(mut self, offset: DeviceSize) -> Self2400 pub fn offset(mut self, offset: DeviceSize) -> Self {
2401 self.inner.offset = offset;
2402 self
2403 }
range(mut self, range: DeviceSize) -> Self2404 pub fn range(mut self, range: DeviceSize) -> Self {
2405 self.inner.range = range;
2406 self
2407 }
2408 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2409 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2410 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorBufferInfo2411 pub fn build(self) -> DescriptorBufferInfo {
2412 self.inner
2413 }
2414 }
2415 #[repr(C)]
2416 #[cfg_attr(feature = "debug", derive(Debug))]
2417 #[derive(Copy, Clone, Default)]
2418 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorImageInfo.html>"]
2419 pub struct DescriptorImageInfo {
2420 pub sampler: Sampler,
2421 pub image_view: ImageView,
2422 pub image_layout: ImageLayout,
2423 }
2424 impl DescriptorImageInfo {
builder<'a>() -> DescriptorImageInfoBuilder<'a>2425 pub fn builder<'a>() -> DescriptorImageInfoBuilder<'a> {
2426 DescriptorImageInfoBuilder {
2427 inner: Self::default(),
2428 marker: ::std::marker::PhantomData,
2429 }
2430 }
2431 }
2432 #[repr(transparent)]
2433 pub struct DescriptorImageInfoBuilder<'a> {
2434 inner: DescriptorImageInfo,
2435 marker: ::std::marker::PhantomData<&'a ()>,
2436 }
2437 impl<'a> ::std::ops::Deref for DescriptorImageInfoBuilder<'a> {
2438 type Target = DescriptorImageInfo;
deref(&self) -> &Self::Target2439 fn deref(&self) -> &Self::Target {
2440 &self.inner
2441 }
2442 }
2443 impl<'a> ::std::ops::DerefMut for DescriptorImageInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2444 fn deref_mut(&mut self) -> &mut Self::Target {
2445 &mut self.inner
2446 }
2447 }
2448 impl<'a> DescriptorImageInfoBuilder<'a> {
sampler(mut self, sampler: Sampler) -> Self2449 pub fn sampler(mut self, sampler: Sampler) -> Self {
2450 self.inner.sampler = sampler;
2451 self
2452 }
image_view(mut self, image_view: ImageView) -> Self2453 pub fn image_view(mut self, image_view: ImageView) -> Self {
2454 self.inner.image_view = image_view;
2455 self
2456 }
image_layout(mut self, image_layout: ImageLayout) -> Self2457 pub fn image_layout(mut self, image_layout: ImageLayout) -> Self {
2458 self.inner.image_layout = image_layout;
2459 self
2460 }
2461 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2462 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2463 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorImageInfo2464 pub fn build(self) -> DescriptorImageInfo {
2465 self.inner
2466 }
2467 }
2468 #[repr(C)]
2469 #[cfg_attr(feature = "debug", derive(Debug))]
2470 #[derive(Copy, Clone)]
2471 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkWriteDescriptorSet.html>"]
2472 pub struct WriteDescriptorSet {
2473 pub s_type: StructureType,
2474 pub p_next: *const c_void,
2475 pub dst_set: DescriptorSet,
2476 pub dst_binding: u32,
2477 pub dst_array_element: u32,
2478 pub descriptor_count: u32,
2479 pub descriptor_type: DescriptorType,
2480 pub p_image_info: *const DescriptorImageInfo,
2481 pub p_buffer_info: *const DescriptorBufferInfo,
2482 pub p_texel_buffer_view: *const BufferView,
2483 }
2484 impl ::std::default::Default for WriteDescriptorSet {
default() -> Self2485 fn default() -> Self {
2486 Self {
2487 s_type: StructureType::WRITE_DESCRIPTOR_SET,
2488 p_next: ::std::ptr::null(),
2489 dst_set: DescriptorSet::default(),
2490 dst_binding: u32::default(),
2491 dst_array_element: u32::default(),
2492 descriptor_count: u32::default(),
2493 descriptor_type: DescriptorType::default(),
2494 p_image_info: ::std::ptr::null(),
2495 p_buffer_info: ::std::ptr::null(),
2496 p_texel_buffer_view: ::std::ptr::null(),
2497 }
2498 }
2499 }
2500 impl WriteDescriptorSet {
builder<'a>() -> WriteDescriptorSetBuilder<'a>2501 pub fn builder<'a>() -> WriteDescriptorSetBuilder<'a> {
2502 WriteDescriptorSetBuilder {
2503 inner: Self::default(),
2504 marker: ::std::marker::PhantomData,
2505 }
2506 }
2507 }
2508 #[repr(transparent)]
2509 pub struct WriteDescriptorSetBuilder<'a> {
2510 inner: WriteDescriptorSet,
2511 marker: ::std::marker::PhantomData<&'a ()>,
2512 }
2513 pub unsafe trait ExtendsWriteDescriptorSet {}
2514 impl<'a> ::std::ops::Deref for WriteDescriptorSetBuilder<'a> {
2515 type Target = WriteDescriptorSet;
deref(&self) -> &Self::Target2516 fn deref(&self) -> &Self::Target {
2517 &self.inner
2518 }
2519 }
2520 impl<'a> ::std::ops::DerefMut for WriteDescriptorSetBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2521 fn deref_mut(&mut self) -> &mut Self::Target {
2522 &mut self.inner
2523 }
2524 }
2525 impl<'a> WriteDescriptorSetBuilder<'a> {
dst_set(mut self, dst_set: DescriptorSet) -> Self2526 pub fn dst_set(mut self, dst_set: DescriptorSet) -> Self {
2527 self.inner.dst_set = dst_set;
2528 self
2529 }
dst_binding(mut self, dst_binding: u32) -> Self2530 pub fn dst_binding(mut self, dst_binding: u32) -> Self {
2531 self.inner.dst_binding = dst_binding;
2532 self
2533 }
dst_array_element(mut self, dst_array_element: u32) -> Self2534 pub fn dst_array_element(mut self, dst_array_element: u32) -> Self {
2535 self.inner.dst_array_element = dst_array_element;
2536 self
2537 }
descriptor_type(mut self, descriptor_type: DescriptorType) -> Self2538 pub fn descriptor_type(mut self, descriptor_type: DescriptorType) -> Self {
2539 self.inner.descriptor_type = descriptor_type;
2540 self
2541 }
image_info(mut self, image_info: &'a [DescriptorImageInfo]) -> Self2542 pub fn image_info(mut self, image_info: &'a [DescriptorImageInfo]) -> Self {
2543 self.inner.descriptor_count = image_info.len() as _;
2544 self.inner.p_image_info = image_info.as_ptr();
2545 self
2546 }
buffer_info(mut self, buffer_info: &'a [DescriptorBufferInfo]) -> Self2547 pub fn buffer_info(mut self, buffer_info: &'a [DescriptorBufferInfo]) -> Self {
2548 self.inner.descriptor_count = buffer_info.len() as _;
2549 self.inner.p_buffer_info = buffer_info.as_ptr();
2550 self
2551 }
texel_buffer_view(mut self, texel_buffer_view: &'a [BufferView]) -> Self2552 pub fn texel_buffer_view(mut self, texel_buffer_view: &'a [BufferView]) -> Self {
2553 self.inner.descriptor_count = texel_buffer_view.len() as _;
2554 self.inner.p_texel_buffer_view = texel_buffer_view.as_ptr();
2555 self
2556 }
2557 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
2558 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
2559 #[doc = r" valid extension structs can be pushed into the chain."]
2560 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
2561 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsWriteDescriptorSet>(mut self, next: &'a mut T) -> Self2562 pub fn push_next<T: ExtendsWriteDescriptorSet>(mut self, next: &'a mut T) -> Self {
2563 unsafe {
2564 let next_ptr = next as *mut T as *mut BaseOutStructure;
2565 let last_next = ptr_chain_iter(next).last().unwrap();
2566 (*last_next).p_next = self.inner.p_next as _;
2567 self.inner.p_next = next_ptr as _;
2568 }
2569 self
2570 }
2571 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2572 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2573 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> WriteDescriptorSet2574 pub fn build(self) -> WriteDescriptorSet {
2575 self.inner
2576 }
2577 }
2578 #[repr(C)]
2579 #[cfg_attr(feature = "debug", derive(Debug))]
2580 #[derive(Copy, Clone)]
2581 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCopyDescriptorSet.html>"]
2582 pub struct CopyDescriptorSet {
2583 pub s_type: StructureType,
2584 pub p_next: *const c_void,
2585 pub src_set: DescriptorSet,
2586 pub src_binding: u32,
2587 pub src_array_element: u32,
2588 pub dst_set: DescriptorSet,
2589 pub dst_binding: u32,
2590 pub dst_array_element: u32,
2591 pub descriptor_count: u32,
2592 }
2593 impl ::std::default::Default for CopyDescriptorSet {
default() -> Self2594 fn default() -> Self {
2595 Self {
2596 s_type: StructureType::COPY_DESCRIPTOR_SET,
2597 p_next: ::std::ptr::null(),
2598 src_set: DescriptorSet::default(),
2599 src_binding: u32::default(),
2600 src_array_element: u32::default(),
2601 dst_set: DescriptorSet::default(),
2602 dst_binding: u32::default(),
2603 dst_array_element: u32::default(),
2604 descriptor_count: u32::default(),
2605 }
2606 }
2607 }
2608 impl CopyDescriptorSet {
builder<'a>() -> CopyDescriptorSetBuilder<'a>2609 pub fn builder<'a>() -> CopyDescriptorSetBuilder<'a> {
2610 CopyDescriptorSetBuilder {
2611 inner: Self::default(),
2612 marker: ::std::marker::PhantomData,
2613 }
2614 }
2615 }
2616 #[repr(transparent)]
2617 pub struct CopyDescriptorSetBuilder<'a> {
2618 inner: CopyDescriptorSet,
2619 marker: ::std::marker::PhantomData<&'a ()>,
2620 }
2621 impl<'a> ::std::ops::Deref for CopyDescriptorSetBuilder<'a> {
2622 type Target = CopyDescriptorSet;
deref(&self) -> &Self::Target2623 fn deref(&self) -> &Self::Target {
2624 &self.inner
2625 }
2626 }
2627 impl<'a> ::std::ops::DerefMut for CopyDescriptorSetBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2628 fn deref_mut(&mut self) -> &mut Self::Target {
2629 &mut self.inner
2630 }
2631 }
2632 impl<'a> CopyDescriptorSetBuilder<'a> {
src_set(mut self, src_set: DescriptorSet) -> Self2633 pub fn src_set(mut self, src_set: DescriptorSet) -> Self {
2634 self.inner.src_set = src_set;
2635 self
2636 }
src_binding(mut self, src_binding: u32) -> Self2637 pub fn src_binding(mut self, src_binding: u32) -> Self {
2638 self.inner.src_binding = src_binding;
2639 self
2640 }
src_array_element(mut self, src_array_element: u32) -> Self2641 pub fn src_array_element(mut self, src_array_element: u32) -> Self {
2642 self.inner.src_array_element = src_array_element;
2643 self
2644 }
dst_set(mut self, dst_set: DescriptorSet) -> Self2645 pub fn dst_set(mut self, dst_set: DescriptorSet) -> Self {
2646 self.inner.dst_set = dst_set;
2647 self
2648 }
dst_binding(mut self, dst_binding: u32) -> Self2649 pub fn dst_binding(mut self, dst_binding: u32) -> Self {
2650 self.inner.dst_binding = dst_binding;
2651 self
2652 }
dst_array_element(mut self, dst_array_element: u32) -> Self2653 pub fn dst_array_element(mut self, dst_array_element: u32) -> Self {
2654 self.inner.dst_array_element = dst_array_element;
2655 self
2656 }
descriptor_count(mut self, descriptor_count: u32) -> Self2657 pub fn descriptor_count(mut self, descriptor_count: u32) -> Self {
2658 self.inner.descriptor_count = descriptor_count;
2659 self
2660 }
2661 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2662 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2663 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> CopyDescriptorSet2664 pub fn build(self) -> CopyDescriptorSet {
2665 self.inner
2666 }
2667 }
2668 #[repr(C)]
2669 #[cfg_attr(feature = "debug", derive(Debug))]
2670 #[derive(Copy, Clone)]
2671 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferCreateInfo.html>"]
2672 pub struct BufferCreateInfo {
2673 pub s_type: StructureType,
2674 pub p_next: *const c_void,
2675 pub flags: BufferCreateFlags,
2676 pub size: DeviceSize,
2677 pub usage: BufferUsageFlags,
2678 pub sharing_mode: SharingMode,
2679 pub queue_family_index_count: u32,
2680 pub p_queue_family_indices: *const u32,
2681 }
2682 impl ::std::default::Default for BufferCreateInfo {
default() -> Self2683 fn default() -> Self {
2684 Self {
2685 s_type: StructureType::BUFFER_CREATE_INFO,
2686 p_next: ::std::ptr::null(),
2687 flags: BufferCreateFlags::default(),
2688 size: DeviceSize::default(),
2689 usage: BufferUsageFlags::default(),
2690 sharing_mode: SharingMode::default(),
2691 queue_family_index_count: u32::default(),
2692 p_queue_family_indices: ::std::ptr::null(),
2693 }
2694 }
2695 }
2696 impl BufferCreateInfo {
builder<'a>() -> BufferCreateInfoBuilder<'a>2697 pub fn builder<'a>() -> BufferCreateInfoBuilder<'a> {
2698 BufferCreateInfoBuilder {
2699 inner: Self::default(),
2700 marker: ::std::marker::PhantomData,
2701 }
2702 }
2703 }
2704 #[repr(transparent)]
2705 pub struct BufferCreateInfoBuilder<'a> {
2706 inner: BufferCreateInfo,
2707 marker: ::std::marker::PhantomData<&'a ()>,
2708 }
2709 pub unsafe trait ExtendsBufferCreateInfo {}
2710 impl<'a> ::std::ops::Deref for BufferCreateInfoBuilder<'a> {
2711 type Target = BufferCreateInfo;
deref(&self) -> &Self::Target2712 fn deref(&self) -> &Self::Target {
2713 &self.inner
2714 }
2715 }
2716 impl<'a> ::std::ops::DerefMut for BufferCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2717 fn deref_mut(&mut self) -> &mut Self::Target {
2718 &mut self.inner
2719 }
2720 }
2721 impl<'a> BufferCreateInfoBuilder<'a> {
flags(mut self, flags: BufferCreateFlags) -> Self2722 pub fn flags(mut self, flags: BufferCreateFlags) -> Self {
2723 self.inner.flags = flags;
2724 self
2725 }
size(mut self, size: DeviceSize) -> Self2726 pub fn size(mut self, size: DeviceSize) -> Self {
2727 self.inner.size = size;
2728 self
2729 }
usage(mut self, usage: BufferUsageFlags) -> Self2730 pub fn usage(mut self, usage: BufferUsageFlags) -> Self {
2731 self.inner.usage = usage;
2732 self
2733 }
sharing_mode(mut self, sharing_mode: SharingMode) -> Self2734 pub fn sharing_mode(mut self, sharing_mode: SharingMode) -> Self {
2735 self.inner.sharing_mode = sharing_mode;
2736 self
2737 }
queue_family_indices(mut self, queue_family_indices: &'a [u32]) -> Self2738 pub fn queue_family_indices(mut self, queue_family_indices: &'a [u32]) -> Self {
2739 self.inner.queue_family_index_count = queue_family_indices.len() as _;
2740 self.inner.p_queue_family_indices = queue_family_indices.as_ptr();
2741 self
2742 }
2743 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
2744 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
2745 #[doc = r" valid extension structs can be pushed into the chain."]
2746 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
2747 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsBufferCreateInfo>(mut self, next: &'a mut T) -> Self2748 pub fn push_next<T: ExtendsBufferCreateInfo>(mut self, next: &'a mut T) -> Self {
2749 unsafe {
2750 let next_ptr = next as *mut T as *mut BaseOutStructure;
2751 let last_next = ptr_chain_iter(next).last().unwrap();
2752 (*last_next).p_next = self.inner.p_next as _;
2753 self.inner.p_next = next_ptr as _;
2754 }
2755 self
2756 }
2757 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2758 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2759 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BufferCreateInfo2760 pub fn build(self) -> BufferCreateInfo {
2761 self.inner
2762 }
2763 }
2764 #[repr(C)]
2765 #[cfg_attr(feature = "debug", derive(Debug))]
2766 #[derive(Copy, Clone)]
2767 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferViewCreateInfo.html>"]
2768 pub struct BufferViewCreateInfo {
2769 pub s_type: StructureType,
2770 pub p_next: *const c_void,
2771 pub flags: BufferViewCreateFlags,
2772 pub buffer: Buffer,
2773 pub format: Format,
2774 pub offset: DeviceSize,
2775 pub range: DeviceSize,
2776 }
2777 impl ::std::default::Default for BufferViewCreateInfo {
default() -> Self2778 fn default() -> Self {
2779 Self {
2780 s_type: StructureType::BUFFER_VIEW_CREATE_INFO,
2781 p_next: ::std::ptr::null(),
2782 flags: BufferViewCreateFlags::default(),
2783 buffer: Buffer::default(),
2784 format: Format::default(),
2785 offset: DeviceSize::default(),
2786 range: DeviceSize::default(),
2787 }
2788 }
2789 }
2790 impl BufferViewCreateInfo {
builder<'a>() -> BufferViewCreateInfoBuilder<'a>2791 pub fn builder<'a>() -> BufferViewCreateInfoBuilder<'a> {
2792 BufferViewCreateInfoBuilder {
2793 inner: Self::default(),
2794 marker: ::std::marker::PhantomData,
2795 }
2796 }
2797 }
2798 #[repr(transparent)]
2799 pub struct BufferViewCreateInfoBuilder<'a> {
2800 inner: BufferViewCreateInfo,
2801 marker: ::std::marker::PhantomData<&'a ()>,
2802 }
2803 impl<'a> ::std::ops::Deref for BufferViewCreateInfoBuilder<'a> {
2804 type Target = BufferViewCreateInfo;
deref(&self) -> &Self::Target2805 fn deref(&self) -> &Self::Target {
2806 &self.inner
2807 }
2808 }
2809 impl<'a> ::std::ops::DerefMut for BufferViewCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2810 fn deref_mut(&mut self) -> &mut Self::Target {
2811 &mut self.inner
2812 }
2813 }
2814 impl<'a> BufferViewCreateInfoBuilder<'a> {
flags(mut self, flags: BufferViewCreateFlags) -> Self2815 pub fn flags(mut self, flags: BufferViewCreateFlags) -> Self {
2816 self.inner.flags = flags;
2817 self
2818 }
buffer(mut self, buffer: Buffer) -> Self2819 pub fn buffer(mut self, buffer: Buffer) -> Self {
2820 self.inner.buffer = buffer;
2821 self
2822 }
format(mut self, format: Format) -> Self2823 pub fn format(mut self, format: Format) -> Self {
2824 self.inner.format = format;
2825 self
2826 }
offset(mut self, offset: DeviceSize) -> Self2827 pub fn offset(mut self, offset: DeviceSize) -> Self {
2828 self.inner.offset = offset;
2829 self
2830 }
range(mut self, range: DeviceSize) -> Self2831 pub fn range(mut self, range: DeviceSize) -> Self {
2832 self.inner.range = range;
2833 self
2834 }
2835 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2836 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2837 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BufferViewCreateInfo2838 pub fn build(self) -> BufferViewCreateInfo {
2839 self.inner
2840 }
2841 }
2842 #[repr(C)]
2843 #[cfg_attr(feature = "debug", derive(Debug))]
2844 #[derive(Copy, Clone, Default)]
2845 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageSubresource.html>"]
2846 pub struct ImageSubresource {
2847 pub aspect_mask: ImageAspectFlags,
2848 pub mip_level: u32,
2849 pub array_layer: u32,
2850 }
2851 impl ImageSubresource {
builder<'a>() -> ImageSubresourceBuilder<'a>2852 pub fn builder<'a>() -> ImageSubresourceBuilder<'a> {
2853 ImageSubresourceBuilder {
2854 inner: Self::default(),
2855 marker: ::std::marker::PhantomData,
2856 }
2857 }
2858 }
2859 #[repr(transparent)]
2860 pub struct ImageSubresourceBuilder<'a> {
2861 inner: ImageSubresource,
2862 marker: ::std::marker::PhantomData<&'a ()>,
2863 }
2864 impl<'a> ::std::ops::Deref for ImageSubresourceBuilder<'a> {
2865 type Target = ImageSubresource;
deref(&self) -> &Self::Target2866 fn deref(&self) -> &Self::Target {
2867 &self.inner
2868 }
2869 }
2870 impl<'a> ::std::ops::DerefMut for ImageSubresourceBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2871 fn deref_mut(&mut self) -> &mut Self::Target {
2872 &mut self.inner
2873 }
2874 }
2875 impl<'a> ImageSubresourceBuilder<'a> {
aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self2876 pub fn aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self {
2877 self.inner.aspect_mask = aspect_mask;
2878 self
2879 }
mip_level(mut self, mip_level: u32) -> Self2880 pub fn mip_level(mut self, mip_level: u32) -> Self {
2881 self.inner.mip_level = mip_level;
2882 self
2883 }
array_layer(mut self, array_layer: u32) -> Self2884 pub fn array_layer(mut self, array_layer: u32) -> Self {
2885 self.inner.array_layer = array_layer;
2886 self
2887 }
2888 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2889 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2890 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageSubresource2891 pub fn build(self) -> ImageSubresource {
2892 self.inner
2893 }
2894 }
2895 #[repr(C)]
2896 #[cfg_attr(feature = "debug", derive(Debug))]
2897 #[derive(Copy, Clone, Default)]
2898 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageSubresourceLayers.html>"]
2899 pub struct ImageSubresourceLayers {
2900 pub aspect_mask: ImageAspectFlags,
2901 pub mip_level: u32,
2902 pub base_array_layer: u32,
2903 pub layer_count: u32,
2904 }
2905 impl ImageSubresourceLayers {
builder<'a>() -> ImageSubresourceLayersBuilder<'a>2906 pub fn builder<'a>() -> ImageSubresourceLayersBuilder<'a> {
2907 ImageSubresourceLayersBuilder {
2908 inner: Self::default(),
2909 marker: ::std::marker::PhantomData,
2910 }
2911 }
2912 }
2913 #[repr(transparent)]
2914 pub struct ImageSubresourceLayersBuilder<'a> {
2915 inner: ImageSubresourceLayers,
2916 marker: ::std::marker::PhantomData<&'a ()>,
2917 }
2918 impl<'a> ::std::ops::Deref for ImageSubresourceLayersBuilder<'a> {
2919 type Target = ImageSubresourceLayers;
deref(&self) -> &Self::Target2920 fn deref(&self) -> &Self::Target {
2921 &self.inner
2922 }
2923 }
2924 impl<'a> ::std::ops::DerefMut for ImageSubresourceLayersBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2925 fn deref_mut(&mut self) -> &mut Self::Target {
2926 &mut self.inner
2927 }
2928 }
2929 impl<'a> ImageSubresourceLayersBuilder<'a> {
aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self2930 pub fn aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self {
2931 self.inner.aspect_mask = aspect_mask;
2932 self
2933 }
mip_level(mut self, mip_level: u32) -> Self2934 pub fn mip_level(mut self, mip_level: u32) -> Self {
2935 self.inner.mip_level = mip_level;
2936 self
2937 }
base_array_layer(mut self, base_array_layer: u32) -> Self2938 pub fn base_array_layer(mut self, base_array_layer: u32) -> Self {
2939 self.inner.base_array_layer = base_array_layer;
2940 self
2941 }
layer_count(mut self, layer_count: u32) -> Self2942 pub fn layer_count(mut self, layer_count: u32) -> Self {
2943 self.inner.layer_count = layer_count;
2944 self
2945 }
2946 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
2947 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
2948 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageSubresourceLayers2949 pub fn build(self) -> ImageSubresourceLayers {
2950 self.inner
2951 }
2952 }
2953 #[repr(C)]
2954 #[cfg_attr(feature = "debug", derive(Debug))]
2955 #[derive(Copy, Clone, Default)]
2956 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageSubresourceRange.html>"]
2957 pub struct ImageSubresourceRange {
2958 pub aspect_mask: ImageAspectFlags,
2959 pub base_mip_level: u32,
2960 pub level_count: u32,
2961 pub base_array_layer: u32,
2962 pub layer_count: u32,
2963 }
2964 impl ImageSubresourceRange {
builder<'a>() -> ImageSubresourceRangeBuilder<'a>2965 pub fn builder<'a>() -> ImageSubresourceRangeBuilder<'a> {
2966 ImageSubresourceRangeBuilder {
2967 inner: Self::default(),
2968 marker: ::std::marker::PhantomData,
2969 }
2970 }
2971 }
2972 #[repr(transparent)]
2973 pub struct ImageSubresourceRangeBuilder<'a> {
2974 inner: ImageSubresourceRange,
2975 marker: ::std::marker::PhantomData<&'a ()>,
2976 }
2977 impl<'a> ::std::ops::Deref for ImageSubresourceRangeBuilder<'a> {
2978 type Target = ImageSubresourceRange;
deref(&self) -> &Self::Target2979 fn deref(&self) -> &Self::Target {
2980 &self.inner
2981 }
2982 }
2983 impl<'a> ::std::ops::DerefMut for ImageSubresourceRangeBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target2984 fn deref_mut(&mut self) -> &mut Self::Target {
2985 &mut self.inner
2986 }
2987 }
2988 impl<'a> ImageSubresourceRangeBuilder<'a> {
aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self2989 pub fn aspect_mask(mut self, aspect_mask: ImageAspectFlags) -> Self {
2990 self.inner.aspect_mask = aspect_mask;
2991 self
2992 }
base_mip_level(mut self, base_mip_level: u32) -> Self2993 pub fn base_mip_level(mut self, base_mip_level: u32) -> Self {
2994 self.inner.base_mip_level = base_mip_level;
2995 self
2996 }
level_count(mut self, level_count: u32) -> Self2997 pub fn level_count(mut self, level_count: u32) -> Self {
2998 self.inner.level_count = level_count;
2999 self
3000 }
base_array_layer(mut self, base_array_layer: u32) -> Self3001 pub fn base_array_layer(mut self, base_array_layer: u32) -> Self {
3002 self.inner.base_array_layer = base_array_layer;
3003 self
3004 }
layer_count(mut self, layer_count: u32) -> Self3005 pub fn layer_count(mut self, layer_count: u32) -> Self {
3006 self.inner.layer_count = layer_count;
3007 self
3008 }
3009 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3010 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3011 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageSubresourceRange3012 pub fn build(self) -> ImageSubresourceRange {
3013 self.inner
3014 }
3015 }
3016 #[repr(C)]
3017 #[cfg_attr(feature = "debug", derive(Debug))]
3018 #[derive(Copy, Clone)]
3019 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryBarrier.html>"]
3020 pub struct MemoryBarrier {
3021 pub s_type: StructureType,
3022 pub p_next: *const c_void,
3023 pub src_access_mask: AccessFlags,
3024 pub dst_access_mask: AccessFlags,
3025 }
3026 impl ::std::default::Default for MemoryBarrier {
default() -> Self3027 fn default() -> Self {
3028 Self {
3029 s_type: StructureType::MEMORY_BARRIER,
3030 p_next: ::std::ptr::null(),
3031 src_access_mask: AccessFlags::default(),
3032 dst_access_mask: AccessFlags::default(),
3033 }
3034 }
3035 }
3036 impl MemoryBarrier {
builder<'a>() -> MemoryBarrierBuilder<'a>3037 pub fn builder<'a>() -> MemoryBarrierBuilder<'a> {
3038 MemoryBarrierBuilder {
3039 inner: Self::default(),
3040 marker: ::std::marker::PhantomData,
3041 }
3042 }
3043 }
3044 #[repr(transparent)]
3045 pub struct MemoryBarrierBuilder<'a> {
3046 inner: MemoryBarrier,
3047 marker: ::std::marker::PhantomData<&'a ()>,
3048 }
3049 impl<'a> ::std::ops::Deref for MemoryBarrierBuilder<'a> {
3050 type Target = MemoryBarrier;
deref(&self) -> &Self::Target3051 fn deref(&self) -> &Self::Target {
3052 &self.inner
3053 }
3054 }
3055 impl<'a> ::std::ops::DerefMut for MemoryBarrierBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3056 fn deref_mut(&mut self) -> &mut Self::Target {
3057 &mut self.inner
3058 }
3059 }
3060 impl<'a> MemoryBarrierBuilder<'a> {
src_access_mask(mut self, src_access_mask: AccessFlags) -> Self3061 pub fn src_access_mask(mut self, src_access_mask: AccessFlags) -> Self {
3062 self.inner.src_access_mask = src_access_mask;
3063 self
3064 }
dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self3065 pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self {
3066 self.inner.dst_access_mask = dst_access_mask;
3067 self
3068 }
3069 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3070 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3071 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> MemoryBarrier3072 pub fn build(self) -> MemoryBarrier {
3073 self.inner
3074 }
3075 }
3076 #[repr(C)]
3077 #[cfg_attr(feature = "debug", derive(Debug))]
3078 #[derive(Copy, Clone)]
3079 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferMemoryBarrier.html>"]
3080 pub struct BufferMemoryBarrier {
3081 pub s_type: StructureType,
3082 pub p_next: *const c_void,
3083 pub src_access_mask: AccessFlags,
3084 pub dst_access_mask: AccessFlags,
3085 pub src_queue_family_index: u32,
3086 pub dst_queue_family_index: u32,
3087 pub buffer: Buffer,
3088 pub offset: DeviceSize,
3089 pub size: DeviceSize,
3090 }
3091 impl ::std::default::Default for BufferMemoryBarrier {
default() -> Self3092 fn default() -> Self {
3093 Self {
3094 s_type: StructureType::BUFFER_MEMORY_BARRIER,
3095 p_next: ::std::ptr::null(),
3096 src_access_mask: AccessFlags::default(),
3097 dst_access_mask: AccessFlags::default(),
3098 src_queue_family_index: u32::default(),
3099 dst_queue_family_index: u32::default(),
3100 buffer: Buffer::default(),
3101 offset: DeviceSize::default(),
3102 size: DeviceSize::default(),
3103 }
3104 }
3105 }
3106 impl BufferMemoryBarrier {
builder<'a>() -> BufferMemoryBarrierBuilder<'a>3107 pub fn builder<'a>() -> BufferMemoryBarrierBuilder<'a> {
3108 BufferMemoryBarrierBuilder {
3109 inner: Self::default(),
3110 marker: ::std::marker::PhantomData,
3111 }
3112 }
3113 }
3114 #[repr(transparent)]
3115 pub struct BufferMemoryBarrierBuilder<'a> {
3116 inner: BufferMemoryBarrier,
3117 marker: ::std::marker::PhantomData<&'a ()>,
3118 }
3119 impl<'a> ::std::ops::Deref for BufferMemoryBarrierBuilder<'a> {
3120 type Target = BufferMemoryBarrier;
deref(&self) -> &Self::Target3121 fn deref(&self) -> &Self::Target {
3122 &self.inner
3123 }
3124 }
3125 impl<'a> ::std::ops::DerefMut for BufferMemoryBarrierBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3126 fn deref_mut(&mut self) -> &mut Self::Target {
3127 &mut self.inner
3128 }
3129 }
3130 impl<'a> BufferMemoryBarrierBuilder<'a> {
src_access_mask(mut self, src_access_mask: AccessFlags) -> Self3131 pub fn src_access_mask(mut self, src_access_mask: AccessFlags) -> Self {
3132 self.inner.src_access_mask = src_access_mask;
3133 self
3134 }
dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self3135 pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self {
3136 self.inner.dst_access_mask = dst_access_mask;
3137 self
3138 }
src_queue_family_index(mut self, src_queue_family_index: u32) -> Self3139 pub fn src_queue_family_index(mut self, src_queue_family_index: u32) -> Self {
3140 self.inner.src_queue_family_index = src_queue_family_index;
3141 self
3142 }
dst_queue_family_index(mut self, dst_queue_family_index: u32) -> Self3143 pub fn dst_queue_family_index(mut self, dst_queue_family_index: u32) -> Self {
3144 self.inner.dst_queue_family_index = dst_queue_family_index;
3145 self
3146 }
buffer(mut self, buffer: Buffer) -> Self3147 pub fn buffer(mut self, buffer: Buffer) -> Self {
3148 self.inner.buffer = buffer;
3149 self
3150 }
offset(mut self, offset: DeviceSize) -> Self3151 pub fn offset(mut self, offset: DeviceSize) -> Self {
3152 self.inner.offset = offset;
3153 self
3154 }
size(mut self, size: DeviceSize) -> Self3155 pub fn size(mut self, size: DeviceSize) -> Self {
3156 self.inner.size = size;
3157 self
3158 }
3159 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3160 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3161 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BufferMemoryBarrier3162 pub fn build(self) -> BufferMemoryBarrier {
3163 self.inner
3164 }
3165 }
3166 #[repr(C)]
3167 #[cfg_attr(feature = "debug", derive(Debug))]
3168 #[derive(Copy, Clone)]
3169 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageMemoryBarrier.html>"]
3170 pub struct ImageMemoryBarrier {
3171 pub s_type: StructureType,
3172 pub p_next: *const c_void,
3173 pub src_access_mask: AccessFlags,
3174 pub dst_access_mask: AccessFlags,
3175 pub old_layout: ImageLayout,
3176 pub new_layout: ImageLayout,
3177 pub src_queue_family_index: u32,
3178 pub dst_queue_family_index: u32,
3179 pub image: Image,
3180 pub subresource_range: ImageSubresourceRange,
3181 }
3182 impl ::std::default::Default for ImageMemoryBarrier {
default() -> Self3183 fn default() -> Self {
3184 Self {
3185 s_type: StructureType::IMAGE_MEMORY_BARRIER,
3186 p_next: ::std::ptr::null(),
3187 src_access_mask: AccessFlags::default(),
3188 dst_access_mask: AccessFlags::default(),
3189 old_layout: ImageLayout::default(),
3190 new_layout: ImageLayout::default(),
3191 src_queue_family_index: u32::default(),
3192 dst_queue_family_index: u32::default(),
3193 image: Image::default(),
3194 subresource_range: ImageSubresourceRange::default(),
3195 }
3196 }
3197 }
3198 impl ImageMemoryBarrier {
builder<'a>() -> ImageMemoryBarrierBuilder<'a>3199 pub fn builder<'a>() -> ImageMemoryBarrierBuilder<'a> {
3200 ImageMemoryBarrierBuilder {
3201 inner: Self::default(),
3202 marker: ::std::marker::PhantomData,
3203 }
3204 }
3205 }
3206 #[repr(transparent)]
3207 pub struct ImageMemoryBarrierBuilder<'a> {
3208 inner: ImageMemoryBarrier,
3209 marker: ::std::marker::PhantomData<&'a ()>,
3210 }
3211 pub unsafe trait ExtendsImageMemoryBarrier {}
3212 impl<'a> ::std::ops::Deref for ImageMemoryBarrierBuilder<'a> {
3213 type Target = ImageMemoryBarrier;
deref(&self) -> &Self::Target3214 fn deref(&self) -> &Self::Target {
3215 &self.inner
3216 }
3217 }
3218 impl<'a> ::std::ops::DerefMut for ImageMemoryBarrierBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3219 fn deref_mut(&mut self) -> &mut Self::Target {
3220 &mut self.inner
3221 }
3222 }
3223 impl<'a> ImageMemoryBarrierBuilder<'a> {
src_access_mask(mut self, src_access_mask: AccessFlags) -> Self3224 pub fn src_access_mask(mut self, src_access_mask: AccessFlags) -> Self {
3225 self.inner.src_access_mask = src_access_mask;
3226 self
3227 }
dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self3228 pub fn dst_access_mask(mut self, dst_access_mask: AccessFlags) -> Self {
3229 self.inner.dst_access_mask = dst_access_mask;
3230 self
3231 }
old_layout(mut self, old_layout: ImageLayout) -> Self3232 pub fn old_layout(mut self, old_layout: ImageLayout) -> Self {
3233 self.inner.old_layout = old_layout;
3234 self
3235 }
new_layout(mut self, new_layout: ImageLayout) -> Self3236 pub fn new_layout(mut self, new_layout: ImageLayout) -> Self {
3237 self.inner.new_layout = new_layout;
3238 self
3239 }
src_queue_family_index(mut self, src_queue_family_index: u32) -> Self3240 pub fn src_queue_family_index(mut self, src_queue_family_index: u32) -> Self {
3241 self.inner.src_queue_family_index = src_queue_family_index;
3242 self
3243 }
dst_queue_family_index(mut self, dst_queue_family_index: u32) -> Self3244 pub fn dst_queue_family_index(mut self, dst_queue_family_index: u32) -> Self {
3245 self.inner.dst_queue_family_index = dst_queue_family_index;
3246 self
3247 }
image(mut self, image: Image) -> Self3248 pub fn image(mut self, image: Image) -> Self {
3249 self.inner.image = image;
3250 self
3251 }
subresource_range(mut self, subresource_range: ImageSubresourceRange) -> Self3252 pub fn subresource_range(mut self, subresource_range: ImageSubresourceRange) -> Self {
3253 self.inner.subresource_range = subresource_range;
3254 self
3255 }
3256 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
3257 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
3258 #[doc = r" valid extension structs can be pushed into the chain."]
3259 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
3260 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsImageMemoryBarrier>(mut self, next: &'a mut T) -> Self3261 pub fn push_next<T: ExtendsImageMemoryBarrier>(mut self, next: &'a mut T) -> Self {
3262 unsafe {
3263 let next_ptr = next as *mut T as *mut BaseOutStructure;
3264 let last_next = ptr_chain_iter(next).last().unwrap();
3265 (*last_next).p_next = self.inner.p_next as _;
3266 self.inner.p_next = next_ptr as _;
3267 }
3268 self
3269 }
3270 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3271 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3272 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageMemoryBarrier3273 pub fn build(self) -> ImageMemoryBarrier {
3274 self.inner
3275 }
3276 }
3277 #[repr(C)]
3278 #[cfg_attr(feature = "debug", derive(Debug))]
3279 #[derive(Copy, Clone)]
3280 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageCreateInfo.html>"]
3281 pub struct ImageCreateInfo {
3282 pub s_type: StructureType,
3283 pub p_next: *const c_void,
3284 pub flags: ImageCreateFlags,
3285 pub image_type: ImageType,
3286 pub format: Format,
3287 pub extent: Extent3D,
3288 pub mip_levels: u32,
3289 pub array_layers: u32,
3290 pub samples: SampleCountFlags,
3291 pub tiling: ImageTiling,
3292 pub usage: ImageUsageFlags,
3293 pub sharing_mode: SharingMode,
3294 pub queue_family_index_count: u32,
3295 pub p_queue_family_indices: *const u32,
3296 pub initial_layout: ImageLayout,
3297 }
3298 impl ::std::default::Default for ImageCreateInfo {
default() -> Self3299 fn default() -> Self {
3300 Self {
3301 s_type: StructureType::IMAGE_CREATE_INFO,
3302 p_next: ::std::ptr::null(),
3303 flags: ImageCreateFlags::default(),
3304 image_type: ImageType::default(),
3305 format: Format::default(),
3306 extent: Extent3D::default(),
3307 mip_levels: u32::default(),
3308 array_layers: u32::default(),
3309 samples: SampleCountFlags::default(),
3310 tiling: ImageTiling::default(),
3311 usage: ImageUsageFlags::default(),
3312 sharing_mode: SharingMode::default(),
3313 queue_family_index_count: u32::default(),
3314 p_queue_family_indices: ::std::ptr::null(),
3315 initial_layout: ImageLayout::default(),
3316 }
3317 }
3318 }
3319 impl ImageCreateInfo {
builder<'a>() -> ImageCreateInfoBuilder<'a>3320 pub fn builder<'a>() -> ImageCreateInfoBuilder<'a> {
3321 ImageCreateInfoBuilder {
3322 inner: Self::default(),
3323 marker: ::std::marker::PhantomData,
3324 }
3325 }
3326 }
3327 #[repr(transparent)]
3328 pub struct ImageCreateInfoBuilder<'a> {
3329 inner: ImageCreateInfo,
3330 marker: ::std::marker::PhantomData<&'a ()>,
3331 }
3332 pub unsafe trait ExtendsImageCreateInfo {}
3333 impl<'a> ::std::ops::Deref for ImageCreateInfoBuilder<'a> {
3334 type Target = ImageCreateInfo;
deref(&self) -> &Self::Target3335 fn deref(&self) -> &Self::Target {
3336 &self.inner
3337 }
3338 }
3339 impl<'a> ::std::ops::DerefMut for ImageCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3340 fn deref_mut(&mut self) -> &mut Self::Target {
3341 &mut self.inner
3342 }
3343 }
3344 impl<'a> ImageCreateInfoBuilder<'a> {
flags(mut self, flags: ImageCreateFlags) -> Self3345 pub fn flags(mut self, flags: ImageCreateFlags) -> Self {
3346 self.inner.flags = flags;
3347 self
3348 }
image_type(mut self, image_type: ImageType) -> Self3349 pub fn image_type(mut self, image_type: ImageType) -> Self {
3350 self.inner.image_type = image_type;
3351 self
3352 }
format(mut self, format: Format) -> Self3353 pub fn format(mut self, format: Format) -> Self {
3354 self.inner.format = format;
3355 self
3356 }
extent(mut self, extent: Extent3D) -> Self3357 pub fn extent(mut self, extent: Extent3D) -> Self {
3358 self.inner.extent = extent;
3359 self
3360 }
mip_levels(mut self, mip_levels: u32) -> Self3361 pub fn mip_levels(mut self, mip_levels: u32) -> Self {
3362 self.inner.mip_levels = mip_levels;
3363 self
3364 }
array_layers(mut self, array_layers: u32) -> Self3365 pub fn array_layers(mut self, array_layers: u32) -> Self {
3366 self.inner.array_layers = array_layers;
3367 self
3368 }
samples(mut self, samples: SampleCountFlags) -> Self3369 pub fn samples(mut self, samples: SampleCountFlags) -> Self {
3370 self.inner.samples = samples;
3371 self
3372 }
tiling(mut self, tiling: ImageTiling) -> Self3373 pub fn tiling(mut self, tiling: ImageTiling) -> Self {
3374 self.inner.tiling = tiling;
3375 self
3376 }
usage(mut self, usage: ImageUsageFlags) -> Self3377 pub fn usage(mut self, usage: ImageUsageFlags) -> Self {
3378 self.inner.usage = usage;
3379 self
3380 }
sharing_mode(mut self, sharing_mode: SharingMode) -> Self3381 pub fn sharing_mode(mut self, sharing_mode: SharingMode) -> Self {
3382 self.inner.sharing_mode = sharing_mode;
3383 self
3384 }
queue_family_indices(mut self, queue_family_indices: &'a [u32]) -> Self3385 pub fn queue_family_indices(mut self, queue_family_indices: &'a [u32]) -> Self {
3386 self.inner.queue_family_index_count = queue_family_indices.len() as _;
3387 self.inner.p_queue_family_indices = queue_family_indices.as_ptr();
3388 self
3389 }
initial_layout(mut self, initial_layout: ImageLayout) -> Self3390 pub fn initial_layout(mut self, initial_layout: ImageLayout) -> Self {
3391 self.inner.initial_layout = initial_layout;
3392 self
3393 }
3394 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
3395 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
3396 #[doc = r" valid extension structs can be pushed into the chain."]
3397 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
3398 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsImageCreateInfo>(mut self, next: &'a mut T) -> Self3399 pub fn push_next<T: ExtendsImageCreateInfo>(mut self, next: &'a mut T) -> Self {
3400 unsafe {
3401 let next_ptr = next as *mut T as *mut BaseOutStructure;
3402 let last_next = ptr_chain_iter(next).last().unwrap();
3403 (*last_next).p_next = self.inner.p_next as _;
3404 self.inner.p_next = next_ptr as _;
3405 }
3406 self
3407 }
3408 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3409 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3410 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageCreateInfo3411 pub fn build(self) -> ImageCreateInfo {
3412 self.inner
3413 }
3414 }
3415 #[repr(C)]
3416 #[cfg_attr(feature = "debug", derive(Debug))]
3417 #[derive(Copy, Clone, Default)]
3418 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSubresourceLayout.html>"]
3419 pub struct SubresourceLayout {
3420 pub offset: DeviceSize,
3421 pub size: DeviceSize,
3422 pub row_pitch: DeviceSize,
3423 pub array_pitch: DeviceSize,
3424 pub depth_pitch: DeviceSize,
3425 }
3426 impl SubresourceLayout {
builder<'a>() -> SubresourceLayoutBuilder<'a>3427 pub fn builder<'a>() -> SubresourceLayoutBuilder<'a> {
3428 SubresourceLayoutBuilder {
3429 inner: Self::default(),
3430 marker: ::std::marker::PhantomData,
3431 }
3432 }
3433 }
3434 #[repr(transparent)]
3435 pub struct SubresourceLayoutBuilder<'a> {
3436 inner: SubresourceLayout,
3437 marker: ::std::marker::PhantomData<&'a ()>,
3438 }
3439 impl<'a> ::std::ops::Deref for SubresourceLayoutBuilder<'a> {
3440 type Target = SubresourceLayout;
deref(&self) -> &Self::Target3441 fn deref(&self) -> &Self::Target {
3442 &self.inner
3443 }
3444 }
3445 impl<'a> ::std::ops::DerefMut for SubresourceLayoutBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3446 fn deref_mut(&mut self) -> &mut Self::Target {
3447 &mut self.inner
3448 }
3449 }
3450 impl<'a> SubresourceLayoutBuilder<'a> {
offset(mut self, offset: DeviceSize) -> Self3451 pub fn offset(mut self, offset: DeviceSize) -> Self {
3452 self.inner.offset = offset;
3453 self
3454 }
size(mut self, size: DeviceSize) -> Self3455 pub fn size(mut self, size: DeviceSize) -> Self {
3456 self.inner.size = size;
3457 self
3458 }
row_pitch(mut self, row_pitch: DeviceSize) -> Self3459 pub fn row_pitch(mut self, row_pitch: DeviceSize) -> Self {
3460 self.inner.row_pitch = row_pitch;
3461 self
3462 }
array_pitch(mut self, array_pitch: DeviceSize) -> Self3463 pub fn array_pitch(mut self, array_pitch: DeviceSize) -> Self {
3464 self.inner.array_pitch = array_pitch;
3465 self
3466 }
depth_pitch(mut self, depth_pitch: DeviceSize) -> Self3467 pub fn depth_pitch(mut self, depth_pitch: DeviceSize) -> Self {
3468 self.inner.depth_pitch = depth_pitch;
3469 self
3470 }
3471 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3472 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3473 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SubresourceLayout3474 pub fn build(self) -> SubresourceLayout {
3475 self.inner
3476 }
3477 }
3478 #[repr(C)]
3479 #[cfg_attr(feature = "debug", derive(Debug))]
3480 #[derive(Copy, Clone)]
3481 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageViewCreateInfo.html>"]
3482 pub struct ImageViewCreateInfo {
3483 pub s_type: StructureType,
3484 pub p_next: *const c_void,
3485 pub flags: ImageViewCreateFlags,
3486 pub image: Image,
3487 pub view_type: ImageViewType,
3488 pub format: Format,
3489 pub components: ComponentMapping,
3490 pub subresource_range: ImageSubresourceRange,
3491 }
3492 impl ::std::default::Default for ImageViewCreateInfo {
default() -> Self3493 fn default() -> Self {
3494 Self {
3495 s_type: StructureType::IMAGE_VIEW_CREATE_INFO,
3496 p_next: ::std::ptr::null(),
3497 flags: ImageViewCreateFlags::default(),
3498 image: Image::default(),
3499 view_type: ImageViewType::default(),
3500 format: Format::default(),
3501 components: ComponentMapping::default(),
3502 subresource_range: ImageSubresourceRange::default(),
3503 }
3504 }
3505 }
3506 impl ImageViewCreateInfo {
builder<'a>() -> ImageViewCreateInfoBuilder<'a>3507 pub fn builder<'a>() -> ImageViewCreateInfoBuilder<'a> {
3508 ImageViewCreateInfoBuilder {
3509 inner: Self::default(),
3510 marker: ::std::marker::PhantomData,
3511 }
3512 }
3513 }
3514 #[repr(transparent)]
3515 pub struct ImageViewCreateInfoBuilder<'a> {
3516 inner: ImageViewCreateInfo,
3517 marker: ::std::marker::PhantomData<&'a ()>,
3518 }
3519 pub unsafe trait ExtendsImageViewCreateInfo {}
3520 impl<'a> ::std::ops::Deref for ImageViewCreateInfoBuilder<'a> {
3521 type Target = ImageViewCreateInfo;
deref(&self) -> &Self::Target3522 fn deref(&self) -> &Self::Target {
3523 &self.inner
3524 }
3525 }
3526 impl<'a> ::std::ops::DerefMut for ImageViewCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3527 fn deref_mut(&mut self) -> &mut Self::Target {
3528 &mut self.inner
3529 }
3530 }
3531 impl<'a> ImageViewCreateInfoBuilder<'a> {
flags(mut self, flags: ImageViewCreateFlags) -> Self3532 pub fn flags(mut self, flags: ImageViewCreateFlags) -> Self {
3533 self.inner.flags = flags;
3534 self
3535 }
image(mut self, image: Image) -> Self3536 pub fn image(mut self, image: Image) -> Self {
3537 self.inner.image = image;
3538 self
3539 }
view_type(mut self, view_type: ImageViewType) -> Self3540 pub fn view_type(mut self, view_type: ImageViewType) -> Self {
3541 self.inner.view_type = view_type;
3542 self
3543 }
format(mut self, format: Format) -> Self3544 pub fn format(mut self, format: Format) -> Self {
3545 self.inner.format = format;
3546 self
3547 }
components(mut self, components: ComponentMapping) -> Self3548 pub fn components(mut self, components: ComponentMapping) -> Self {
3549 self.inner.components = components;
3550 self
3551 }
subresource_range(mut self, subresource_range: ImageSubresourceRange) -> Self3552 pub fn subresource_range(mut self, subresource_range: ImageSubresourceRange) -> Self {
3553 self.inner.subresource_range = subresource_range;
3554 self
3555 }
3556 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
3557 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
3558 #[doc = r" valid extension structs can be pushed into the chain."]
3559 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
3560 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsImageViewCreateInfo>(mut self, next: &'a mut T) -> Self3561 pub fn push_next<T: ExtendsImageViewCreateInfo>(mut self, next: &'a mut T) -> Self {
3562 unsafe {
3563 let next_ptr = next as *mut T as *mut BaseOutStructure;
3564 let last_next = ptr_chain_iter(next).last().unwrap();
3565 (*last_next).p_next = self.inner.p_next as _;
3566 self.inner.p_next = next_ptr as _;
3567 }
3568 self
3569 }
3570 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3571 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3572 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageViewCreateInfo3573 pub fn build(self) -> ImageViewCreateInfo {
3574 self.inner
3575 }
3576 }
3577 #[repr(C)]
3578 #[cfg_attr(feature = "debug", derive(Debug))]
3579 #[derive(Copy, Clone, Default)]
3580 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferCopy.html>"]
3581 pub struct BufferCopy {
3582 pub src_offset: DeviceSize,
3583 pub dst_offset: DeviceSize,
3584 pub size: DeviceSize,
3585 }
3586 impl BufferCopy {
builder<'a>() -> BufferCopyBuilder<'a>3587 pub fn builder<'a>() -> BufferCopyBuilder<'a> {
3588 BufferCopyBuilder {
3589 inner: Self::default(),
3590 marker: ::std::marker::PhantomData,
3591 }
3592 }
3593 }
3594 #[repr(transparent)]
3595 pub struct BufferCopyBuilder<'a> {
3596 inner: BufferCopy,
3597 marker: ::std::marker::PhantomData<&'a ()>,
3598 }
3599 impl<'a> ::std::ops::Deref for BufferCopyBuilder<'a> {
3600 type Target = BufferCopy;
deref(&self) -> &Self::Target3601 fn deref(&self) -> &Self::Target {
3602 &self.inner
3603 }
3604 }
3605 impl<'a> ::std::ops::DerefMut for BufferCopyBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3606 fn deref_mut(&mut self) -> &mut Self::Target {
3607 &mut self.inner
3608 }
3609 }
3610 impl<'a> BufferCopyBuilder<'a> {
src_offset(mut self, src_offset: DeviceSize) -> Self3611 pub fn src_offset(mut self, src_offset: DeviceSize) -> Self {
3612 self.inner.src_offset = src_offset;
3613 self
3614 }
dst_offset(mut self, dst_offset: DeviceSize) -> Self3615 pub fn dst_offset(mut self, dst_offset: DeviceSize) -> Self {
3616 self.inner.dst_offset = dst_offset;
3617 self
3618 }
size(mut self, size: DeviceSize) -> Self3619 pub fn size(mut self, size: DeviceSize) -> Self {
3620 self.inner.size = size;
3621 self
3622 }
3623 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3624 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3625 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BufferCopy3626 pub fn build(self) -> BufferCopy {
3627 self.inner
3628 }
3629 }
3630 #[repr(C)]
3631 #[cfg_attr(feature = "debug", derive(Debug))]
3632 #[derive(Copy, Clone, Default)]
3633 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseMemoryBind.html>"]
3634 pub struct SparseMemoryBind {
3635 pub resource_offset: DeviceSize,
3636 pub size: DeviceSize,
3637 pub memory: DeviceMemory,
3638 pub memory_offset: DeviceSize,
3639 pub flags: SparseMemoryBindFlags,
3640 }
3641 impl SparseMemoryBind {
builder<'a>() -> SparseMemoryBindBuilder<'a>3642 pub fn builder<'a>() -> SparseMemoryBindBuilder<'a> {
3643 SparseMemoryBindBuilder {
3644 inner: Self::default(),
3645 marker: ::std::marker::PhantomData,
3646 }
3647 }
3648 }
3649 #[repr(transparent)]
3650 pub struct SparseMemoryBindBuilder<'a> {
3651 inner: SparseMemoryBind,
3652 marker: ::std::marker::PhantomData<&'a ()>,
3653 }
3654 impl<'a> ::std::ops::Deref for SparseMemoryBindBuilder<'a> {
3655 type Target = SparseMemoryBind;
deref(&self) -> &Self::Target3656 fn deref(&self) -> &Self::Target {
3657 &self.inner
3658 }
3659 }
3660 impl<'a> ::std::ops::DerefMut for SparseMemoryBindBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3661 fn deref_mut(&mut self) -> &mut Self::Target {
3662 &mut self.inner
3663 }
3664 }
3665 impl<'a> SparseMemoryBindBuilder<'a> {
resource_offset(mut self, resource_offset: DeviceSize) -> Self3666 pub fn resource_offset(mut self, resource_offset: DeviceSize) -> Self {
3667 self.inner.resource_offset = resource_offset;
3668 self
3669 }
size(mut self, size: DeviceSize) -> Self3670 pub fn size(mut self, size: DeviceSize) -> Self {
3671 self.inner.size = size;
3672 self
3673 }
memory(mut self, memory: DeviceMemory) -> Self3674 pub fn memory(mut self, memory: DeviceMemory) -> Self {
3675 self.inner.memory = memory;
3676 self
3677 }
memory_offset(mut self, memory_offset: DeviceSize) -> Self3678 pub fn memory_offset(mut self, memory_offset: DeviceSize) -> Self {
3679 self.inner.memory_offset = memory_offset;
3680 self
3681 }
flags(mut self, flags: SparseMemoryBindFlags) -> Self3682 pub fn flags(mut self, flags: SparseMemoryBindFlags) -> Self {
3683 self.inner.flags = flags;
3684 self
3685 }
3686 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3687 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3688 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseMemoryBind3689 pub fn build(self) -> SparseMemoryBind {
3690 self.inner
3691 }
3692 }
3693 #[repr(C)]
3694 #[cfg_attr(feature = "debug", derive(Debug))]
3695 #[derive(Copy, Clone, Default)]
3696 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageMemoryBind.html>"]
3697 pub struct SparseImageMemoryBind {
3698 pub subresource: ImageSubresource,
3699 pub offset: Offset3D,
3700 pub extent: Extent3D,
3701 pub memory: DeviceMemory,
3702 pub memory_offset: DeviceSize,
3703 pub flags: SparseMemoryBindFlags,
3704 }
3705 impl SparseImageMemoryBind {
builder<'a>() -> SparseImageMemoryBindBuilder<'a>3706 pub fn builder<'a>() -> SparseImageMemoryBindBuilder<'a> {
3707 SparseImageMemoryBindBuilder {
3708 inner: Self::default(),
3709 marker: ::std::marker::PhantomData,
3710 }
3711 }
3712 }
3713 #[repr(transparent)]
3714 pub struct SparseImageMemoryBindBuilder<'a> {
3715 inner: SparseImageMemoryBind,
3716 marker: ::std::marker::PhantomData<&'a ()>,
3717 }
3718 impl<'a> ::std::ops::Deref for SparseImageMemoryBindBuilder<'a> {
3719 type Target = SparseImageMemoryBind;
deref(&self) -> &Self::Target3720 fn deref(&self) -> &Self::Target {
3721 &self.inner
3722 }
3723 }
3724 impl<'a> ::std::ops::DerefMut for SparseImageMemoryBindBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3725 fn deref_mut(&mut self) -> &mut Self::Target {
3726 &mut self.inner
3727 }
3728 }
3729 impl<'a> SparseImageMemoryBindBuilder<'a> {
subresource(mut self, subresource: ImageSubresource) -> Self3730 pub fn subresource(mut self, subresource: ImageSubresource) -> Self {
3731 self.inner.subresource = subresource;
3732 self
3733 }
offset(mut self, offset: Offset3D) -> Self3734 pub fn offset(mut self, offset: Offset3D) -> Self {
3735 self.inner.offset = offset;
3736 self
3737 }
extent(mut self, extent: Extent3D) -> Self3738 pub fn extent(mut self, extent: Extent3D) -> Self {
3739 self.inner.extent = extent;
3740 self
3741 }
memory(mut self, memory: DeviceMemory) -> Self3742 pub fn memory(mut self, memory: DeviceMemory) -> Self {
3743 self.inner.memory = memory;
3744 self
3745 }
memory_offset(mut self, memory_offset: DeviceSize) -> Self3746 pub fn memory_offset(mut self, memory_offset: DeviceSize) -> Self {
3747 self.inner.memory_offset = memory_offset;
3748 self
3749 }
flags(mut self, flags: SparseMemoryBindFlags) -> Self3750 pub fn flags(mut self, flags: SparseMemoryBindFlags) -> Self {
3751 self.inner.flags = flags;
3752 self
3753 }
3754 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3755 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3756 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseImageMemoryBind3757 pub fn build(self) -> SparseImageMemoryBind {
3758 self.inner
3759 }
3760 }
3761 #[repr(C)]
3762 #[cfg_attr(feature = "debug", derive(Debug))]
3763 #[derive(Copy, Clone)]
3764 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseBufferMemoryBindInfo.html>"]
3765 pub struct SparseBufferMemoryBindInfo {
3766 pub buffer: Buffer,
3767 pub bind_count: u32,
3768 pub p_binds: *const SparseMemoryBind,
3769 }
3770 impl ::std::default::Default for SparseBufferMemoryBindInfo {
default() -> Self3771 fn default() -> Self {
3772 Self {
3773 buffer: Buffer::default(),
3774 bind_count: u32::default(),
3775 p_binds: ::std::ptr::null(),
3776 }
3777 }
3778 }
3779 impl SparseBufferMemoryBindInfo {
builder<'a>() -> SparseBufferMemoryBindInfoBuilder<'a>3780 pub fn builder<'a>() -> SparseBufferMemoryBindInfoBuilder<'a> {
3781 SparseBufferMemoryBindInfoBuilder {
3782 inner: Self::default(),
3783 marker: ::std::marker::PhantomData,
3784 }
3785 }
3786 }
3787 #[repr(transparent)]
3788 pub struct SparseBufferMemoryBindInfoBuilder<'a> {
3789 inner: SparseBufferMemoryBindInfo,
3790 marker: ::std::marker::PhantomData<&'a ()>,
3791 }
3792 impl<'a> ::std::ops::Deref for SparseBufferMemoryBindInfoBuilder<'a> {
3793 type Target = SparseBufferMemoryBindInfo;
deref(&self) -> &Self::Target3794 fn deref(&self) -> &Self::Target {
3795 &self.inner
3796 }
3797 }
3798 impl<'a> ::std::ops::DerefMut for SparseBufferMemoryBindInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3799 fn deref_mut(&mut self) -> &mut Self::Target {
3800 &mut self.inner
3801 }
3802 }
3803 impl<'a> SparseBufferMemoryBindInfoBuilder<'a> {
buffer(mut self, buffer: Buffer) -> Self3804 pub fn buffer(mut self, buffer: Buffer) -> Self {
3805 self.inner.buffer = buffer;
3806 self
3807 }
binds(mut self, binds: &'a [SparseMemoryBind]) -> Self3808 pub fn binds(mut self, binds: &'a [SparseMemoryBind]) -> Self {
3809 self.inner.bind_count = binds.len() as _;
3810 self.inner.p_binds = binds.as_ptr();
3811 self
3812 }
3813 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3814 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3815 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseBufferMemoryBindInfo3816 pub fn build(self) -> SparseBufferMemoryBindInfo {
3817 self.inner
3818 }
3819 }
3820 #[repr(C)]
3821 #[cfg_attr(feature = "debug", derive(Debug))]
3822 #[derive(Copy, Clone)]
3823 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageOpaqueMemoryBindInfo.html>"]
3824 pub struct SparseImageOpaqueMemoryBindInfo {
3825 pub image: Image,
3826 pub bind_count: u32,
3827 pub p_binds: *const SparseMemoryBind,
3828 }
3829 impl ::std::default::Default for SparseImageOpaqueMemoryBindInfo {
default() -> Self3830 fn default() -> Self {
3831 Self {
3832 image: Image::default(),
3833 bind_count: u32::default(),
3834 p_binds: ::std::ptr::null(),
3835 }
3836 }
3837 }
3838 impl SparseImageOpaqueMemoryBindInfo {
builder<'a>() -> SparseImageOpaqueMemoryBindInfoBuilder<'a>3839 pub fn builder<'a>() -> SparseImageOpaqueMemoryBindInfoBuilder<'a> {
3840 SparseImageOpaqueMemoryBindInfoBuilder {
3841 inner: Self::default(),
3842 marker: ::std::marker::PhantomData,
3843 }
3844 }
3845 }
3846 #[repr(transparent)]
3847 pub struct SparseImageOpaqueMemoryBindInfoBuilder<'a> {
3848 inner: SparseImageOpaqueMemoryBindInfo,
3849 marker: ::std::marker::PhantomData<&'a ()>,
3850 }
3851 impl<'a> ::std::ops::Deref for SparseImageOpaqueMemoryBindInfoBuilder<'a> {
3852 type Target = SparseImageOpaqueMemoryBindInfo;
deref(&self) -> &Self::Target3853 fn deref(&self) -> &Self::Target {
3854 &self.inner
3855 }
3856 }
3857 impl<'a> ::std::ops::DerefMut for SparseImageOpaqueMemoryBindInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3858 fn deref_mut(&mut self) -> &mut Self::Target {
3859 &mut self.inner
3860 }
3861 }
3862 impl<'a> SparseImageOpaqueMemoryBindInfoBuilder<'a> {
image(mut self, image: Image) -> Self3863 pub fn image(mut self, image: Image) -> Self {
3864 self.inner.image = image;
3865 self
3866 }
binds(mut self, binds: &'a [SparseMemoryBind]) -> Self3867 pub fn binds(mut self, binds: &'a [SparseMemoryBind]) -> Self {
3868 self.inner.bind_count = binds.len() as _;
3869 self.inner.p_binds = binds.as_ptr();
3870 self
3871 }
3872 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3873 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3874 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseImageOpaqueMemoryBindInfo3875 pub fn build(self) -> SparseImageOpaqueMemoryBindInfo {
3876 self.inner
3877 }
3878 }
3879 #[repr(C)]
3880 #[cfg_attr(feature = "debug", derive(Debug))]
3881 #[derive(Copy, Clone)]
3882 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageMemoryBindInfo.html>"]
3883 pub struct SparseImageMemoryBindInfo {
3884 pub image: Image,
3885 pub bind_count: u32,
3886 pub p_binds: *const SparseImageMemoryBind,
3887 }
3888 impl ::std::default::Default for SparseImageMemoryBindInfo {
default() -> Self3889 fn default() -> Self {
3890 Self {
3891 image: Image::default(),
3892 bind_count: u32::default(),
3893 p_binds: ::std::ptr::null(),
3894 }
3895 }
3896 }
3897 impl SparseImageMemoryBindInfo {
builder<'a>() -> SparseImageMemoryBindInfoBuilder<'a>3898 pub fn builder<'a>() -> SparseImageMemoryBindInfoBuilder<'a> {
3899 SparseImageMemoryBindInfoBuilder {
3900 inner: Self::default(),
3901 marker: ::std::marker::PhantomData,
3902 }
3903 }
3904 }
3905 #[repr(transparent)]
3906 pub struct SparseImageMemoryBindInfoBuilder<'a> {
3907 inner: SparseImageMemoryBindInfo,
3908 marker: ::std::marker::PhantomData<&'a ()>,
3909 }
3910 impl<'a> ::std::ops::Deref for SparseImageMemoryBindInfoBuilder<'a> {
3911 type Target = SparseImageMemoryBindInfo;
deref(&self) -> &Self::Target3912 fn deref(&self) -> &Self::Target {
3913 &self.inner
3914 }
3915 }
3916 impl<'a> ::std::ops::DerefMut for SparseImageMemoryBindInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3917 fn deref_mut(&mut self) -> &mut Self::Target {
3918 &mut self.inner
3919 }
3920 }
3921 impl<'a> SparseImageMemoryBindInfoBuilder<'a> {
image(mut self, image: Image) -> Self3922 pub fn image(mut self, image: Image) -> Self {
3923 self.inner.image = image;
3924 self
3925 }
binds(mut self, binds: &'a [SparseImageMemoryBind]) -> Self3926 pub fn binds(mut self, binds: &'a [SparseImageMemoryBind]) -> Self {
3927 self.inner.bind_count = binds.len() as _;
3928 self.inner.p_binds = binds.as_ptr();
3929 self
3930 }
3931 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
3932 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
3933 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SparseImageMemoryBindInfo3934 pub fn build(self) -> SparseImageMemoryBindInfo {
3935 self.inner
3936 }
3937 }
3938 #[repr(C)]
3939 #[cfg_attr(feature = "debug", derive(Debug))]
3940 #[derive(Copy, Clone)]
3941 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBindSparseInfo.html>"]
3942 pub struct BindSparseInfo {
3943 pub s_type: StructureType,
3944 pub p_next: *const c_void,
3945 pub wait_semaphore_count: u32,
3946 pub p_wait_semaphores: *const Semaphore,
3947 pub buffer_bind_count: u32,
3948 pub p_buffer_binds: *const SparseBufferMemoryBindInfo,
3949 pub image_opaque_bind_count: u32,
3950 pub p_image_opaque_binds: *const SparseImageOpaqueMemoryBindInfo,
3951 pub image_bind_count: u32,
3952 pub p_image_binds: *const SparseImageMemoryBindInfo,
3953 pub signal_semaphore_count: u32,
3954 pub p_signal_semaphores: *const Semaphore,
3955 }
3956 impl ::std::default::Default for BindSparseInfo {
default() -> Self3957 fn default() -> Self {
3958 Self {
3959 s_type: StructureType::BIND_SPARSE_INFO,
3960 p_next: ::std::ptr::null(),
3961 wait_semaphore_count: u32::default(),
3962 p_wait_semaphores: ::std::ptr::null(),
3963 buffer_bind_count: u32::default(),
3964 p_buffer_binds: ::std::ptr::null(),
3965 image_opaque_bind_count: u32::default(),
3966 p_image_opaque_binds: ::std::ptr::null(),
3967 image_bind_count: u32::default(),
3968 p_image_binds: ::std::ptr::null(),
3969 signal_semaphore_count: u32::default(),
3970 p_signal_semaphores: ::std::ptr::null(),
3971 }
3972 }
3973 }
3974 impl BindSparseInfo {
builder<'a>() -> BindSparseInfoBuilder<'a>3975 pub fn builder<'a>() -> BindSparseInfoBuilder<'a> {
3976 BindSparseInfoBuilder {
3977 inner: Self::default(),
3978 marker: ::std::marker::PhantomData,
3979 }
3980 }
3981 }
3982 #[repr(transparent)]
3983 pub struct BindSparseInfoBuilder<'a> {
3984 inner: BindSparseInfo,
3985 marker: ::std::marker::PhantomData<&'a ()>,
3986 }
3987 pub unsafe trait ExtendsBindSparseInfo {}
3988 impl<'a> ::std::ops::Deref for BindSparseInfoBuilder<'a> {
3989 type Target = BindSparseInfo;
deref(&self) -> &Self::Target3990 fn deref(&self) -> &Self::Target {
3991 &self.inner
3992 }
3993 }
3994 impl<'a> ::std::ops::DerefMut for BindSparseInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target3995 fn deref_mut(&mut self) -> &mut Self::Target {
3996 &mut self.inner
3997 }
3998 }
3999 impl<'a> BindSparseInfoBuilder<'a> {
wait_semaphores(mut self, wait_semaphores: &'a [Semaphore]) -> Self4000 pub fn wait_semaphores(mut self, wait_semaphores: &'a [Semaphore]) -> Self {
4001 self.inner.wait_semaphore_count = wait_semaphores.len() as _;
4002 self.inner.p_wait_semaphores = wait_semaphores.as_ptr();
4003 self
4004 }
buffer_binds(mut self, buffer_binds: &'a [SparseBufferMemoryBindInfo]) -> Self4005 pub fn buffer_binds(mut self, buffer_binds: &'a [SparseBufferMemoryBindInfo]) -> Self {
4006 self.inner.buffer_bind_count = buffer_binds.len() as _;
4007 self.inner.p_buffer_binds = buffer_binds.as_ptr();
4008 self
4009 }
image_opaque_binds( mut self, image_opaque_binds: &'a [SparseImageOpaqueMemoryBindInfo], ) -> Self4010 pub fn image_opaque_binds(
4011 mut self,
4012 image_opaque_binds: &'a [SparseImageOpaqueMemoryBindInfo],
4013 ) -> Self {
4014 self.inner.image_opaque_bind_count = image_opaque_binds.len() as _;
4015 self.inner.p_image_opaque_binds = image_opaque_binds.as_ptr();
4016 self
4017 }
image_binds(mut self, image_binds: &'a [SparseImageMemoryBindInfo]) -> Self4018 pub fn image_binds(mut self, image_binds: &'a [SparseImageMemoryBindInfo]) -> Self {
4019 self.inner.image_bind_count = image_binds.len() as _;
4020 self.inner.p_image_binds = image_binds.as_ptr();
4021 self
4022 }
signal_semaphores(mut self, signal_semaphores: &'a [Semaphore]) -> Self4023 pub fn signal_semaphores(mut self, signal_semaphores: &'a [Semaphore]) -> Self {
4024 self.inner.signal_semaphore_count = signal_semaphores.len() as _;
4025 self.inner.p_signal_semaphores = signal_semaphores.as_ptr();
4026 self
4027 }
4028 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4029 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4030 #[doc = r" valid extension structs can be pushed into the chain."]
4031 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4032 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsBindSparseInfo>(mut self, next: &'a mut T) -> Self4033 pub fn push_next<T: ExtendsBindSparseInfo>(mut self, next: &'a mut T) -> Self {
4034 unsafe {
4035 let next_ptr = next as *mut T as *mut BaseOutStructure;
4036 let last_next = ptr_chain_iter(next).last().unwrap();
4037 (*last_next).p_next = self.inner.p_next as _;
4038 self.inner.p_next = next_ptr as _;
4039 }
4040 self
4041 }
4042 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4043 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4044 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BindSparseInfo4045 pub fn build(self) -> BindSparseInfo {
4046 self.inner
4047 }
4048 }
4049 #[repr(C)]
4050 #[cfg_attr(feature = "debug", derive(Debug))]
4051 #[derive(Copy, Clone, Default)]
4052 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageCopy.html>"]
4053 pub struct ImageCopy {
4054 pub src_subresource: ImageSubresourceLayers,
4055 pub src_offset: Offset3D,
4056 pub dst_subresource: ImageSubresourceLayers,
4057 pub dst_offset: Offset3D,
4058 pub extent: Extent3D,
4059 }
4060 impl ImageCopy {
builder<'a>() -> ImageCopyBuilder<'a>4061 pub fn builder<'a>() -> ImageCopyBuilder<'a> {
4062 ImageCopyBuilder {
4063 inner: Self::default(),
4064 marker: ::std::marker::PhantomData,
4065 }
4066 }
4067 }
4068 #[repr(transparent)]
4069 pub struct ImageCopyBuilder<'a> {
4070 inner: ImageCopy,
4071 marker: ::std::marker::PhantomData<&'a ()>,
4072 }
4073 impl<'a> ::std::ops::Deref for ImageCopyBuilder<'a> {
4074 type Target = ImageCopy;
deref(&self) -> &Self::Target4075 fn deref(&self) -> &Self::Target {
4076 &self.inner
4077 }
4078 }
4079 impl<'a> ::std::ops::DerefMut for ImageCopyBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4080 fn deref_mut(&mut self) -> &mut Self::Target {
4081 &mut self.inner
4082 }
4083 }
4084 impl<'a> ImageCopyBuilder<'a> {
src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self4085 pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self {
4086 self.inner.src_subresource = src_subresource;
4087 self
4088 }
src_offset(mut self, src_offset: Offset3D) -> Self4089 pub fn src_offset(mut self, src_offset: Offset3D) -> Self {
4090 self.inner.src_offset = src_offset;
4091 self
4092 }
dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self4093 pub fn dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self {
4094 self.inner.dst_subresource = dst_subresource;
4095 self
4096 }
dst_offset(mut self, dst_offset: Offset3D) -> Self4097 pub fn dst_offset(mut self, dst_offset: Offset3D) -> Self {
4098 self.inner.dst_offset = dst_offset;
4099 self
4100 }
extent(mut self, extent: Extent3D) -> Self4101 pub fn extent(mut self, extent: Extent3D) -> Self {
4102 self.inner.extent = extent;
4103 self
4104 }
4105 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4106 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4107 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageCopy4108 pub fn build(self) -> ImageCopy {
4109 self.inner
4110 }
4111 }
4112 #[repr(C)]
4113 #[cfg_attr(feature = "debug", derive(Debug))]
4114 #[derive(Copy, Clone)]
4115 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageBlit.html>"]
4116 pub struct ImageBlit {
4117 pub src_subresource: ImageSubresourceLayers,
4118 pub src_offsets: [Offset3D; 2],
4119 pub dst_subresource: ImageSubresourceLayers,
4120 pub dst_offsets: [Offset3D; 2],
4121 }
4122 impl ::std::default::Default for ImageBlit {
default() -> Self4123 fn default() -> Self {
4124 Self {
4125 src_subresource: ImageSubresourceLayers::default(),
4126 src_offsets: unsafe { ::std::mem::zeroed() },
4127 dst_subresource: ImageSubresourceLayers::default(),
4128 dst_offsets: unsafe { ::std::mem::zeroed() },
4129 }
4130 }
4131 }
4132 impl ImageBlit {
builder<'a>() -> ImageBlitBuilder<'a>4133 pub fn builder<'a>() -> ImageBlitBuilder<'a> {
4134 ImageBlitBuilder {
4135 inner: Self::default(),
4136 marker: ::std::marker::PhantomData,
4137 }
4138 }
4139 }
4140 #[repr(transparent)]
4141 pub struct ImageBlitBuilder<'a> {
4142 inner: ImageBlit,
4143 marker: ::std::marker::PhantomData<&'a ()>,
4144 }
4145 impl<'a> ::std::ops::Deref for ImageBlitBuilder<'a> {
4146 type Target = ImageBlit;
deref(&self) -> &Self::Target4147 fn deref(&self) -> &Self::Target {
4148 &self.inner
4149 }
4150 }
4151 impl<'a> ::std::ops::DerefMut for ImageBlitBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4152 fn deref_mut(&mut self) -> &mut Self::Target {
4153 &mut self.inner
4154 }
4155 }
4156 impl<'a> ImageBlitBuilder<'a> {
src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self4157 pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self {
4158 self.inner.src_subresource = src_subresource;
4159 self
4160 }
src_offsets(mut self, src_offsets: [Offset3D; 2]) -> Self4161 pub fn src_offsets(mut self, src_offsets: [Offset3D; 2]) -> Self {
4162 self.inner.src_offsets = src_offsets;
4163 self
4164 }
dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self4165 pub fn dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self {
4166 self.inner.dst_subresource = dst_subresource;
4167 self
4168 }
dst_offsets(mut self, dst_offsets: [Offset3D; 2]) -> Self4169 pub fn dst_offsets(mut self, dst_offsets: [Offset3D; 2]) -> Self {
4170 self.inner.dst_offsets = dst_offsets;
4171 self
4172 }
4173 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4174 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4175 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageBlit4176 pub fn build(self) -> ImageBlit {
4177 self.inner
4178 }
4179 }
4180 #[repr(C)]
4181 #[cfg_attr(feature = "debug", derive(Debug))]
4182 #[derive(Copy, Clone, Default)]
4183 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferImageCopy.html>"]
4184 pub struct BufferImageCopy {
4185 pub buffer_offset: DeviceSize,
4186 pub buffer_row_length: u32,
4187 pub buffer_image_height: u32,
4188 pub image_subresource: ImageSubresourceLayers,
4189 pub image_offset: Offset3D,
4190 pub image_extent: Extent3D,
4191 }
4192 impl BufferImageCopy {
builder<'a>() -> BufferImageCopyBuilder<'a>4193 pub fn builder<'a>() -> BufferImageCopyBuilder<'a> {
4194 BufferImageCopyBuilder {
4195 inner: Self::default(),
4196 marker: ::std::marker::PhantomData,
4197 }
4198 }
4199 }
4200 #[repr(transparent)]
4201 pub struct BufferImageCopyBuilder<'a> {
4202 inner: BufferImageCopy,
4203 marker: ::std::marker::PhantomData<&'a ()>,
4204 }
4205 impl<'a> ::std::ops::Deref for BufferImageCopyBuilder<'a> {
4206 type Target = BufferImageCopy;
deref(&self) -> &Self::Target4207 fn deref(&self) -> &Self::Target {
4208 &self.inner
4209 }
4210 }
4211 impl<'a> ::std::ops::DerefMut for BufferImageCopyBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4212 fn deref_mut(&mut self) -> &mut Self::Target {
4213 &mut self.inner
4214 }
4215 }
4216 impl<'a> BufferImageCopyBuilder<'a> {
buffer_offset(mut self, buffer_offset: DeviceSize) -> Self4217 pub fn buffer_offset(mut self, buffer_offset: DeviceSize) -> Self {
4218 self.inner.buffer_offset = buffer_offset;
4219 self
4220 }
buffer_row_length(mut self, buffer_row_length: u32) -> Self4221 pub fn buffer_row_length(mut self, buffer_row_length: u32) -> Self {
4222 self.inner.buffer_row_length = buffer_row_length;
4223 self
4224 }
buffer_image_height(mut self, buffer_image_height: u32) -> Self4225 pub fn buffer_image_height(mut self, buffer_image_height: u32) -> Self {
4226 self.inner.buffer_image_height = buffer_image_height;
4227 self
4228 }
image_subresource(mut self, image_subresource: ImageSubresourceLayers) -> Self4229 pub fn image_subresource(mut self, image_subresource: ImageSubresourceLayers) -> Self {
4230 self.inner.image_subresource = image_subresource;
4231 self
4232 }
image_offset(mut self, image_offset: Offset3D) -> Self4233 pub fn image_offset(mut self, image_offset: Offset3D) -> Self {
4234 self.inner.image_offset = image_offset;
4235 self
4236 }
image_extent(mut self, image_extent: Extent3D) -> Self4237 pub fn image_extent(mut self, image_extent: Extent3D) -> Self {
4238 self.inner.image_extent = image_extent;
4239 self
4240 }
4241 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4242 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4243 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> BufferImageCopy4244 pub fn build(self) -> BufferImageCopy {
4245 self.inner
4246 }
4247 }
4248 #[repr(C)]
4249 #[cfg_attr(feature = "debug", derive(Debug))]
4250 #[derive(Copy, Clone, Default)]
4251 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageResolve.html>"]
4252 pub struct ImageResolve {
4253 pub src_subresource: ImageSubresourceLayers,
4254 pub src_offset: Offset3D,
4255 pub dst_subresource: ImageSubresourceLayers,
4256 pub dst_offset: Offset3D,
4257 pub extent: Extent3D,
4258 }
4259 impl ImageResolve {
builder<'a>() -> ImageResolveBuilder<'a>4260 pub fn builder<'a>() -> ImageResolveBuilder<'a> {
4261 ImageResolveBuilder {
4262 inner: Self::default(),
4263 marker: ::std::marker::PhantomData,
4264 }
4265 }
4266 }
4267 #[repr(transparent)]
4268 pub struct ImageResolveBuilder<'a> {
4269 inner: ImageResolve,
4270 marker: ::std::marker::PhantomData<&'a ()>,
4271 }
4272 impl<'a> ::std::ops::Deref for ImageResolveBuilder<'a> {
4273 type Target = ImageResolve;
deref(&self) -> &Self::Target4274 fn deref(&self) -> &Self::Target {
4275 &self.inner
4276 }
4277 }
4278 impl<'a> ::std::ops::DerefMut for ImageResolveBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4279 fn deref_mut(&mut self) -> &mut Self::Target {
4280 &mut self.inner
4281 }
4282 }
4283 impl<'a> ImageResolveBuilder<'a> {
src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self4284 pub fn src_subresource(mut self, src_subresource: ImageSubresourceLayers) -> Self {
4285 self.inner.src_subresource = src_subresource;
4286 self
4287 }
src_offset(mut self, src_offset: Offset3D) -> Self4288 pub fn src_offset(mut self, src_offset: Offset3D) -> Self {
4289 self.inner.src_offset = src_offset;
4290 self
4291 }
dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self4292 pub fn dst_subresource(mut self, dst_subresource: ImageSubresourceLayers) -> Self {
4293 self.inner.dst_subresource = dst_subresource;
4294 self
4295 }
dst_offset(mut self, dst_offset: Offset3D) -> Self4296 pub fn dst_offset(mut self, dst_offset: Offset3D) -> Self {
4297 self.inner.dst_offset = dst_offset;
4298 self
4299 }
extent(mut self, extent: Extent3D) -> Self4300 pub fn extent(mut self, extent: Extent3D) -> Self {
4301 self.inner.extent = extent;
4302 self
4303 }
4304 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4305 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4306 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ImageResolve4307 pub fn build(self) -> ImageResolve {
4308 self.inner
4309 }
4310 }
4311 #[repr(C)]
4312 #[cfg_attr(feature = "debug", derive(Debug))]
4313 #[derive(Copy, Clone)]
4314 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderModuleCreateInfo.html>"]
4315 pub struct ShaderModuleCreateInfo {
4316 pub s_type: StructureType,
4317 pub p_next: *const c_void,
4318 pub flags: ShaderModuleCreateFlags,
4319 pub code_size: usize,
4320 pub p_code: *const u32,
4321 }
4322 impl ::std::default::Default for ShaderModuleCreateInfo {
default() -> Self4323 fn default() -> Self {
4324 Self {
4325 s_type: StructureType::SHADER_MODULE_CREATE_INFO,
4326 p_next: ::std::ptr::null(),
4327 flags: ShaderModuleCreateFlags::default(),
4328 code_size: usize::default(),
4329 p_code: ::std::ptr::null(),
4330 }
4331 }
4332 }
4333 impl ShaderModuleCreateInfo {
builder<'a>() -> ShaderModuleCreateInfoBuilder<'a>4334 pub fn builder<'a>() -> ShaderModuleCreateInfoBuilder<'a> {
4335 ShaderModuleCreateInfoBuilder {
4336 inner: Self::default(),
4337 marker: ::std::marker::PhantomData,
4338 }
4339 }
4340 }
4341 #[repr(transparent)]
4342 pub struct ShaderModuleCreateInfoBuilder<'a> {
4343 inner: ShaderModuleCreateInfo,
4344 marker: ::std::marker::PhantomData<&'a ()>,
4345 }
4346 pub unsafe trait ExtendsShaderModuleCreateInfo {}
4347 impl<'a> ::std::ops::Deref for ShaderModuleCreateInfoBuilder<'a> {
4348 type Target = ShaderModuleCreateInfo;
deref(&self) -> &Self::Target4349 fn deref(&self) -> &Self::Target {
4350 &self.inner
4351 }
4352 }
4353 impl<'a> ::std::ops::DerefMut for ShaderModuleCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4354 fn deref_mut(&mut self) -> &mut Self::Target {
4355 &mut self.inner
4356 }
4357 }
4358 impl<'a> ShaderModuleCreateInfoBuilder<'a> {
flags(mut self, flags: ShaderModuleCreateFlags) -> Self4359 pub fn flags(mut self, flags: ShaderModuleCreateFlags) -> Self {
4360 self.inner.flags = flags;
4361 self
4362 }
code(mut self, code: &'a [u32]) -> Self4363 pub fn code(mut self, code: &'a [u32]) -> Self {
4364 self.inner.code_size = code.len() * 4;
4365 self.inner.p_code = code.as_ptr() as *const u32;
4366 self
4367 }
4368 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4369 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4370 #[doc = r" valid extension structs can be pushed into the chain."]
4371 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4372 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsShaderModuleCreateInfo>(mut self, next: &'a mut T) -> Self4373 pub fn push_next<T: ExtendsShaderModuleCreateInfo>(mut self, next: &'a mut T) -> Self {
4374 unsafe {
4375 let next_ptr = next as *mut T as *mut BaseOutStructure;
4376 let last_next = ptr_chain_iter(next).last().unwrap();
4377 (*last_next).p_next = self.inner.p_next as _;
4378 self.inner.p_next = next_ptr as _;
4379 }
4380 self
4381 }
4382 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4383 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4384 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ShaderModuleCreateInfo4385 pub fn build(self) -> ShaderModuleCreateInfo {
4386 self.inner
4387 }
4388 }
4389 #[repr(C)]
4390 #[cfg_attr(feature = "debug", derive(Debug))]
4391 #[derive(Copy, Clone)]
4392 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayoutBinding.html>"]
4393 pub struct DescriptorSetLayoutBinding {
4394 pub binding: u32,
4395 pub descriptor_type: DescriptorType,
4396 pub descriptor_count: u32,
4397 pub stage_flags: ShaderStageFlags,
4398 pub p_immutable_samplers: *const Sampler,
4399 }
4400 impl ::std::default::Default for DescriptorSetLayoutBinding {
default() -> Self4401 fn default() -> Self {
4402 Self {
4403 binding: u32::default(),
4404 descriptor_type: DescriptorType::default(),
4405 descriptor_count: u32::default(),
4406 stage_flags: ShaderStageFlags::default(),
4407 p_immutable_samplers: ::std::ptr::null(),
4408 }
4409 }
4410 }
4411 impl DescriptorSetLayoutBinding {
builder<'a>() -> DescriptorSetLayoutBindingBuilder<'a>4412 pub fn builder<'a>() -> DescriptorSetLayoutBindingBuilder<'a> {
4413 DescriptorSetLayoutBindingBuilder {
4414 inner: Self::default(),
4415 marker: ::std::marker::PhantomData,
4416 }
4417 }
4418 }
4419 #[repr(transparent)]
4420 pub struct DescriptorSetLayoutBindingBuilder<'a> {
4421 inner: DescriptorSetLayoutBinding,
4422 marker: ::std::marker::PhantomData<&'a ()>,
4423 }
4424 impl<'a> ::std::ops::Deref for DescriptorSetLayoutBindingBuilder<'a> {
4425 type Target = DescriptorSetLayoutBinding;
deref(&self) -> &Self::Target4426 fn deref(&self) -> &Self::Target {
4427 &self.inner
4428 }
4429 }
4430 impl<'a> ::std::ops::DerefMut for DescriptorSetLayoutBindingBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4431 fn deref_mut(&mut self) -> &mut Self::Target {
4432 &mut self.inner
4433 }
4434 }
4435 impl<'a> DescriptorSetLayoutBindingBuilder<'a> {
binding(mut self, binding: u32) -> Self4436 pub fn binding(mut self, binding: u32) -> Self {
4437 self.inner.binding = binding;
4438 self
4439 }
descriptor_type(mut self, descriptor_type: DescriptorType) -> Self4440 pub fn descriptor_type(mut self, descriptor_type: DescriptorType) -> Self {
4441 self.inner.descriptor_type = descriptor_type;
4442 self
4443 }
descriptor_count(mut self, descriptor_count: u32) -> Self4444 pub fn descriptor_count(mut self, descriptor_count: u32) -> Self {
4445 self.inner.descriptor_count = descriptor_count;
4446 self
4447 }
stage_flags(mut self, stage_flags: ShaderStageFlags) -> Self4448 pub fn stage_flags(mut self, stage_flags: ShaderStageFlags) -> Self {
4449 self.inner.stage_flags = stage_flags;
4450 self
4451 }
immutable_samplers(mut self, immutable_samplers: &'a [Sampler]) -> Self4452 pub fn immutable_samplers(mut self, immutable_samplers: &'a [Sampler]) -> Self {
4453 self.inner.descriptor_count = immutable_samplers.len() as _;
4454 self.inner.p_immutable_samplers = immutable_samplers.as_ptr();
4455 self
4456 }
4457 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4458 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4459 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorSetLayoutBinding4460 pub fn build(self) -> DescriptorSetLayoutBinding {
4461 self.inner
4462 }
4463 }
4464 #[repr(C)]
4465 #[cfg_attr(feature = "debug", derive(Debug))]
4466 #[derive(Copy, Clone)]
4467 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayoutCreateInfo.html>"]
4468 pub struct DescriptorSetLayoutCreateInfo {
4469 pub s_type: StructureType,
4470 pub p_next: *const c_void,
4471 pub flags: DescriptorSetLayoutCreateFlags,
4472 pub binding_count: u32,
4473 pub p_bindings: *const DescriptorSetLayoutBinding,
4474 }
4475 impl ::std::default::Default for DescriptorSetLayoutCreateInfo {
default() -> Self4476 fn default() -> Self {
4477 Self {
4478 s_type: StructureType::DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
4479 p_next: ::std::ptr::null(),
4480 flags: DescriptorSetLayoutCreateFlags::default(),
4481 binding_count: u32::default(),
4482 p_bindings: ::std::ptr::null(),
4483 }
4484 }
4485 }
4486 impl DescriptorSetLayoutCreateInfo {
builder<'a>() -> DescriptorSetLayoutCreateInfoBuilder<'a>4487 pub fn builder<'a>() -> DescriptorSetLayoutCreateInfoBuilder<'a> {
4488 DescriptorSetLayoutCreateInfoBuilder {
4489 inner: Self::default(),
4490 marker: ::std::marker::PhantomData,
4491 }
4492 }
4493 }
4494 #[repr(transparent)]
4495 pub struct DescriptorSetLayoutCreateInfoBuilder<'a> {
4496 inner: DescriptorSetLayoutCreateInfo,
4497 marker: ::std::marker::PhantomData<&'a ()>,
4498 }
4499 pub unsafe trait ExtendsDescriptorSetLayoutCreateInfo {}
4500 impl<'a> ::std::ops::Deref for DescriptorSetLayoutCreateInfoBuilder<'a> {
4501 type Target = DescriptorSetLayoutCreateInfo;
deref(&self) -> &Self::Target4502 fn deref(&self) -> &Self::Target {
4503 &self.inner
4504 }
4505 }
4506 impl<'a> ::std::ops::DerefMut for DescriptorSetLayoutCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4507 fn deref_mut(&mut self) -> &mut Self::Target {
4508 &mut self.inner
4509 }
4510 }
4511 impl<'a> DescriptorSetLayoutCreateInfoBuilder<'a> {
flags(mut self, flags: DescriptorSetLayoutCreateFlags) -> Self4512 pub fn flags(mut self, flags: DescriptorSetLayoutCreateFlags) -> Self {
4513 self.inner.flags = flags;
4514 self
4515 }
bindings(mut self, bindings: &'a [DescriptorSetLayoutBinding]) -> Self4516 pub fn bindings(mut self, bindings: &'a [DescriptorSetLayoutBinding]) -> Self {
4517 self.inner.binding_count = bindings.len() as _;
4518 self.inner.p_bindings = bindings.as_ptr();
4519 self
4520 }
4521 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4522 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4523 #[doc = r" valid extension structs can be pushed into the chain."]
4524 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4525 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsDescriptorSetLayoutCreateInfo>(mut self, next: &'a mut T) -> Self4526 pub fn push_next<T: ExtendsDescriptorSetLayoutCreateInfo>(mut self, next: &'a mut T) -> Self {
4527 unsafe {
4528 let next_ptr = next as *mut T as *mut BaseOutStructure;
4529 let last_next = ptr_chain_iter(next).last().unwrap();
4530 (*last_next).p_next = self.inner.p_next as _;
4531 self.inner.p_next = next_ptr as _;
4532 }
4533 self
4534 }
4535 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4536 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4537 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorSetLayoutCreateInfo4538 pub fn build(self) -> DescriptorSetLayoutCreateInfo {
4539 self.inner
4540 }
4541 }
4542 #[repr(C)]
4543 #[cfg_attr(feature = "debug", derive(Debug))]
4544 #[derive(Copy, Clone, Default)]
4545 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPoolSize.html>"]
4546 pub struct DescriptorPoolSize {
4547 pub ty: DescriptorType,
4548 pub descriptor_count: u32,
4549 }
4550 impl DescriptorPoolSize {
builder<'a>() -> DescriptorPoolSizeBuilder<'a>4551 pub fn builder<'a>() -> DescriptorPoolSizeBuilder<'a> {
4552 DescriptorPoolSizeBuilder {
4553 inner: Self::default(),
4554 marker: ::std::marker::PhantomData,
4555 }
4556 }
4557 }
4558 #[repr(transparent)]
4559 pub struct DescriptorPoolSizeBuilder<'a> {
4560 inner: DescriptorPoolSize,
4561 marker: ::std::marker::PhantomData<&'a ()>,
4562 }
4563 impl<'a> ::std::ops::Deref for DescriptorPoolSizeBuilder<'a> {
4564 type Target = DescriptorPoolSize;
deref(&self) -> &Self::Target4565 fn deref(&self) -> &Self::Target {
4566 &self.inner
4567 }
4568 }
4569 impl<'a> ::std::ops::DerefMut for DescriptorPoolSizeBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4570 fn deref_mut(&mut self) -> &mut Self::Target {
4571 &mut self.inner
4572 }
4573 }
4574 impl<'a> DescriptorPoolSizeBuilder<'a> {
ty(mut self, ty: DescriptorType) -> Self4575 pub fn ty(mut self, ty: DescriptorType) -> Self {
4576 self.inner.ty = ty;
4577 self
4578 }
descriptor_count(mut self, descriptor_count: u32) -> Self4579 pub fn descriptor_count(mut self, descriptor_count: u32) -> Self {
4580 self.inner.descriptor_count = descriptor_count;
4581 self
4582 }
4583 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4584 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4585 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorPoolSize4586 pub fn build(self) -> DescriptorPoolSize {
4587 self.inner
4588 }
4589 }
4590 #[repr(C)]
4591 #[cfg_attr(feature = "debug", derive(Debug))]
4592 #[derive(Copy, Clone)]
4593 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPoolCreateInfo.html>"]
4594 pub struct DescriptorPoolCreateInfo {
4595 pub s_type: StructureType,
4596 pub p_next: *const c_void,
4597 pub flags: DescriptorPoolCreateFlags,
4598 pub max_sets: u32,
4599 pub pool_size_count: u32,
4600 pub p_pool_sizes: *const DescriptorPoolSize,
4601 }
4602 impl ::std::default::Default for DescriptorPoolCreateInfo {
default() -> Self4603 fn default() -> Self {
4604 Self {
4605 s_type: StructureType::DESCRIPTOR_POOL_CREATE_INFO,
4606 p_next: ::std::ptr::null(),
4607 flags: DescriptorPoolCreateFlags::default(),
4608 max_sets: u32::default(),
4609 pool_size_count: u32::default(),
4610 p_pool_sizes: ::std::ptr::null(),
4611 }
4612 }
4613 }
4614 impl DescriptorPoolCreateInfo {
builder<'a>() -> DescriptorPoolCreateInfoBuilder<'a>4615 pub fn builder<'a>() -> DescriptorPoolCreateInfoBuilder<'a> {
4616 DescriptorPoolCreateInfoBuilder {
4617 inner: Self::default(),
4618 marker: ::std::marker::PhantomData,
4619 }
4620 }
4621 }
4622 #[repr(transparent)]
4623 pub struct DescriptorPoolCreateInfoBuilder<'a> {
4624 inner: DescriptorPoolCreateInfo,
4625 marker: ::std::marker::PhantomData<&'a ()>,
4626 }
4627 pub unsafe trait ExtendsDescriptorPoolCreateInfo {}
4628 impl<'a> ::std::ops::Deref for DescriptorPoolCreateInfoBuilder<'a> {
4629 type Target = DescriptorPoolCreateInfo;
deref(&self) -> &Self::Target4630 fn deref(&self) -> &Self::Target {
4631 &self.inner
4632 }
4633 }
4634 impl<'a> ::std::ops::DerefMut for DescriptorPoolCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4635 fn deref_mut(&mut self) -> &mut Self::Target {
4636 &mut self.inner
4637 }
4638 }
4639 impl<'a> DescriptorPoolCreateInfoBuilder<'a> {
flags(mut self, flags: DescriptorPoolCreateFlags) -> Self4640 pub fn flags(mut self, flags: DescriptorPoolCreateFlags) -> Self {
4641 self.inner.flags = flags;
4642 self
4643 }
max_sets(mut self, max_sets: u32) -> Self4644 pub fn max_sets(mut self, max_sets: u32) -> Self {
4645 self.inner.max_sets = max_sets;
4646 self
4647 }
pool_sizes(mut self, pool_sizes: &'a [DescriptorPoolSize]) -> Self4648 pub fn pool_sizes(mut self, pool_sizes: &'a [DescriptorPoolSize]) -> Self {
4649 self.inner.pool_size_count = pool_sizes.len() as _;
4650 self.inner.p_pool_sizes = pool_sizes.as_ptr();
4651 self
4652 }
4653 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4654 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4655 #[doc = r" valid extension structs can be pushed into the chain."]
4656 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4657 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsDescriptorPoolCreateInfo>(mut self, next: &'a mut T) -> Self4658 pub fn push_next<T: ExtendsDescriptorPoolCreateInfo>(mut self, next: &'a mut T) -> Self {
4659 unsafe {
4660 let next_ptr = next as *mut T as *mut BaseOutStructure;
4661 let last_next = ptr_chain_iter(next).last().unwrap();
4662 (*last_next).p_next = self.inner.p_next as _;
4663 self.inner.p_next = next_ptr as _;
4664 }
4665 self
4666 }
4667 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4668 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4669 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorPoolCreateInfo4670 pub fn build(self) -> DescriptorPoolCreateInfo {
4671 self.inner
4672 }
4673 }
4674 #[repr(C)]
4675 #[cfg_attr(feature = "debug", derive(Debug))]
4676 #[derive(Copy, Clone)]
4677 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetAllocateInfo.html>"]
4678 pub struct DescriptorSetAllocateInfo {
4679 pub s_type: StructureType,
4680 pub p_next: *const c_void,
4681 pub descriptor_pool: DescriptorPool,
4682 pub descriptor_set_count: u32,
4683 pub p_set_layouts: *const DescriptorSetLayout,
4684 }
4685 impl ::std::default::Default for DescriptorSetAllocateInfo {
default() -> Self4686 fn default() -> Self {
4687 Self {
4688 s_type: StructureType::DESCRIPTOR_SET_ALLOCATE_INFO,
4689 p_next: ::std::ptr::null(),
4690 descriptor_pool: DescriptorPool::default(),
4691 descriptor_set_count: u32::default(),
4692 p_set_layouts: ::std::ptr::null(),
4693 }
4694 }
4695 }
4696 impl DescriptorSetAllocateInfo {
builder<'a>() -> DescriptorSetAllocateInfoBuilder<'a>4697 pub fn builder<'a>() -> DescriptorSetAllocateInfoBuilder<'a> {
4698 DescriptorSetAllocateInfoBuilder {
4699 inner: Self::default(),
4700 marker: ::std::marker::PhantomData,
4701 }
4702 }
4703 }
4704 #[repr(transparent)]
4705 pub struct DescriptorSetAllocateInfoBuilder<'a> {
4706 inner: DescriptorSetAllocateInfo,
4707 marker: ::std::marker::PhantomData<&'a ()>,
4708 }
4709 pub unsafe trait ExtendsDescriptorSetAllocateInfo {}
4710 impl<'a> ::std::ops::Deref for DescriptorSetAllocateInfoBuilder<'a> {
4711 type Target = DescriptorSetAllocateInfo;
deref(&self) -> &Self::Target4712 fn deref(&self) -> &Self::Target {
4713 &self.inner
4714 }
4715 }
4716 impl<'a> ::std::ops::DerefMut for DescriptorSetAllocateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4717 fn deref_mut(&mut self) -> &mut Self::Target {
4718 &mut self.inner
4719 }
4720 }
4721 impl<'a> DescriptorSetAllocateInfoBuilder<'a> {
descriptor_pool(mut self, descriptor_pool: DescriptorPool) -> Self4722 pub fn descriptor_pool(mut self, descriptor_pool: DescriptorPool) -> Self {
4723 self.inner.descriptor_pool = descriptor_pool;
4724 self
4725 }
set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self4726 pub fn set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self {
4727 self.inner.descriptor_set_count = set_layouts.len() as _;
4728 self.inner.p_set_layouts = set_layouts.as_ptr();
4729 self
4730 }
4731 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4732 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4733 #[doc = r" valid extension structs can be pushed into the chain."]
4734 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4735 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsDescriptorSetAllocateInfo>(mut self, next: &'a mut T) -> Self4736 pub fn push_next<T: ExtendsDescriptorSetAllocateInfo>(mut self, next: &'a mut T) -> Self {
4737 unsafe {
4738 let next_ptr = next as *mut T as *mut BaseOutStructure;
4739 let last_next = ptr_chain_iter(next).last().unwrap();
4740 (*last_next).p_next = self.inner.p_next as _;
4741 self.inner.p_next = next_ptr as _;
4742 }
4743 self
4744 }
4745 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4746 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4747 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> DescriptorSetAllocateInfo4748 pub fn build(self) -> DescriptorSetAllocateInfo {
4749 self.inner
4750 }
4751 }
4752 #[repr(C)]
4753 #[cfg_attr(feature = "debug", derive(Debug))]
4754 #[derive(Copy, Clone, Default)]
4755 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSpecializationMapEntry.html>"]
4756 pub struct SpecializationMapEntry {
4757 pub constant_id: u32,
4758 pub offset: u32,
4759 pub size: usize,
4760 }
4761 impl SpecializationMapEntry {
builder<'a>() -> SpecializationMapEntryBuilder<'a>4762 pub fn builder<'a>() -> SpecializationMapEntryBuilder<'a> {
4763 SpecializationMapEntryBuilder {
4764 inner: Self::default(),
4765 marker: ::std::marker::PhantomData,
4766 }
4767 }
4768 }
4769 #[repr(transparent)]
4770 pub struct SpecializationMapEntryBuilder<'a> {
4771 inner: SpecializationMapEntry,
4772 marker: ::std::marker::PhantomData<&'a ()>,
4773 }
4774 impl<'a> ::std::ops::Deref for SpecializationMapEntryBuilder<'a> {
4775 type Target = SpecializationMapEntry;
deref(&self) -> &Self::Target4776 fn deref(&self) -> &Self::Target {
4777 &self.inner
4778 }
4779 }
4780 impl<'a> ::std::ops::DerefMut for SpecializationMapEntryBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4781 fn deref_mut(&mut self) -> &mut Self::Target {
4782 &mut self.inner
4783 }
4784 }
4785 impl<'a> SpecializationMapEntryBuilder<'a> {
constant_id(mut self, constant_id: u32) -> Self4786 pub fn constant_id(mut self, constant_id: u32) -> Self {
4787 self.inner.constant_id = constant_id;
4788 self
4789 }
offset(mut self, offset: u32) -> Self4790 pub fn offset(mut self, offset: u32) -> Self {
4791 self.inner.offset = offset;
4792 self
4793 }
size(mut self, size: usize) -> Self4794 pub fn size(mut self, size: usize) -> Self {
4795 self.inner.size = size;
4796 self
4797 }
4798 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4799 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4800 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SpecializationMapEntry4801 pub fn build(self) -> SpecializationMapEntry {
4802 self.inner
4803 }
4804 }
4805 #[repr(C)]
4806 #[cfg_attr(feature = "debug", derive(Debug))]
4807 #[derive(Copy, Clone)]
4808 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSpecializationInfo.html>"]
4809 pub struct SpecializationInfo {
4810 pub map_entry_count: u32,
4811 pub p_map_entries: *const SpecializationMapEntry,
4812 pub data_size: usize,
4813 pub p_data: *const c_void,
4814 }
4815 impl ::std::default::Default for SpecializationInfo {
default() -> Self4816 fn default() -> Self {
4817 Self {
4818 map_entry_count: u32::default(),
4819 p_map_entries: ::std::ptr::null(),
4820 data_size: usize::default(),
4821 p_data: ::std::ptr::null(),
4822 }
4823 }
4824 }
4825 impl SpecializationInfo {
builder<'a>() -> SpecializationInfoBuilder<'a>4826 pub fn builder<'a>() -> SpecializationInfoBuilder<'a> {
4827 SpecializationInfoBuilder {
4828 inner: Self::default(),
4829 marker: ::std::marker::PhantomData,
4830 }
4831 }
4832 }
4833 #[repr(transparent)]
4834 pub struct SpecializationInfoBuilder<'a> {
4835 inner: SpecializationInfo,
4836 marker: ::std::marker::PhantomData<&'a ()>,
4837 }
4838 impl<'a> ::std::ops::Deref for SpecializationInfoBuilder<'a> {
4839 type Target = SpecializationInfo;
deref(&self) -> &Self::Target4840 fn deref(&self) -> &Self::Target {
4841 &self.inner
4842 }
4843 }
4844 impl<'a> ::std::ops::DerefMut for SpecializationInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4845 fn deref_mut(&mut self) -> &mut Self::Target {
4846 &mut self.inner
4847 }
4848 }
4849 impl<'a> SpecializationInfoBuilder<'a> {
map_entries(mut self, map_entries: &'a [SpecializationMapEntry]) -> Self4850 pub fn map_entries(mut self, map_entries: &'a [SpecializationMapEntry]) -> Self {
4851 self.inner.map_entry_count = map_entries.len() as _;
4852 self.inner.p_map_entries = map_entries.as_ptr();
4853 self
4854 }
data(mut self, data: &'a [u8]) -> Self4855 pub fn data(mut self, data: &'a [u8]) -> Self {
4856 self.inner.data_size = data.len() as _;
4857 self.inner.p_data = data.as_ptr() as *const c_void;
4858 self
4859 }
4860 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4861 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4862 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> SpecializationInfo4863 pub fn build(self) -> SpecializationInfo {
4864 self.inner
4865 }
4866 }
4867 #[repr(C)]
4868 #[cfg_attr(feature = "debug", derive(Debug))]
4869 #[derive(Copy, Clone)]
4870 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineShaderStageCreateInfo.html>"]
4871 pub struct PipelineShaderStageCreateInfo {
4872 pub s_type: StructureType,
4873 pub p_next: *const c_void,
4874 pub flags: PipelineShaderStageCreateFlags,
4875 pub stage: ShaderStageFlags,
4876 pub module: ShaderModule,
4877 pub p_name: *const c_char,
4878 pub p_specialization_info: *const SpecializationInfo,
4879 }
4880 impl ::std::default::Default for PipelineShaderStageCreateInfo {
default() -> Self4881 fn default() -> Self {
4882 Self {
4883 s_type: StructureType::PIPELINE_SHADER_STAGE_CREATE_INFO,
4884 p_next: ::std::ptr::null(),
4885 flags: PipelineShaderStageCreateFlags::default(),
4886 stage: ShaderStageFlags::default(),
4887 module: ShaderModule::default(),
4888 p_name: ::std::ptr::null(),
4889 p_specialization_info: ::std::ptr::null(),
4890 }
4891 }
4892 }
4893 impl PipelineShaderStageCreateInfo {
builder<'a>() -> PipelineShaderStageCreateInfoBuilder<'a>4894 pub fn builder<'a>() -> PipelineShaderStageCreateInfoBuilder<'a> {
4895 PipelineShaderStageCreateInfoBuilder {
4896 inner: Self::default(),
4897 marker: ::std::marker::PhantomData,
4898 }
4899 }
4900 }
4901 #[repr(transparent)]
4902 pub struct PipelineShaderStageCreateInfoBuilder<'a> {
4903 inner: PipelineShaderStageCreateInfo,
4904 marker: ::std::marker::PhantomData<&'a ()>,
4905 }
4906 pub unsafe trait ExtendsPipelineShaderStageCreateInfo {}
4907 impl<'a> ::std::ops::Deref for PipelineShaderStageCreateInfoBuilder<'a> {
4908 type Target = PipelineShaderStageCreateInfo;
deref(&self) -> &Self::Target4909 fn deref(&self) -> &Self::Target {
4910 &self.inner
4911 }
4912 }
4913 impl<'a> ::std::ops::DerefMut for PipelineShaderStageCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target4914 fn deref_mut(&mut self) -> &mut Self::Target {
4915 &mut self.inner
4916 }
4917 }
4918 impl<'a> PipelineShaderStageCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineShaderStageCreateFlags) -> Self4919 pub fn flags(mut self, flags: PipelineShaderStageCreateFlags) -> Self {
4920 self.inner.flags = flags;
4921 self
4922 }
stage(mut self, stage: ShaderStageFlags) -> Self4923 pub fn stage(mut self, stage: ShaderStageFlags) -> Self {
4924 self.inner.stage = stage;
4925 self
4926 }
module(mut self, module: ShaderModule) -> Self4927 pub fn module(mut self, module: ShaderModule) -> Self {
4928 self.inner.module = module;
4929 self
4930 }
name(mut self, name: &'a ::std::ffi::CStr) -> Self4931 pub fn name(mut self, name: &'a ::std::ffi::CStr) -> Self {
4932 self.inner.p_name = name.as_ptr();
4933 self
4934 }
specialization_info(mut self, specialization_info: &'a SpecializationInfo) -> Self4935 pub fn specialization_info(mut self, specialization_info: &'a SpecializationInfo) -> Self {
4936 self.inner.p_specialization_info = specialization_info;
4937 self
4938 }
4939 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
4940 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
4941 #[doc = r" valid extension structs can be pushed into the chain."]
4942 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
4943 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineShaderStageCreateInfo>(mut self, next: &'a mut T) -> Self4944 pub fn push_next<T: ExtendsPipelineShaderStageCreateInfo>(mut self, next: &'a mut T) -> Self {
4945 unsafe {
4946 let next_ptr = next as *mut T as *mut BaseOutStructure;
4947 let last_next = ptr_chain_iter(next).last().unwrap();
4948 (*last_next).p_next = self.inner.p_next as _;
4949 self.inner.p_next = next_ptr as _;
4950 }
4951 self
4952 }
4953 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
4954 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
4955 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineShaderStageCreateInfo4956 pub fn build(self) -> PipelineShaderStageCreateInfo {
4957 self.inner
4958 }
4959 }
4960 #[repr(C)]
4961 #[cfg_attr(feature = "debug", derive(Debug))]
4962 #[derive(Copy, Clone)]
4963 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkComputePipelineCreateInfo.html>"]
4964 pub struct ComputePipelineCreateInfo {
4965 pub s_type: StructureType,
4966 pub p_next: *const c_void,
4967 pub flags: PipelineCreateFlags,
4968 pub stage: PipelineShaderStageCreateInfo,
4969 pub layout: PipelineLayout,
4970 pub base_pipeline_handle: Pipeline,
4971 pub base_pipeline_index: i32,
4972 }
4973 impl ::std::default::Default for ComputePipelineCreateInfo {
default() -> Self4974 fn default() -> Self {
4975 Self {
4976 s_type: StructureType::COMPUTE_PIPELINE_CREATE_INFO,
4977 p_next: ::std::ptr::null(),
4978 flags: PipelineCreateFlags::default(),
4979 stage: PipelineShaderStageCreateInfo::default(),
4980 layout: PipelineLayout::default(),
4981 base_pipeline_handle: Pipeline::default(),
4982 base_pipeline_index: i32::default(),
4983 }
4984 }
4985 }
4986 impl ComputePipelineCreateInfo {
builder<'a>() -> ComputePipelineCreateInfoBuilder<'a>4987 pub fn builder<'a>() -> ComputePipelineCreateInfoBuilder<'a> {
4988 ComputePipelineCreateInfoBuilder {
4989 inner: Self::default(),
4990 marker: ::std::marker::PhantomData,
4991 }
4992 }
4993 }
4994 #[repr(transparent)]
4995 pub struct ComputePipelineCreateInfoBuilder<'a> {
4996 inner: ComputePipelineCreateInfo,
4997 marker: ::std::marker::PhantomData<&'a ()>,
4998 }
4999 pub unsafe trait ExtendsComputePipelineCreateInfo {}
5000 impl<'a> ::std::ops::Deref for ComputePipelineCreateInfoBuilder<'a> {
5001 type Target = ComputePipelineCreateInfo;
deref(&self) -> &Self::Target5002 fn deref(&self) -> &Self::Target {
5003 &self.inner
5004 }
5005 }
5006 impl<'a> ::std::ops::DerefMut for ComputePipelineCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5007 fn deref_mut(&mut self) -> &mut Self::Target {
5008 &mut self.inner
5009 }
5010 }
5011 impl<'a> ComputePipelineCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineCreateFlags) -> Self5012 pub fn flags(mut self, flags: PipelineCreateFlags) -> Self {
5013 self.inner.flags = flags;
5014 self
5015 }
stage(mut self, stage: PipelineShaderStageCreateInfo) -> Self5016 pub fn stage(mut self, stage: PipelineShaderStageCreateInfo) -> Self {
5017 self.inner.stage = stage;
5018 self
5019 }
layout(mut self, layout: PipelineLayout) -> Self5020 pub fn layout(mut self, layout: PipelineLayout) -> Self {
5021 self.inner.layout = layout;
5022 self
5023 }
base_pipeline_handle(mut self, base_pipeline_handle: Pipeline) -> Self5024 pub fn base_pipeline_handle(mut self, base_pipeline_handle: Pipeline) -> Self {
5025 self.inner.base_pipeline_handle = base_pipeline_handle;
5026 self
5027 }
base_pipeline_index(mut self, base_pipeline_index: i32) -> Self5028 pub fn base_pipeline_index(mut self, base_pipeline_index: i32) -> Self {
5029 self.inner.base_pipeline_index = base_pipeline_index;
5030 self
5031 }
5032 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5033 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5034 #[doc = r" valid extension structs can be pushed into the chain."]
5035 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5036 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsComputePipelineCreateInfo>(mut self, next: &'a mut T) -> Self5037 pub fn push_next<T: ExtendsComputePipelineCreateInfo>(mut self, next: &'a mut T) -> Self {
5038 unsafe {
5039 let next_ptr = next as *mut T as *mut BaseOutStructure;
5040 let last_next = ptr_chain_iter(next).last().unwrap();
5041 (*last_next).p_next = self.inner.p_next as _;
5042 self.inner.p_next = next_ptr as _;
5043 }
5044 self
5045 }
5046 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5047 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5048 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> ComputePipelineCreateInfo5049 pub fn build(self) -> ComputePipelineCreateInfo {
5050 self.inner
5051 }
5052 }
5053 #[repr(C)]
5054 #[cfg_attr(feature = "debug", derive(Debug))]
5055 #[derive(Copy, Clone, Default)]
5056 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVertexInputBindingDescription.html>"]
5057 pub struct VertexInputBindingDescription {
5058 pub binding: u32,
5059 pub stride: u32,
5060 pub input_rate: VertexInputRate,
5061 }
5062 impl VertexInputBindingDescription {
builder<'a>() -> VertexInputBindingDescriptionBuilder<'a>5063 pub fn builder<'a>() -> VertexInputBindingDescriptionBuilder<'a> {
5064 VertexInputBindingDescriptionBuilder {
5065 inner: Self::default(),
5066 marker: ::std::marker::PhantomData,
5067 }
5068 }
5069 }
5070 #[repr(transparent)]
5071 pub struct VertexInputBindingDescriptionBuilder<'a> {
5072 inner: VertexInputBindingDescription,
5073 marker: ::std::marker::PhantomData<&'a ()>,
5074 }
5075 impl<'a> ::std::ops::Deref for VertexInputBindingDescriptionBuilder<'a> {
5076 type Target = VertexInputBindingDescription;
deref(&self) -> &Self::Target5077 fn deref(&self) -> &Self::Target {
5078 &self.inner
5079 }
5080 }
5081 impl<'a> ::std::ops::DerefMut for VertexInputBindingDescriptionBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5082 fn deref_mut(&mut self) -> &mut Self::Target {
5083 &mut self.inner
5084 }
5085 }
5086 impl<'a> VertexInputBindingDescriptionBuilder<'a> {
binding(mut self, binding: u32) -> Self5087 pub fn binding(mut self, binding: u32) -> Self {
5088 self.inner.binding = binding;
5089 self
5090 }
stride(mut self, stride: u32) -> Self5091 pub fn stride(mut self, stride: u32) -> Self {
5092 self.inner.stride = stride;
5093 self
5094 }
input_rate(mut self, input_rate: VertexInputRate) -> Self5095 pub fn input_rate(mut self, input_rate: VertexInputRate) -> Self {
5096 self.inner.input_rate = input_rate;
5097 self
5098 }
5099 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5100 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5101 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> VertexInputBindingDescription5102 pub fn build(self) -> VertexInputBindingDescription {
5103 self.inner
5104 }
5105 }
5106 #[repr(C)]
5107 #[cfg_attr(feature = "debug", derive(Debug))]
5108 #[derive(Copy, Clone, Default)]
5109 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVertexInputAttributeDescription.html>"]
5110 pub struct VertexInputAttributeDescription {
5111 pub location: u32,
5112 pub binding: u32,
5113 pub format: Format,
5114 pub offset: u32,
5115 }
5116 impl VertexInputAttributeDescription {
builder<'a>() -> VertexInputAttributeDescriptionBuilder<'a>5117 pub fn builder<'a>() -> VertexInputAttributeDescriptionBuilder<'a> {
5118 VertexInputAttributeDescriptionBuilder {
5119 inner: Self::default(),
5120 marker: ::std::marker::PhantomData,
5121 }
5122 }
5123 }
5124 #[repr(transparent)]
5125 pub struct VertexInputAttributeDescriptionBuilder<'a> {
5126 inner: VertexInputAttributeDescription,
5127 marker: ::std::marker::PhantomData<&'a ()>,
5128 }
5129 impl<'a> ::std::ops::Deref for VertexInputAttributeDescriptionBuilder<'a> {
5130 type Target = VertexInputAttributeDescription;
deref(&self) -> &Self::Target5131 fn deref(&self) -> &Self::Target {
5132 &self.inner
5133 }
5134 }
5135 impl<'a> ::std::ops::DerefMut for VertexInputAttributeDescriptionBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5136 fn deref_mut(&mut self) -> &mut Self::Target {
5137 &mut self.inner
5138 }
5139 }
5140 impl<'a> VertexInputAttributeDescriptionBuilder<'a> {
location(mut self, location: u32) -> Self5141 pub fn location(mut self, location: u32) -> Self {
5142 self.inner.location = location;
5143 self
5144 }
binding(mut self, binding: u32) -> Self5145 pub fn binding(mut self, binding: u32) -> Self {
5146 self.inner.binding = binding;
5147 self
5148 }
format(mut self, format: Format) -> Self5149 pub fn format(mut self, format: Format) -> Self {
5150 self.inner.format = format;
5151 self
5152 }
offset(mut self, offset: u32) -> Self5153 pub fn offset(mut self, offset: u32) -> Self {
5154 self.inner.offset = offset;
5155 self
5156 }
5157 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5158 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5159 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> VertexInputAttributeDescription5160 pub fn build(self) -> VertexInputAttributeDescription {
5161 self.inner
5162 }
5163 }
5164 #[repr(C)]
5165 #[cfg_attr(feature = "debug", derive(Debug))]
5166 #[derive(Copy, Clone)]
5167 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineVertexInputStateCreateInfo.html>"]
5168 pub struct PipelineVertexInputStateCreateInfo {
5169 pub s_type: StructureType,
5170 pub p_next: *const c_void,
5171 pub flags: PipelineVertexInputStateCreateFlags,
5172 pub vertex_binding_description_count: u32,
5173 pub p_vertex_binding_descriptions: *const VertexInputBindingDescription,
5174 pub vertex_attribute_description_count: u32,
5175 pub p_vertex_attribute_descriptions: *const VertexInputAttributeDescription,
5176 }
5177 impl ::std::default::Default for PipelineVertexInputStateCreateInfo {
default() -> Self5178 fn default() -> Self {
5179 Self {
5180 s_type: StructureType::PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
5181 p_next: ::std::ptr::null(),
5182 flags: PipelineVertexInputStateCreateFlags::default(),
5183 vertex_binding_description_count: u32::default(),
5184 p_vertex_binding_descriptions: ::std::ptr::null(),
5185 vertex_attribute_description_count: u32::default(),
5186 p_vertex_attribute_descriptions: ::std::ptr::null(),
5187 }
5188 }
5189 }
5190 impl PipelineVertexInputStateCreateInfo {
builder<'a>() -> PipelineVertexInputStateCreateInfoBuilder<'a>5191 pub fn builder<'a>() -> PipelineVertexInputStateCreateInfoBuilder<'a> {
5192 PipelineVertexInputStateCreateInfoBuilder {
5193 inner: Self::default(),
5194 marker: ::std::marker::PhantomData,
5195 }
5196 }
5197 }
5198 #[repr(transparent)]
5199 pub struct PipelineVertexInputStateCreateInfoBuilder<'a> {
5200 inner: PipelineVertexInputStateCreateInfo,
5201 marker: ::std::marker::PhantomData<&'a ()>,
5202 }
5203 pub unsafe trait ExtendsPipelineVertexInputStateCreateInfo {}
5204 impl<'a> ::std::ops::Deref for PipelineVertexInputStateCreateInfoBuilder<'a> {
5205 type Target = PipelineVertexInputStateCreateInfo;
deref(&self) -> &Self::Target5206 fn deref(&self) -> &Self::Target {
5207 &self.inner
5208 }
5209 }
5210 impl<'a> ::std::ops::DerefMut for PipelineVertexInputStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5211 fn deref_mut(&mut self) -> &mut Self::Target {
5212 &mut self.inner
5213 }
5214 }
5215 impl<'a> PipelineVertexInputStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineVertexInputStateCreateFlags) -> Self5216 pub fn flags(mut self, flags: PipelineVertexInputStateCreateFlags) -> Self {
5217 self.inner.flags = flags;
5218 self
5219 }
vertex_binding_descriptions( mut self, vertex_binding_descriptions: &'a [VertexInputBindingDescription], ) -> Self5220 pub fn vertex_binding_descriptions(
5221 mut self,
5222 vertex_binding_descriptions: &'a [VertexInputBindingDescription],
5223 ) -> Self {
5224 self.inner.vertex_binding_description_count = vertex_binding_descriptions.len() as _;
5225 self.inner.p_vertex_binding_descriptions = vertex_binding_descriptions.as_ptr();
5226 self
5227 }
vertex_attribute_descriptions( mut self, vertex_attribute_descriptions: &'a [VertexInputAttributeDescription], ) -> Self5228 pub fn vertex_attribute_descriptions(
5229 mut self,
5230 vertex_attribute_descriptions: &'a [VertexInputAttributeDescription],
5231 ) -> Self {
5232 self.inner.vertex_attribute_description_count = vertex_attribute_descriptions.len() as _;
5233 self.inner.p_vertex_attribute_descriptions = vertex_attribute_descriptions.as_ptr();
5234 self
5235 }
5236 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5237 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5238 #[doc = r" valid extension structs can be pushed into the chain."]
5239 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5240 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineVertexInputStateCreateInfo>( mut self, next: &'a mut T, ) -> Self5241 pub fn push_next<T: ExtendsPipelineVertexInputStateCreateInfo>(
5242 mut self,
5243 next: &'a mut T,
5244 ) -> Self {
5245 unsafe {
5246 let next_ptr = next as *mut T as *mut BaseOutStructure;
5247 let last_next = ptr_chain_iter(next).last().unwrap();
5248 (*last_next).p_next = self.inner.p_next as _;
5249 self.inner.p_next = next_ptr as _;
5250 }
5251 self
5252 }
5253 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5254 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5255 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineVertexInputStateCreateInfo5256 pub fn build(self) -> PipelineVertexInputStateCreateInfo {
5257 self.inner
5258 }
5259 }
5260 #[repr(C)]
5261 #[cfg_attr(feature = "debug", derive(Debug))]
5262 #[derive(Copy, Clone)]
5263 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineInputAssemblyStateCreateInfo.html>"]
5264 pub struct PipelineInputAssemblyStateCreateInfo {
5265 pub s_type: StructureType,
5266 pub p_next: *const c_void,
5267 pub flags: PipelineInputAssemblyStateCreateFlags,
5268 pub topology: PrimitiveTopology,
5269 pub primitive_restart_enable: Bool32,
5270 }
5271 impl ::std::default::Default for PipelineInputAssemblyStateCreateInfo {
default() -> Self5272 fn default() -> Self {
5273 Self {
5274 s_type: StructureType::PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
5275 p_next: ::std::ptr::null(),
5276 flags: PipelineInputAssemblyStateCreateFlags::default(),
5277 topology: PrimitiveTopology::default(),
5278 primitive_restart_enable: Bool32::default(),
5279 }
5280 }
5281 }
5282 impl PipelineInputAssemblyStateCreateInfo {
builder<'a>() -> PipelineInputAssemblyStateCreateInfoBuilder<'a>5283 pub fn builder<'a>() -> PipelineInputAssemblyStateCreateInfoBuilder<'a> {
5284 PipelineInputAssemblyStateCreateInfoBuilder {
5285 inner: Self::default(),
5286 marker: ::std::marker::PhantomData,
5287 }
5288 }
5289 }
5290 #[repr(transparent)]
5291 pub struct PipelineInputAssemblyStateCreateInfoBuilder<'a> {
5292 inner: PipelineInputAssemblyStateCreateInfo,
5293 marker: ::std::marker::PhantomData<&'a ()>,
5294 }
5295 impl<'a> ::std::ops::Deref for PipelineInputAssemblyStateCreateInfoBuilder<'a> {
5296 type Target = PipelineInputAssemblyStateCreateInfo;
deref(&self) -> &Self::Target5297 fn deref(&self) -> &Self::Target {
5298 &self.inner
5299 }
5300 }
5301 impl<'a> ::std::ops::DerefMut for PipelineInputAssemblyStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5302 fn deref_mut(&mut self) -> &mut Self::Target {
5303 &mut self.inner
5304 }
5305 }
5306 impl<'a> PipelineInputAssemblyStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineInputAssemblyStateCreateFlags) -> Self5307 pub fn flags(mut self, flags: PipelineInputAssemblyStateCreateFlags) -> Self {
5308 self.inner.flags = flags;
5309 self
5310 }
topology(mut self, topology: PrimitiveTopology) -> Self5311 pub fn topology(mut self, topology: PrimitiveTopology) -> Self {
5312 self.inner.topology = topology;
5313 self
5314 }
primitive_restart_enable(mut self, primitive_restart_enable: bool) -> Self5315 pub fn primitive_restart_enable(mut self, primitive_restart_enable: bool) -> Self {
5316 self.inner.primitive_restart_enable = primitive_restart_enable.into();
5317 self
5318 }
5319 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5320 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5321 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineInputAssemblyStateCreateInfo5322 pub fn build(self) -> PipelineInputAssemblyStateCreateInfo {
5323 self.inner
5324 }
5325 }
5326 #[repr(C)]
5327 #[cfg_attr(feature = "debug", derive(Debug))]
5328 #[derive(Copy, Clone)]
5329 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineTessellationStateCreateInfo.html>"]
5330 pub struct PipelineTessellationStateCreateInfo {
5331 pub s_type: StructureType,
5332 pub p_next: *const c_void,
5333 pub flags: PipelineTessellationStateCreateFlags,
5334 pub patch_control_points: u32,
5335 }
5336 impl ::std::default::Default for PipelineTessellationStateCreateInfo {
default() -> Self5337 fn default() -> Self {
5338 Self {
5339 s_type: StructureType::PIPELINE_TESSELLATION_STATE_CREATE_INFO,
5340 p_next: ::std::ptr::null(),
5341 flags: PipelineTessellationStateCreateFlags::default(),
5342 patch_control_points: u32::default(),
5343 }
5344 }
5345 }
5346 impl PipelineTessellationStateCreateInfo {
builder<'a>() -> PipelineTessellationStateCreateInfoBuilder<'a>5347 pub fn builder<'a>() -> PipelineTessellationStateCreateInfoBuilder<'a> {
5348 PipelineTessellationStateCreateInfoBuilder {
5349 inner: Self::default(),
5350 marker: ::std::marker::PhantomData,
5351 }
5352 }
5353 }
5354 #[repr(transparent)]
5355 pub struct PipelineTessellationStateCreateInfoBuilder<'a> {
5356 inner: PipelineTessellationStateCreateInfo,
5357 marker: ::std::marker::PhantomData<&'a ()>,
5358 }
5359 pub unsafe trait ExtendsPipelineTessellationStateCreateInfo {}
5360 impl<'a> ::std::ops::Deref for PipelineTessellationStateCreateInfoBuilder<'a> {
5361 type Target = PipelineTessellationStateCreateInfo;
deref(&self) -> &Self::Target5362 fn deref(&self) -> &Self::Target {
5363 &self.inner
5364 }
5365 }
5366 impl<'a> ::std::ops::DerefMut for PipelineTessellationStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5367 fn deref_mut(&mut self) -> &mut Self::Target {
5368 &mut self.inner
5369 }
5370 }
5371 impl<'a> PipelineTessellationStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineTessellationStateCreateFlags) -> Self5372 pub fn flags(mut self, flags: PipelineTessellationStateCreateFlags) -> Self {
5373 self.inner.flags = flags;
5374 self
5375 }
patch_control_points(mut self, patch_control_points: u32) -> Self5376 pub fn patch_control_points(mut self, patch_control_points: u32) -> Self {
5377 self.inner.patch_control_points = patch_control_points;
5378 self
5379 }
5380 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5381 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5382 #[doc = r" valid extension structs can be pushed into the chain."]
5383 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5384 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineTessellationStateCreateInfo>( mut self, next: &'a mut T, ) -> Self5385 pub fn push_next<T: ExtendsPipelineTessellationStateCreateInfo>(
5386 mut self,
5387 next: &'a mut T,
5388 ) -> Self {
5389 unsafe {
5390 let next_ptr = next as *mut T as *mut BaseOutStructure;
5391 let last_next = ptr_chain_iter(next).last().unwrap();
5392 (*last_next).p_next = self.inner.p_next as _;
5393 self.inner.p_next = next_ptr as _;
5394 }
5395 self
5396 }
5397 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5398 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5399 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineTessellationStateCreateInfo5400 pub fn build(self) -> PipelineTessellationStateCreateInfo {
5401 self.inner
5402 }
5403 }
5404 #[repr(C)]
5405 #[cfg_attr(feature = "debug", derive(Debug))]
5406 #[derive(Copy, Clone)]
5407 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineViewportStateCreateInfo.html>"]
5408 pub struct PipelineViewportStateCreateInfo {
5409 pub s_type: StructureType,
5410 pub p_next: *const c_void,
5411 pub flags: PipelineViewportStateCreateFlags,
5412 pub viewport_count: u32,
5413 pub p_viewports: *const Viewport,
5414 pub scissor_count: u32,
5415 pub p_scissors: *const Rect2D,
5416 }
5417 impl ::std::default::Default for PipelineViewportStateCreateInfo {
default() -> Self5418 fn default() -> Self {
5419 Self {
5420 s_type: StructureType::PIPELINE_VIEWPORT_STATE_CREATE_INFO,
5421 p_next: ::std::ptr::null(),
5422 flags: PipelineViewportStateCreateFlags::default(),
5423 viewport_count: u32::default(),
5424 p_viewports: ::std::ptr::null(),
5425 scissor_count: u32::default(),
5426 p_scissors: ::std::ptr::null(),
5427 }
5428 }
5429 }
5430 impl PipelineViewportStateCreateInfo {
builder<'a>() -> PipelineViewportStateCreateInfoBuilder<'a>5431 pub fn builder<'a>() -> PipelineViewportStateCreateInfoBuilder<'a> {
5432 PipelineViewportStateCreateInfoBuilder {
5433 inner: Self::default(),
5434 marker: ::std::marker::PhantomData,
5435 }
5436 }
5437 }
5438 #[repr(transparent)]
5439 pub struct PipelineViewportStateCreateInfoBuilder<'a> {
5440 inner: PipelineViewportStateCreateInfo,
5441 marker: ::std::marker::PhantomData<&'a ()>,
5442 }
5443 pub unsafe trait ExtendsPipelineViewportStateCreateInfo {}
5444 impl<'a> ::std::ops::Deref for PipelineViewportStateCreateInfoBuilder<'a> {
5445 type Target = PipelineViewportStateCreateInfo;
deref(&self) -> &Self::Target5446 fn deref(&self) -> &Self::Target {
5447 &self.inner
5448 }
5449 }
5450 impl<'a> ::std::ops::DerefMut for PipelineViewportStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5451 fn deref_mut(&mut self) -> &mut Self::Target {
5452 &mut self.inner
5453 }
5454 }
5455 impl<'a> PipelineViewportStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineViewportStateCreateFlags) -> Self5456 pub fn flags(mut self, flags: PipelineViewportStateCreateFlags) -> Self {
5457 self.inner.flags = flags;
5458 self
5459 }
viewport_count(mut self, viewport_count: u32) -> Self5460 pub fn viewport_count(mut self, viewport_count: u32) -> Self {
5461 self.inner.viewport_count = viewport_count;
5462 self
5463 }
viewports(mut self, viewports: &'a [Viewport]) -> Self5464 pub fn viewports(mut self, viewports: &'a [Viewport]) -> Self {
5465 self.inner.viewport_count = viewports.len() as _;
5466 self.inner.p_viewports = viewports.as_ptr();
5467 self
5468 }
scissor_count(mut self, scissor_count: u32) -> Self5469 pub fn scissor_count(mut self, scissor_count: u32) -> Self {
5470 self.inner.scissor_count = scissor_count;
5471 self
5472 }
scissors(mut self, scissors: &'a [Rect2D]) -> Self5473 pub fn scissors(mut self, scissors: &'a [Rect2D]) -> Self {
5474 self.inner.scissor_count = scissors.len() as _;
5475 self.inner.p_scissors = scissors.as_ptr();
5476 self
5477 }
5478 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5479 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5480 #[doc = r" valid extension structs can be pushed into the chain."]
5481 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5482 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineViewportStateCreateInfo>(mut self, next: &'a mut T) -> Self5483 pub fn push_next<T: ExtendsPipelineViewportStateCreateInfo>(mut self, next: &'a mut T) -> Self {
5484 unsafe {
5485 let next_ptr = next as *mut T as *mut BaseOutStructure;
5486 let last_next = ptr_chain_iter(next).last().unwrap();
5487 (*last_next).p_next = self.inner.p_next as _;
5488 self.inner.p_next = next_ptr as _;
5489 }
5490 self
5491 }
5492 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5493 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5494 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineViewportStateCreateInfo5495 pub fn build(self) -> PipelineViewportStateCreateInfo {
5496 self.inner
5497 }
5498 }
5499 #[repr(C)]
5500 #[cfg_attr(feature = "debug", derive(Debug))]
5501 #[derive(Copy, Clone)]
5502 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineRasterizationStateCreateInfo.html>"]
5503 pub struct PipelineRasterizationStateCreateInfo {
5504 pub s_type: StructureType,
5505 pub p_next: *const c_void,
5506 pub flags: PipelineRasterizationStateCreateFlags,
5507 pub depth_clamp_enable: Bool32,
5508 pub rasterizer_discard_enable: Bool32,
5509 pub polygon_mode: PolygonMode,
5510 pub cull_mode: CullModeFlags,
5511 pub front_face: FrontFace,
5512 pub depth_bias_enable: Bool32,
5513 pub depth_bias_constant_factor: f32,
5514 pub depth_bias_clamp: f32,
5515 pub depth_bias_slope_factor: f32,
5516 pub line_width: f32,
5517 }
5518 impl ::std::default::Default for PipelineRasterizationStateCreateInfo {
default() -> Self5519 fn default() -> Self {
5520 Self {
5521 s_type: StructureType::PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
5522 p_next: ::std::ptr::null(),
5523 flags: PipelineRasterizationStateCreateFlags::default(),
5524 depth_clamp_enable: Bool32::default(),
5525 rasterizer_discard_enable: Bool32::default(),
5526 polygon_mode: PolygonMode::default(),
5527 cull_mode: CullModeFlags::default(),
5528 front_face: FrontFace::default(),
5529 depth_bias_enable: Bool32::default(),
5530 depth_bias_constant_factor: f32::default(),
5531 depth_bias_clamp: f32::default(),
5532 depth_bias_slope_factor: f32::default(),
5533 line_width: f32::default(),
5534 }
5535 }
5536 }
5537 impl PipelineRasterizationStateCreateInfo {
builder<'a>() -> PipelineRasterizationStateCreateInfoBuilder<'a>5538 pub fn builder<'a>() -> PipelineRasterizationStateCreateInfoBuilder<'a> {
5539 PipelineRasterizationStateCreateInfoBuilder {
5540 inner: Self::default(),
5541 marker: ::std::marker::PhantomData,
5542 }
5543 }
5544 }
5545 #[repr(transparent)]
5546 pub struct PipelineRasterizationStateCreateInfoBuilder<'a> {
5547 inner: PipelineRasterizationStateCreateInfo,
5548 marker: ::std::marker::PhantomData<&'a ()>,
5549 }
5550 pub unsafe trait ExtendsPipelineRasterizationStateCreateInfo {}
5551 impl<'a> ::std::ops::Deref for PipelineRasterizationStateCreateInfoBuilder<'a> {
5552 type Target = PipelineRasterizationStateCreateInfo;
deref(&self) -> &Self::Target5553 fn deref(&self) -> &Self::Target {
5554 &self.inner
5555 }
5556 }
5557 impl<'a> ::std::ops::DerefMut for PipelineRasterizationStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5558 fn deref_mut(&mut self) -> &mut Self::Target {
5559 &mut self.inner
5560 }
5561 }
5562 impl<'a> PipelineRasterizationStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineRasterizationStateCreateFlags) -> Self5563 pub fn flags(mut self, flags: PipelineRasterizationStateCreateFlags) -> Self {
5564 self.inner.flags = flags;
5565 self
5566 }
depth_clamp_enable(mut self, depth_clamp_enable: bool) -> Self5567 pub fn depth_clamp_enable(mut self, depth_clamp_enable: bool) -> Self {
5568 self.inner.depth_clamp_enable = depth_clamp_enable.into();
5569 self
5570 }
rasterizer_discard_enable(mut self, rasterizer_discard_enable: bool) -> Self5571 pub fn rasterizer_discard_enable(mut self, rasterizer_discard_enable: bool) -> Self {
5572 self.inner.rasterizer_discard_enable = rasterizer_discard_enable.into();
5573 self
5574 }
polygon_mode(mut self, polygon_mode: PolygonMode) -> Self5575 pub fn polygon_mode(mut self, polygon_mode: PolygonMode) -> Self {
5576 self.inner.polygon_mode = polygon_mode;
5577 self
5578 }
cull_mode(mut self, cull_mode: CullModeFlags) -> Self5579 pub fn cull_mode(mut self, cull_mode: CullModeFlags) -> Self {
5580 self.inner.cull_mode = cull_mode;
5581 self
5582 }
front_face(mut self, front_face: FrontFace) -> Self5583 pub fn front_face(mut self, front_face: FrontFace) -> Self {
5584 self.inner.front_face = front_face;
5585 self
5586 }
depth_bias_enable(mut self, depth_bias_enable: bool) -> Self5587 pub fn depth_bias_enable(mut self, depth_bias_enable: bool) -> Self {
5588 self.inner.depth_bias_enable = depth_bias_enable.into();
5589 self
5590 }
depth_bias_constant_factor(mut self, depth_bias_constant_factor: f32) -> Self5591 pub fn depth_bias_constant_factor(mut self, depth_bias_constant_factor: f32) -> Self {
5592 self.inner.depth_bias_constant_factor = depth_bias_constant_factor;
5593 self
5594 }
depth_bias_clamp(mut self, depth_bias_clamp: f32) -> Self5595 pub fn depth_bias_clamp(mut self, depth_bias_clamp: f32) -> Self {
5596 self.inner.depth_bias_clamp = depth_bias_clamp;
5597 self
5598 }
depth_bias_slope_factor(mut self, depth_bias_slope_factor: f32) -> Self5599 pub fn depth_bias_slope_factor(mut self, depth_bias_slope_factor: f32) -> Self {
5600 self.inner.depth_bias_slope_factor = depth_bias_slope_factor;
5601 self
5602 }
line_width(mut self, line_width: f32) -> Self5603 pub fn line_width(mut self, line_width: f32) -> Self {
5604 self.inner.line_width = line_width;
5605 self
5606 }
5607 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5608 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5609 #[doc = r" valid extension structs can be pushed into the chain."]
5610 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5611 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineRasterizationStateCreateInfo>( mut self, next: &'a mut T, ) -> Self5612 pub fn push_next<T: ExtendsPipelineRasterizationStateCreateInfo>(
5613 mut self,
5614 next: &'a mut T,
5615 ) -> Self {
5616 unsafe {
5617 let next_ptr = next as *mut T as *mut BaseOutStructure;
5618 let last_next = ptr_chain_iter(next).last().unwrap();
5619 (*last_next).p_next = self.inner.p_next as _;
5620 self.inner.p_next = next_ptr as _;
5621 }
5622 self
5623 }
5624 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5625 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5626 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineRasterizationStateCreateInfo5627 pub fn build(self) -> PipelineRasterizationStateCreateInfo {
5628 self.inner
5629 }
5630 }
5631 #[repr(C)]
5632 #[cfg_attr(feature = "debug", derive(Debug))]
5633 #[derive(Copy, Clone)]
5634 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineMultisampleStateCreateInfo.html>"]
5635 pub struct PipelineMultisampleStateCreateInfo {
5636 pub s_type: StructureType,
5637 pub p_next: *const c_void,
5638 pub flags: PipelineMultisampleStateCreateFlags,
5639 pub rasterization_samples: SampleCountFlags,
5640 pub sample_shading_enable: Bool32,
5641 pub min_sample_shading: f32,
5642 pub p_sample_mask: *const SampleMask,
5643 pub alpha_to_coverage_enable: Bool32,
5644 pub alpha_to_one_enable: Bool32,
5645 }
5646 impl ::std::default::Default for PipelineMultisampleStateCreateInfo {
default() -> Self5647 fn default() -> Self {
5648 Self {
5649 s_type: StructureType::PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
5650 p_next: ::std::ptr::null(),
5651 flags: PipelineMultisampleStateCreateFlags::default(),
5652 rasterization_samples: SampleCountFlags::default(),
5653 sample_shading_enable: Bool32::default(),
5654 min_sample_shading: f32::default(),
5655 p_sample_mask: ::std::ptr::null(),
5656 alpha_to_coverage_enable: Bool32::default(),
5657 alpha_to_one_enable: Bool32::default(),
5658 }
5659 }
5660 }
5661 impl PipelineMultisampleStateCreateInfo {
builder<'a>() -> PipelineMultisampleStateCreateInfoBuilder<'a>5662 pub fn builder<'a>() -> PipelineMultisampleStateCreateInfoBuilder<'a> {
5663 PipelineMultisampleStateCreateInfoBuilder {
5664 inner: Self::default(),
5665 marker: ::std::marker::PhantomData,
5666 }
5667 }
5668 }
5669 #[repr(transparent)]
5670 pub struct PipelineMultisampleStateCreateInfoBuilder<'a> {
5671 inner: PipelineMultisampleStateCreateInfo,
5672 marker: ::std::marker::PhantomData<&'a ()>,
5673 }
5674 pub unsafe trait ExtendsPipelineMultisampleStateCreateInfo {}
5675 impl<'a> ::std::ops::Deref for PipelineMultisampleStateCreateInfoBuilder<'a> {
5676 type Target = PipelineMultisampleStateCreateInfo;
deref(&self) -> &Self::Target5677 fn deref(&self) -> &Self::Target {
5678 &self.inner
5679 }
5680 }
5681 impl<'a> ::std::ops::DerefMut for PipelineMultisampleStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5682 fn deref_mut(&mut self) -> &mut Self::Target {
5683 &mut self.inner
5684 }
5685 }
5686 impl<'a> PipelineMultisampleStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineMultisampleStateCreateFlags) -> Self5687 pub fn flags(mut self, flags: PipelineMultisampleStateCreateFlags) -> Self {
5688 self.inner.flags = flags;
5689 self
5690 }
rasterization_samples(mut self, rasterization_samples: SampleCountFlags) -> Self5691 pub fn rasterization_samples(mut self, rasterization_samples: SampleCountFlags) -> Self {
5692 self.inner.rasterization_samples = rasterization_samples;
5693 self
5694 }
sample_shading_enable(mut self, sample_shading_enable: bool) -> Self5695 pub fn sample_shading_enable(mut self, sample_shading_enable: bool) -> Self {
5696 self.inner.sample_shading_enable = sample_shading_enable.into();
5697 self
5698 }
min_sample_shading(mut self, min_sample_shading: f32) -> Self5699 pub fn min_sample_shading(mut self, min_sample_shading: f32) -> Self {
5700 self.inner.min_sample_shading = min_sample_shading;
5701 self
5702 }
5703 #[doc = r" Sets `p_sample_mask` to `null` if the slice is empty. The mask will"]
5704 #[doc = r" be treated as if it has all bits set to `1`."]
5705 #[doc = r""]
5706 #[doc = r" See <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineMultisampleStateCreateInfo.html#_description>"]
5707 #[doc = r" for more details."]
sample_mask(mut self, sample_mask: &'a [SampleMask]) -> Self5708 pub fn sample_mask(mut self, sample_mask: &'a [SampleMask]) -> Self {
5709 self.inner.p_sample_mask = if sample_mask.is_empty() {
5710 std::ptr::null()
5711 } else {
5712 sample_mask.as_ptr() as *const SampleMask
5713 };
5714 self
5715 }
alpha_to_coverage_enable(mut self, alpha_to_coverage_enable: bool) -> Self5716 pub fn alpha_to_coverage_enable(mut self, alpha_to_coverage_enable: bool) -> Self {
5717 self.inner.alpha_to_coverage_enable = alpha_to_coverage_enable.into();
5718 self
5719 }
alpha_to_one_enable(mut self, alpha_to_one_enable: bool) -> Self5720 pub fn alpha_to_one_enable(mut self, alpha_to_one_enable: bool) -> Self {
5721 self.inner.alpha_to_one_enable = alpha_to_one_enable.into();
5722 self
5723 }
5724 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5725 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5726 #[doc = r" valid extension structs can be pushed into the chain."]
5727 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5728 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineMultisampleStateCreateInfo>( mut self, next: &'a mut T, ) -> Self5729 pub fn push_next<T: ExtendsPipelineMultisampleStateCreateInfo>(
5730 mut self,
5731 next: &'a mut T,
5732 ) -> Self {
5733 unsafe {
5734 let next_ptr = next as *mut T as *mut BaseOutStructure;
5735 let last_next = ptr_chain_iter(next).last().unwrap();
5736 (*last_next).p_next = self.inner.p_next as _;
5737 self.inner.p_next = next_ptr as _;
5738 }
5739 self
5740 }
5741 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5742 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5743 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineMultisampleStateCreateInfo5744 pub fn build(self) -> PipelineMultisampleStateCreateInfo {
5745 self.inner
5746 }
5747 }
5748 #[repr(C)]
5749 #[cfg_attr(feature = "debug", derive(Debug))]
5750 #[derive(Copy, Clone, Default)]
5751 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineColorBlendAttachmentState.html>"]
5752 pub struct PipelineColorBlendAttachmentState {
5753 pub blend_enable: Bool32,
5754 pub src_color_blend_factor: BlendFactor,
5755 pub dst_color_blend_factor: BlendFactor,
5756 pub color_blend_op: BlendOp,
5757 pub src_alpha_blend_factor: BlendFactor,
5758 pub dst_alpha_blend_factor: BlendFactor,
5759 pub alpha_blend_op: BlendOp,
5760 pub color_write_mask: ColorComponentFlags,
5761 }
5762 impl PipelineColorBlendAttachmentState {
builder<'a>() -> PipelineColorBlendAttachmentStateBuilder<'a>5763 pub fn builder<'a>() -> PipelineColorBlendAttachmentStateBuilder<'a> {
5764 PipelineColorBlendAttachmentStateBuilder {
5765 inner: Self::default(),
5766 marker: ::std::marker::PhantomData,
5767 }
5768 }
5769 }
5770 #[repr(transparent)]
5771 pub struct PipelineColorBlendAttachmentStateBuilder<'a> {
5772 inner: PipelineColorBlendAttachmentState,
5773 marker: ::std::marker::PhantomData<&'a ()>,
5774 }
5775 impl<'a> ::std::ops::Deref for PipelineColorBlendAttachmentStateBuilder<'a> {
5776 type Target = PipelineColorBlendAttachmentState;
deref(&self) -> &Self::Target5777 fn deref(&self) -> &Self::Target {
5778 &self.inner
5779 }
5780 }
5781 impl<'a> ::std::ops::DerefMut for PipelineColorBlendAttachmentStateBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5782 fn deref_mut(&mut self) -> &mut Self::Target {
5783 &mut self.inner
5784 }
5785 }
5786 impl<'a> PipelineColorBlendAttachmentStateBuilder<'a> {
blend_enable(mut self, blend_enable: bool) -> Self5787 pub fn blend_enable(mut self, blend_enable: bool) -> Self {
5788 self.inner.blend_enable = blend_enable.into();
5789 self
5790 }
src_color_blend_factor(mut self, src_color_blend_factor: BlendFactor) -> Self5791 pub fn src_color_blend_factor(mut self, src_color_blend_factor: BlendFactor) -> Self {
5792 self.inner.src_color_blend_factor = src_color_blend_factor;
5793 self
5794 }
dst_color_blend_factor(mut self, dst_color_blend_factor: BlendFactor) -> Self5795 pub fn dst_color_blend_factor(mut self, dst_color_blend_factor: BlendFactor) -> Self {
5796 self.inner.dst_color_blend_factor = dst_color_blend_factor;
5797 self
5798 }
color_blend_op(mut self, color_blend_op: BlendOp) -> Self5799 pub fn color_blend_op(mut self, color_blend_op: BlendOp) -> Self {
5800 self.inner.color_blend_op = color_blend_op;
5801 self
5802 }
src_alpha_blend_factor(mut self, src_alpha_blend_factor: BlendFactor) -> Self5803 pub fn src_alpha_blend_factor(mut self, src_alpha_blend_factor: BlendFactor) -> Self {
5804 self.inner.src_alpha_blend_factor = src_alpha_blend_factor;
5805 self
5806 }
dst_alpha_blend_factor(mut self, dst_alpha_blend_factor: BlendFactor) -> Self5807 pub fn dst_alpha_blend_factor(mut self, dst_alpha_blend_factor: BlendFactor) -> Self {
5808 self.inner.dst_alpha_blend_factor = dst_alpha_blend_factor;
5809 self
5810 }
alpha_blend_op(mut self, alpha_blend_op: BlendOp) -> Self5811 pub fn alpha_blend_op(mut self, alpha_blend_op: BlendOp) -> Self {
5812 self.inner.alpha_blend_op = alpha_blend_op;
5813 self
5814 }
color_write_mask(mut self, color_write_mask: ColorComponentFlags) -> Self5815 pub fn color_write_mask(mut self, color_write_mask: ColorComponentFlags) -> Self {
5816 self.inner.color_write_mask = color_write_mask;
5817 self
5818 }
5819 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5820 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5821 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineColorBlendAttachmentState5822 pub fn build(self) -> PipelineColorBlendAttachmentState {
5823 self.inner
5824 }
5825 }
5826 #[repr(C)]
5827 #[cfg_attr(feature = "debug", derive(Debug))]
5828 #[derive(Copy, Clone)]
5829 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineColorBlendStateCreateInfo.html>"]
5830 pub struct PipelineColorBlendStateCreateInfo {
5831 pub s_type: StructureType,
5832 pub p_next: *const c_void,
5833 pub flags: PipelineColorBlendStateCreateFlags,
5834 pub logic_op_enable: Bool32,
5835 pub logic_op: LogicOp,
5836 pub attachment_count: u32,
5837 pub p_attachments: *const PipelineColorBlendAttachmentState,
5838 pub blend_constants: [f32; 4],
5839 }
5840 impl ::std::default::Default for PipelineColorBlendStateCreateInfo {
default() -> Self5841 fn default() -> Self {
5842 Self {
5843 s_type: StructureType::PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
5844 p_next: ::std::ptr::null(),
5845 flags: PipelineColorBlendStateCreateFlags::default(),
5846 logic_op_enable: Bool32::default(),
5847 logic_op: LogicOp::default(),
5848 attachment_count: u32::default(),
5849 p_attachments: ::std::ptr::null(),
5850 blend_constants: unsafe { ::std::mem::zeroed() },
5851 }
5852 }
5853 }
5854 impl PipelineColorBlendStateCreateInfo {
builder<'a>() -> PipelineColorBlendStateCreateInfoBuilder<'a>5855 pub fn builder<'a>() -> PipelineColorBlendStateCreateInfoBuilder<'a> {
5856 PipelineColorBlendStateCreateInfoBuilder {
5857 inner: Self::default(),
5858 marker: ::std::marker::PhantomData,
5859 }
5860 }
5861 }
5862 #[repr(transparent)]
5863 pub struct PipelineColorBlendStateCreateInfoBuilder<'a> {
5864 inner: PipelineColorBlendStateCreateInfo,
5865 marker: ::std::marker::PhantomData<&'a ()>,
5866 }
5867 pub unsafe trait ExtendsPipelineColorBlendStateCreateInfo {}
5868 impl<'a> ::std::ops::Deref for PipelineColorBlendStateCreateInfoBuilder<'a> {
5869 type Target = PipelineColorBlendStateCreateInfo;
deref(&self) -> &Self::Target5870 fn deref(&self) -> &Self::Target {
5871 &self.inner
5872 }
5873 }
5874 impl<'a> ::std::ops::DerefMut for PipelineColorBlendStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5875 fn deref_mut(&mut self) -> &mut Self::Target {
5876 &mut self.inner
5877 }
5878 }
5879 impl<'a> PipelineColorBlendStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineColorBlendStateCreateFlags) -> Self5880 pub fn flags(mut self, flags: PipelineColorBlendStateCreateFlags) -> Self {
5881 self.inner.flags = flags;
5882 self
5883 }
logic_op_enable(mut self, logic_op_enable: bool) -> Self5884 pub fn logic_op_enable(mut self, logic_op_enable: bool) -> Self {
5885 self.inner.logic_op_enable = logic_op_enable.into();
5886 self
5887 }
logic_op(mut self, logic_op: LogicOp) -> Self5888 pub fn logic_op(mut self, logic_op: LogicOp) -> Self {
5889 self.inner.logic_op = logic_op;
5890 self
5891 }
attachments(mut self, attachments: &'a [PipelineColorBlendAttachmentState]) -> Self5892 pub fn attachments(mut self, attachments: &'a [PipelineColorBlendAttachmentState]) -> Self {
5893 self.inner.attachment_count = attachments.len() as _;
5894 self.inner.p_attachments = attachments.as_ptr();
5895 self
5896 }
blend_constants(mut self, blend_constants: [f32; 4]) -> Self5897 pub fn blend_constants(mut self, blend_constants: [f32; 4]) -> Self {
5898 self.inner.blend_constants = blend_constants;
5899 self
5900 }
5901 #[doc = r" Prepends the given extension struct between the root and the first pointer. This"]
5902 #[doc = r" method only exists on structs that can be passed to a function directly. Only"]
5903 #[doc = r" valid extension structs can be pushed into the chain."]
5904 #[doc = r" If the chain looks like `A -> B -> C`, and you call `builder.push_next(&mut D)`, then the"]
5905 #[doc = r" chain will look like `A -> D -> B -> C`."]
push_next<T: ExtendsPipelineColorBlendStateCreateInfo>( mut self, next: &'a mut T, ) -> Self5906 pub fn push_next<T: ExtendsPipelineColorBlendStateCreateInfo>(
5907 mut self,
5908 next: &'a mut T,
5909 ) -> Self {
5910 unsafe {
5911 let next_ptr = next as *mut T as *mut BaseOutStructure;
5912 let last_next = ptr_chain_iter(next).last().unwrap();
5913 (*last_next).p_next = self.inner.p_next as _;
5914 self.inner.p_next = next_ptr as _;
5915 }
5916 self
5917 }
5918 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5919 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5920 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineColorBlendStateCreateInfo5921 pub fn build(self) -> PipelineColorBlendStateCreateInfo {
5922 self.inner
5923 }
5924 }
5925 #[repr(C)]
5926 #[cfg_attr(feature = "debug", derive(Debug))]
5927 #[derive(Copy, Clone)]
5928 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineDynamicStateCreateInfo.html>"]
5929 pub struct PipelineDynamicStateCreateInfo {
5930 pub s_type: StructureType,
5931 pub p_next: *const c_void,
5932 pub flags: PipelineDynamicStateCreateFlags,
5933 pub dynamic_state_count: u32,
5934 pub p_dynamic_states: *const DynamicState,
5935 }
5936 impl ::std::default::Default for PipelineDynamicStateCreateInfo {
default() -> Self5937 fn default() -> Self {
5938 Self {
5939 s_type: StructureType::PIPELINE_DYNAMIC_STATE_CREATE_INFO,
5940 p_next: ::std::ptr::null(),
5941 flags: PipelineDynamicStateCreateFlags::default(),
5942 dynamic_state_count: u32::default(),
5943 p_dynamic_states: ::std::ptr::null(),
5944 }
5945 }
5946 }
5947 impl PipelineDynamicStateCreateInfo {
builder<'a>() -> PipelineDynamicStateCreateInfoBuilder<'a>5948 pub fn builder<'a>() -> PipelineDynamicStateCreateInfoBuilder<'a> {
5949 PipelineDynamicStateCreateInfoBuilder {
5950 inner: Self::default(),
5951 marker: ::std::marker::PhantomData,
5952 }
5953 }
5954 }
5955 #[repr(transparent)]
5956 pub struct PipelineDynamicStateCreateInfoBuilder<'a> {
5957 inner: PipelineDynamicStateCreateInfo,
5958 marker: ::std::marker::PhantomData<&'a ()>,
5959 }
5960 impl<'a> ::std::ops::Deref for PipelineDynamicStateCreateInfoBuilder<'a> {
5961 type Target = PipelineDynamicStateCreateInfo;
deref(&self) -> &Self::Target5962 fn deref(&self) -> &Self::Target {
5963 &self.inner
5964 }
5965 }
5966 impl<'a> ::std::ops::DerefMut for PipelineDynamicStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target5967 fn deref_mut(&mut self) -> &mut Self::Target {
5968 &mut self.inner
5969 }
5970 }
5971 impl<'a> PipelineDynamicStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineDynamicStateCreateFlags) -> Self5972 pub fn flags(mut self, flags: PipelineDynamicStateCreateFlags) -> Self {
5973 self.inner.flags = flags;
5974 self
5975 }
dynamic_states(mut self, dynamic_states: &'a [DynamicState]) -> Self5976 pub fn dynamic_states(mut self, dynamic_states: &'a [DynamicState]) -> Self {
5977 self.inner.dynamic_state_count = dynamic_states.len() as _;
5978 self.inner.p_dynamic_states = dynamic_states.as_ptr();
5979 self
5980 }
5981 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
5982 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
5983 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineDynamicStateCreateInfo5984 pub fn build(self) -> PipelineDynamicStateCreateInfo {
5985 self.inner
5986 }
5987 }
5988 #[repr(C)]
5989 #[cfg_attr(feature = "debug", derive(Debug))]
5990 #[derive(Copy, Clone, Default)]
5991 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkStencilOpState.html>"]
5992 pub struct StencilOpState {
5993 pub fail_op: StencilOp,
5994 pub pass_op: StencilOp,
5995 pub depth_fail_op: StencilOp,
5996 pub compare_op: CompareOp,
5997 pub compare_mask: u32,
5998 pub write_mask: u32,
5999 pub reference: u32,
6000 }
6001 impl StencilOpState {
builder<'a>() -> StencilOpStateBuilder<'a>6002 pub fn builder<'a>() -> StencilOpStateBuilder<'a> {
6003 StencilOpStateBuilder {
6004 inner: Self::default(),
6005 marker: ::std::marker::PhantomData,
6006 }
6007 }
6008 }
6009 #[repr(transparent)]
6010 pub struct StencilOpStateBuilder<'a> {
6011 inner: StencilOpState,
6012 marker: ::std::marker::PhantomData<&'a ()>,
6013 }
6014 impl<'a> ::std::ops::Deref for StencilOpStateBuilder<'a> {
6015 type Target = StencilOpState;
deref(&self) -> &Self::Target6016 fn deref(&self) -> &Self::Target {
6017 &self.inner
6018 }
6019 }
6020 impl<'a> ::std::ops::DerefMut for StencilOpStateBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target6021 fn deref_mut(&mut self) -> &mut Self::Target {
6022 &mut self.inner
6023 }
6024 }
6025 impl<'a> StencilOpStateBuilder<'a> {
fail_op(mut self, fail_op: StencilOp) -> Self6026 pub fn fail_op(mut self, fail_op: StencilOp) -> Self {
6027 self.inner.fail_op = fail_op;
6028 self
6029 }
pass_op(mut self, pass_op: StencilOp) -> Self6030 pub fn pass_op(mut self, pass_op: StencilOp) -> Self {
6031 self.inner.pass_op = pass_op;
6032 self
6033 }
depth_fail_op(mut self, depth_fail_op: StencilOp) -> Self6034 pub fn depth_fail_op(mut self, depth_fail_op: StencilOp) -> Self {
6035 self.inner.depth_fail_op = depth_fail_op;
6036 self
6037 }
compare_op(mut self, compare_op: CompareOp) -> Self6038 pub fn compare_op(mut self, compare_op: CompareOp) -> Self {
6039 self.inner.compare_op = compare_op;
6040 self
6041 }
compare_mask(mut self, compare_mask: u32) -> Self6042 pub fn compare_mask(mut self, compare_mask: u32) -> Self {
6043 self.inner.compare_mask = compare_mask;
6044 self
6045 }
write_mask(mut self, write_mask: u32) -> Self6046 pub fn write_mask(mut self, write_mask: u32) -> Self {
6047 self.inner.write_mask = write_mask;
6048 self
6049 }
reference(mut self, reference: u32) -> Self6050 pub fn reference(mut self, reference: u32) -> Self {
6051 self.inner.reference = reference;
6052 self
6053 }
6054 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
6055 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
6056 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> StencilOpState6057 pub fn build(self) -> StencilOpState {
6058 self.inner
6059 }
6060 }
6061 #[repr(C)]
6062 #[cfg_attr(feature = "debug", derive(Debug))]
6063 #[derive(Copy, Clone)]
6064 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineDepthStencilStateCreateInfo.html>"]
6065 pub struct PipelineDepthStencilStateCreateInfo {
6066 pub s_type: StructureType,
6067 pub p_next: *const c_void,
6068 pub flags: PipelineDepthStencilStateCreateFlags,
6069 pub depth_test_enable: Bool32,
6070 pub depth_write_enable: Bool32,
6071 pub depth_compare_op: CompareOp,
6072 pub depth_bounds_test_enable: Bool32,
6073 pub stencil_test_enable: Bool32,
6074 pub front: StencilOpState,
6075 pub back: StencilOpState,
6076 pub min_depth_bounds: f32,
6077 pub max_depth_bounds: f32,
6078 }
6079 impl ::std::default::Default for PipelineDepthStencilStateCreateInfo {
default() -> Self6080 fn default() -> Self {
6081 Self {
6082 s_type: StructureType::PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,
6083 p_next: ::std::ptr::null(),
6084 flags: PipelineDepthStencilStateCreateFlags::default(),
6085 depth_test_enable: Bool32::default(),
6086 depth_write_enable: Bool32::default(),
6087 depth_compare_op: CompareOp::default(),
6088 depth_bounds_test_enable: Bool32::default(),
6089 stencil_test_enable: Bool32::default(),
6090 front: StencilOpState::default(),
6091 back: StencilOpState::default(),
6092 min_depth_bounds: f32::default(),
6093 max_depth_bounds: f32::default(),
6094 }
6095 }
6096 }
6097 impl PipelineDepthStencilStateCreateInfo {
builder<'a>() -> PipelineDepthStencilStateCreateInfoBuilder<'a>6098 pub fn builder<'a>() -> PipelineDepthStencilStateCreateInfoBuilder<'a> {
6099 PipelineDepthStencilStateCreateInfoBuilder {
6100 inner: Self::default(),
6101 marker: ::std::marker::PhantomData,
6102 }
6103 }
6104 }
6105 #[repr(transparent)]
6106 pub struct PipelineDepthStencilStateCreateInfoBuilder<'a> {
6107 inner: PipelineDepthStencilStateCreateInfo,
6108 marker: ::std::marker::PhantomData<&'a ()>,
6109 }
6110 impl<'a> ::std::ops::Deref for PipelineDepthStencilStateCreateInfoBuilder<'a> {
6111 type Target = PipelineDepthStencilStateCreateInfo;
deref(&self) -> &Self::Target6112 fn deref(&self) -> &Self::Target {
6113 &self.inner
6114 }
6115 }
6116 impl<'a> ::std::ops::DerefMut for PipelineDepthStencilStateCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target6117 fn deref_mut(&mut self) -> &mut Self::Target {
6118 &mut self.inner
6119 }
6120 }
6121 impl<'a> PipelineDepthStencilStateCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineDepthStencilStateCreateFlags) -> Self6122 pub fn flags(mut self, flags: PipelineDepthStencilStateCreateFlags) -> Self {
6123 self.inner.flags = flags;
6124 self
6125 }
depth_test_enable(mut self, depth_test_enable: bool) -> Self6126 pub fn depth_test_enable(mut self, depth_test_enable: bool) -> Self {
6127 self.inner.depth_test_enable = depth_test_enable.into();
6128 self
6129 }
depth_write_enable(mut self, depth_write_enable: bool) -> Self6130 pub fn depth_write_enable(mut self, depth_write_enable: bool) -> Self {
6131 self.inner.depth_write_enable = depth_write_enable.into();
6132 self
6133 }
depth_compare_op(mut self, depth_compare_op: CompareOp) -> Self6134 pub fn depth_compare_op(mut self, depth_compare_op: CompareOp) -> Self {
6135 self.inner.depth_compare_op = depth_compare_op;
6136 self
6137 }
depth_bounds_test_enable(mut self, depth_bounds_test_enable: bool) -> Self6138 pub fn depth_bounds_test_enable(mut self, depth_bounds_test_enable: bool) -> Self {
6139 self.inner.depth_bounds_test_enable = depth_bounds_test_enable.into();
6140 self
6141 }
stencil_test_enable(mut self, stencil_test_enable: bool) -> Self6142 pub fn stencil_test_enable(mut self, stencil_test_enable: bool) -> Self {
6143 self.inner.stencil_test_enable = stencil_test_enable.into();
6144 self
6145 }
front(mut self, front: StencilOpState) -> Self6146 pub fn front(mut self, front: StencilOpState) -> Self {
6147 self.inner.front = front;
6148 self
6149 }
back(mut self, back: StencilOpState) -> Self6150 pub fn back(mut self, back: StencilOpState) -> Self {
6151 self.inner.back = back;
6152 self
6153 }
min_depth_bounds(mut self, min_depth_bounds: f32) -> Self6154 pub fn min_depth_bounds(mut self, min_depth_bounds: f32) -> Self {
6155 self.inner.min_depth_bounds = min_depth_bounds;
6156 self
6157 }
max_depth_bounds(mut self, max_depth_bounds: f32) -> Self6158 pub fn max_depth_bounds(mut self, max_depth_bounds: f32) -> Self {
6159 self.inner.max_depth_bounds = max_depth_bounds;
6160 self
6161 }
6162 #[doc = r" Calling build will **discard** all the lifetime information. Only call this if"]
6163 #[doc = r" necessary! Builders implement `Deref` targeting their corresponding Vulkan struct,"]
6164 #[doc = r" so references to builders can be passed directly to Vulkan functions."]
build(self) -> PipelineDepthStencilStateCreateInfo6165 pub fn build(self) -> PipelineDepthStencilStateCreateInfo {
6166 self.inner
6167 }
6168 }
6169 #[repr(C)]
6170 #[cfg_attr(feature = "debug", derive(Debug))]
6171 #[derive(Copy, Clone)]
6172 #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkGraphicsPipelineCreateInfo.html>"]
6173 pub struct GraphicsPipelineCreateInfo {
6174 pub s_type: StructureType,
6175 pub p_next: *const c_void,
6176 pub flags: PipelineCreateFlags,
6177 pub stage_count: u32,
6178 pub p_stages: *const PipelineShaderStageCreateInfo,
6179 pub p_vertex_input_state: *const PipelineVertexInputStateCreateInfo,
6180 pub p_input_assembly_state: *const PipelineInputAssemblyStateCreateInfo,
6181 pub p_tessellation_state: *const PipelineTessellationStateCreateInfo,
6182 pub p_viewport_state: *const PipelineViewportStateCreateInfo,
6183 pub p_rasterization_state: *const PipelineRasterizationStateCreateInfo,
6184 pub p_multisample_state: *const PipelineMultisampleStateCreateInfo,
6185 pub p_depth_stencil_state: *const PipelineDepthStencilStateCreateInfo,
6186 pub p_color_blend_state: *const PipelineColorBlendStateCreateInfo,
6187 pub p_dynamic_state: *const PipelineDynamicStateCreateInfo,
6188 pub layout: PipelineLayout,
6189 pub render_pass: RenderPass,
6190 pub subpass: u32,
6191 pub base_pipeline_handle: Pipeline,
6192 pub base_pipeline_index: i32,
6193 }
6194 impl ::std::default::Default for GraphicsPipelineCreateInfo {
default() -> Self6195 fn default() -> Self {
6196 Self {
6197 s_type: StructureType::GRAPHICS_PIPELINE_CREATE_INFO,
6198 p_next: ::std::ptr::null(),
6199 flags: PipelineCreateFlags::default(),
6200 stage_count: u32::default(),
6201 p_stages: ::std::ptr::null(),
6202 p_vertex_input_state: ::std::ptr::null(),
6203 p_input_assembly_state: ::std::ptr::null(),
6204 p_tessellation_state: ::std::ptr::null(),
6205 p_viewport_state: ::std::ptr::null(),
6206 p_rasterization_state: ::std::ptr::null(),
6207 p_multisample_state: ::std::ptr::null(),
6208 p_depth_stencil_state: ::std::ptr::null(),
6209 p_color_blend_state: ::std::ptr::null(),
6210 p_dynamic_state: ::std::ptr::null(),
6211 layout: PipelineLayout::default(),
6212 render_pass: RenderPass::default(),
6213 subpass: u32::default(),
6214 base_pipeline_handle: Pipeline::default(),
6215 base_pipeline_index: i32::default(),
6216 }
6217 }
6218 }
6219 impl GraphicsPipelineCreateInfo {
builder<'a>() -> GraphicsPipelineCreateInfoBuilder<'a>6220 pub fn builder<'a>() -> GraphicsPipelineCreateInfoBuilder<'a> {
6221 GraphicsPipelineCreateInfoBuilder {
6222 inner: Self::default(),
6223 marker: ::std::marker::PhantomData,
6224 }
6225 }
6226 }
6227 #[repr(transparent)]
6228 pub struct GraphicsPipelineCreateInfoBuilder<'a> {
6229 inner: GraphicsPipelineCreateInfo,
6230 marker: ::std::marker::PhantomData<&'a ()>,
6231 }
6232 pub unsafe trait ExtendsGraphicsPipelineCreateInfo {}
6233 impl<'a> ::std::ops::Deref for GraphicsPipelineCreateInfoBuilder<'a> {
6234 type Target = GraphicsPipelineCreateInfo;
deref(&self) -> &Self::Target6235 fn deref(&self) -> &Self::Target {
6236 &self.inner
6237 }
6238 }
6239 impl<'a> ::std::ops::DerefMut for GraphicsPipelineCreateInfoBuilder<'a> {
deref_mut(&mut self) -> &mut Self::Target6240 fn deref_mut(&mut self) -> &mut Self::Target {
6241 &mut self.inner
6242 }
6243 }
6244 impl<'a> GraphicsPipelineCreateInfoBuilder<'a> {
flags(mut self, flags: PipelineCreateFlags) -> Self6245 pub fn flags(mut self, flags: PipelineCreateFlags) -> Self {
6246 self.inner.flags = flags;
6247 self
6248 }
stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self6249 pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
6250 self.inner.stage_count = stages.len() as _;
6251 self.inner.p_stages = stages.as_ptr();
6252 self
6253 }
vertex_input_state( mut self, vertex_input_state: &'a PipelineVertexInputStateCreateInfo, ) -> Self6254 pub fn vertex_input_state(
6255 mut self,
6256 vertex_input_state: &'a PipelineVertexInputStateCreateInfo,
6257 ) -> Self {
6258 self.inner.p_vertex_input_state = vertex_input_state;
6259 self
6260 }
input_assembly_state( mut self, input_assembly_state: &'a PipelineInputAssemblyStateCreateInfo, ) -> Self6261 pub fn input_assembly_state(
6262 mut self,
6263 input_assembly_state: &'a PipelineInputAssemblyStateCreateInfo,
6264 ) -> Self {
6265 self.inner.p_input_assembly_state = input_assembly_state;
6266 self
6267 }
tessellation_state( mut self, tessellation_state: &'a PipelineTessellationStateCreateInfo, ) -> Self6268 pub fn tessellation_state(
6269 mut self,
6270 tessellation_state: &'a PipelineTessellationStateCreateInfo,
6271 ) -> Self {
6272 self.inner.p_tessellation_state = tessellation_state;
6273 self
6274 }
viewport_state(mut self, viewport_state: &'a PipelineViewportStateCreateInfo) -> Self6275