1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 // Copyright 2018 Jacob Lifshay
4 // allow unneeded_field_pattern to ensure fields aren't accidently missed
5 #![cfg_attr(feature = "cargo-clippy", allow(clippy::unneeded_field_pattern))]
8 use buffer::{Buffer, BufferMemory};
11 Descriptor, DescriptorLayout, DescriptorPool, DescriptorSet, DescriptorSetLayout,
15 DeviceMemory, DeviceMemoryAllocation, DeviceMemoryHeap, DeviceMemoryHeaps, DeviceMemoryLayout,
16 DeviceMemoryType, DeviceMemoryTypes,
18 use enum_map::EnumMap;
19 use handle::{Handle, MutHandle, OwnedHandle, SharedHandle};
21 ComponentMapping, Image, ImageMemory, ImageMultisampleCount, ImageProperties, ImageView,
22 ImageViewType, SupportedTilings,
24 use pipeline::{self, PipelineLayout};
25 use render_pass::RenderPass;
28 use shader_module::ShaderModule;
31 use std::iter::FromIterator;
34 use std::os::raw::{c_char, c_void};
36 use std::ptr::null_mut;
37 #[cfg(target_os = "linux")]
38 use std::ptr::NonNull;
39 use std::str::FromStr;
40 use swapchain::SurfacePlatform;
44 #[cfg(target_os = "linux")]
47 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Enum)]
49 #[allow(non_camel_case_types)]
53 VK_KHR_device_group_creation,
55 VK_KHR_descriptor_update_template,
57 VK_KHR_get_memory_requirements2,
58 VK_KHR_get_physical_device_properties2,
59 VK_KHR_sampler_ycbcr_conversion,
62 VK_KHR_external_memory_capabilities,
63 VK_KHR_external_fence_capabilities,
64 VK_KHR_external_semaphore_capabilities,
66 VK_KHR_storage_buffer_storage_class,
67 VK_KHR_dedicated_allocation,
68 VK_KHR_external_fence,
69 VK_KHR_external_memory,
70 VK_KHR_external_semaphore,
72 VK_KHR_relaxed_block_layout,
73 VK_KHR_shader_draw_parameters,
74 VK_KHR_variable_pointers,
76 #[cfg(target_os = "linux")]
80 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
81 pub enum ExtensionScope {
86 macro_rules! extensions {
87 [$($extension:expr),*] => {
89 let extensions: Extensions = [$($extension),*].iter().map(|v|*v).collect();
96 pub fn get_required_extensions(self) -> Extensions {
98 Extension::VK_KHR_surface
99 | Extension::VK_KHR_bind_memory2
100 | Extension::VK_KHR_device_group_creation
101 | Extension::VK_KHR_descriptor_update_template
102 | Extension::VK_KHR_maintenance1
103 | Extension::VK_KHR_get_memory_requirements2
104 | Extension::VK_KHR_get_physical_device_properties2
105 | Extension::VK_KHR_maintenance2
106 | Extension::VK_KHR_storage_buffer_storage_class
107 | Extension::VK_KHR_relaxed_block_layout
108 | Extension::VK_KHR_shader_draw_parameters => extensions![],
109 Extension::VK_KHR_device_group => extensions![Extension::VK_KHR_device_group_creation],
110 Extension::VK_KHR_sampler_ycbcr_conversion => extensions![
111 Extension::VK_KHR_maintenance1,
112 Extension::VK_KHR_bind_memory2,
113 Extension::VK_KHR_get_memory_requirements2,
114 Extension::VK_KHR_get_physical_device_properties2
116 Extension::VK_KHR_maintenance3
117 | Extension::VK_KHR_external_memory_capabilities
118 | Extension::VK_KHR_external_fence_capabilities
119 | Extension::VK_KHR_external_semaphore_capabilities
120 | Extension::VK_KHR_multiview => {
121 extensions![Extension::VK_KHR_get_physical_device_properties2]
123 Extension::VK_KHR_16bit_storage | Extension::VK_KHR_variable_pointers => extensions![
124 Extension::VK_KHR_get_physical_device_properties2,
125 Extension::VK_KHR_storage_buffer_storage_class
127 Extension::VK_KHR_dedicated_allocation => {
128 extensions![Extension::VK_KHR_get_memory_requirements2]
130 Extension::VK_KHR_external_fence => {
131 extensions![Extension::VK_KHR_external_fence_capabilities]
133 Extension::VK_KHR_external_memory => {
134 extensions![Extension::VK_KHR_external_memory_capabilities]
136 Extension::VK_KHR_external_semaphore => {
137 extensions![Extension::VK_KHR_external_semaphore_capabilities]
139 Extension::VK_KHR_swapchain => extensions![Extension::VK_KHR_surface],
140 #[cfg(target_os = "linux")]
141 Extension::VK_KHR_xcb_surface => extensions![Extension::VK_KHR_surface],
144 pub fn get_recursively_required_extensions(self) -> Extensions {
145 let mut retval = self.get_required_extensions();
146 let mut worklist: EnumMap<Extension, Extension> = enum_map! {_ => self};
147 let worklist = worklist.as_mut_slice();
148 let mut worklist_size = 1;
149 while worklist_size > 0 {
151 let extension = worklist[worklist_size];
152 retval[extension] = true;
153 for (extension, &v) in extension.get_required_extensions().iter() {
154 if v && !retval[extension] {
155 worklist[worklist_size] = extension;
162 pub fn get_name(self) -> &'static str {
164 ($($(#[$attributes:meta])* $name:ident,)*) => {
166 $($(#[$attributes])* Extension::$name => stringify!($name),)*
174 VK_KHR_device_group_creation,
175 VK_KHR_descriptor_update_template,
177 VK_KHR_get_memory_requirements2,
178 VK_KHR_get_physical_device_properties2,
179 VK_KHR_sampler_ycbcr_conversion,
182 VK_KHR_external_memory_capabilities,
183 VK_KHR_external_fence_capabilities,
184 VK_KHR_external_semaphore_capabilities,
185 VK_KHR_16bit_storage,
186 VK_KHR_storage_buffer_storage_class,
187 VK_KHR_dedicated_allocation,
188 VK_KHR_external_fence,
189 VK_KHR_external_memory,
190 VK_KHR_external_semaphore,
192 VK_KHR_relaxed_block_layout,
193 VK_KHR_shader_draw_parameters,
194 VK_KHR_variable_pointers,
196 #[cfg(target_os = "linux")]
200 pub fn get_spec_version(self) -> u32 {
202 Extension::VK_KHR_surface => api::VK_KHR_SURFACE_SPEC_VERSION,
203 Extension::VK_KHR_bind_memory2 => api::VK_KHR_BIND_MEMORY_2_SPEC_VERSION,
204 Extension::VK_KHR_device_group => api::VK_KHR_DEVICE_GROUP_SPEC_VERSION,
205 Extension::VK_KHR_device_group_creation => {
206 api::VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION
208 Extension::VK_KHR_descriptor_update_template => {
209 api::VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION
211 Extension::VK_KHR_maintenance1 => api::VK_KHR_MAINTENANCE1_SPEC_VERSION,
212 Extension::VK_KHR_get_memory_requirements2 => {
213 api::VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION
215 Extension::VK_KHR_get_physical_device_properties2 => {
216 api::VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION
218 Extension::VK_KHR_sampler_ycbcr_conversion => {
219 api::VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION
221 Extension::VK_KHR_maintenance2 => api::VK_KHR_MAINTENANCE2_SPEC_VERSION,
222 Extension::VK_KHR_maintenance3 => api::VK_KHR_MAINTENANCE3_SPEC_VERSION,
223 Extension::VK_KHR_external_memory_capabilities => {
224 api::VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION
226 Extension::VK_KHR_external_fence_capabilities => {
227 api::VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION
229 Extension::VK_KHR_external_semaphore_capabilities => {
230 api::VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION
232 Extension::VK_KHR_16bit_storage => api::VK_KHR_16BIT_STORAGE_SPEC_VERSION,
233 Extension::VK_KHR_storage_buffer_storage_class => {
234 api::VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION
236 Extension::VK_KHR_dedicated_allocation => api::VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION,
237 Extension::VK_KHR_external_fence => api::VK_KHR_EXTERNAL_FENCE_SPEC_VERSION,
238 Extension::VK_KHR_external_memory => api::VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION,
239 Extension::VK_KHR_external_semaphore => api::VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION,
240 Extension::VK_KHR_multiview => api::VK_KHR_MULTIVIEW_SPEC_VERSION,
241 Extension::VK_KHR_relaxed_block_layout => api::VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION,
242 Extension::VK_KHR_shader_draw_parameters => {
243 api::VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION
245 Extension::VK_KHR_variable_pointers => api::VK_KHR_VARIABLE_POINTERS_SPEC_VERSION,
246 Extension::VK_KHR_swapchain => api::VK_KHR_SWAPCHAIN_SPEC_VERSION,
247 #[cfg(target_os = "linux")]
248 Extension::VK_KHR_xcb_surface => api::VK_KHR_XCB_SURFACE_SPEC_VERSION,
251 pub fn get_properties(self) -> api::VkExtensionProperties {
252 let mut retval = api::VkExtensionProperties {
253 extensionName: [0; api::VK_MAX_EXTENSION_NAME_SIZE as usize],
254 specVersion: self.get_spec_version(),
256 util::copy_str_to_char_array(&mut retval.extensionName, self.get_name());
259 pub fn get_scope(self) -> ExtensionScope {
261 Extension::VK_KHR_surface
262 | Extension::VK_KHR_device_group_creation
263 | Extension::VK_KHR_get_physical_device_properties2
264 | Extension::VK_KHR_external_memory_capabilities
265 | Extension::VK_KHR_external_fence_capabilities
266 | Extension::VK_KHR_external_semaphore_capabilities => ExtensionScope::Instance,
267 Extension::VK_KHR_bind_memory2
268 | Extension::VK_KHR_device_group
269 | Extension::VK_KHR_descriptor_update_template
270 | Extension::VK_KHR_maintenance1
271 | Extension::VK_KHR_get_memory_requirements2
272 | Extension::VK_KHR_sampler_ycbcr_conversion
273 | Extension::VK_KHR_maintenance2
274 | Extension::VK_KHR_maintenance3
275 | Extension::VK_KHR_16bit_storage
276 | Extension::VK_KHR_storage_buffer_storage_class
277 | Extension::VK_KHR_dedicated_allocation
278 | Extension::VK_KHR_external_fence
279 | Extension::VK_KHR_external_memory
280 | Extension::VK_KHR_external_semaphore
281 | Extension::VK_KHR_multiview
282 | Extension::VK_KHR_relaxed_block_layout
283 | Extension::VK_KHR_shader_draw_parameters
284 | Extension::VK_KHR_variable_pointers
285 | Extension::VK_KHR_swapchain => ExtensionScope::Device,
286 #[cfg(target_os = "linux")]
287 Extension::VK_KHR_xcb_surface => ExtensionScope::Instance,
292 impl FromStr for Extension {
294 fn from_str(s: &str) -> Result<Self, Self::Err> {
295 for (i, _) in Extensions::default().iter() {
296 if s == i.get_name() {
304 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
305 pub struct Extensions(EnumMap<Extension, bool>);
308 pub fn create_empty() -> Self {
309 Extensions(enum_map! {_ => false})
311 pub fn is_empty(&self) -> bool {
312 self.iter().all(|(_, &v)| !v)
315 pub fn is_full(&self) -> bool {
316 self.iter().all(|(_, &v)| v)
318 pub fn get_allowed_extensions_from_instance_scope(&self) -> Self {
319 let mut retval = Extensions::default();
320 let instance_extensions = Self::instance_extensions();
321 for (extension, value) in retval.iter_mut() {
322 if extension.get_scope() == ExtensionScope::Instance {
323 *value = self[extension];
326 let required_extensions =
327 instance_extensions & extension.get_recursively_required_extensions();
328 *value = (!*self & required_extensions).is_empty();
332 pub fn instance_extensions() -> Self {
334 (|extension: Extension| extension.get_scope() == ExtensionScope::Instance).into(),
338 pub fn device_extensions() -> Self {
339 !Self::instance_extensions()
343 impl FromIterator<Extension> for Extensions {
344 fn from_iter<T: IntoIterator<Item = Extension>>(v: T) -> Extensions {
345 let mut retval = Extensions::create_empty();
347 retval[extension] = true;
353 impl Default for Extensions {
354 fn default() -> Self {
359 impl Deref for Extensions {
360 type Target = EnumMap<Extension, bool>;
361 fn deref(&self) -> &Self::Target {
366 impl DerefMut for Extensions {
367 fn deref_mut(&mut self) -> &mut Self::Target {
372 impl BitAnd for Extensions {
374 fn bitand(self, rhs: Self) -> Self {
375 let mut retval = Self::default();
376 for (index, retval) in retval.iter_mut() {
377 *retval = self[index] & rhs[index];
383 impl BitOr for Extensions {
385 fn bitor(self, rhs: Self) -> Self {
386 let mut retval = Self::default();
387 for (index, retval) in retval.iter_mut() {
388 *retval = self[index] | rhs[index];
394 impl BitXor for Extensions {
396 fn bitxor(self, rhs: Self) -> Self {
397 let mut retval = Self::default();
398 for (index, retval) in retval.iter_mut() {
399 *retval = self[index] ^ rhs[index];
405 impl Not for Extensions {
407 fn not(mut self) -> Self {
408 for v in self.values_mut() {
415 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
416 enum GetProcAddressScope {
422 #[cfg_attr(feature = "cargo-clippy", allow(clippy::cyclomatic_complexity))]
425 scope: GetProcAddressScope,
426 extensions: &Extensions,
427 ) -> api::PFN_vkVoidFunction {
428 let mut name = unsafe { CStr::from_ptr(name) }.to_str().ok()?;
430 use std::mem::transmute;
437 global: scope != GetProcAddressScope::Device,
438 instance: scope == GetProcAddressScope::Instance,
439 device: scope != GetProcAddressScope::Global,
441 macro_rules! proc_alias_khr {
442 ($base_name:ident, $required_extension:expr) => {
443 if name == concat!(stringify!($base_name), "KHR") {
444 if scope.instance && $required_extension {
445 name = stringify!($base_name);
454 extensions[Extension::VK_KHR_bind_memory2]
458 extensions[Extension::VK_KHR_bind_memory2]
462 extensions[Extension::VK_KHR_device_group]
466 extensions[Extension::VK_KHR_device_group]
469 vkCreateDescriptorUpdateTemplate,
470 extensions[Extension::VK_KHR_descriptor_update_template]
473 vkCreateSamplerYcbcrConversion,
474 extensions[Extension::VK_KHR_sampler_ycbcr_conversion]
477 vkDestroyDescriptorUpdateTemplate,
478 extensions[Extension::VK_KHR_descriptor_update_template]
481 vkDestroySamplerYcbcrConversion,
482 extensions[Extension::VK_KHR_sampler_ycbcr_conversion]
485 vkEnumeratePhysicalDeviceGroups,
486 extensions[Extension::VK_KHR_device_group_creation]
489 vkGetBufferMemoryRequirements2,
490 extensions[Extension::VK_KHR_get_memory_requirements2]
493 vkGetDescriptorSetLayoutSupport,
494 extensions[Extension::VK_KHR_maintenance3]
497 vkGetDeviceGroupPeerMemoryFeatures,
498 extensions[Extension::VK_KHR_device_group]
501 vkGetImageMemoryRequirements2,
502 extensions[Extension::VK_KHR_get_memory_requirements2]
505 vkGetImageSparseMemoryRequirements2,
506 extensions[Extension::VK_KHR_get_memory_requirements2]
509 vkGetPhysicalDeviceExternalBufferProperties,
510 extensions[Extension::VK_KHR_external_memory_capabilities]
513 vkGetPhysicalDeviceExternalFenceProperties,
514 extensions[Extension::VK_KHR_external_fence_capabilities]
517 vkGetPhysicalDeviceExternalSemaphoreProperties,
518 extensions[Extension::VK_KHR_external_semaphore_capabilities]
521 vkGetPhysicalDeviceFeatures2,
522 extensions[Extension::VK_KHR_get_physical_device_properties2]
525 vkGetPhysicalDeviceFormatProperties2,
526 extensions[Extension::VK_KHR_get_physical_device_properties2]
529 vkGetPhysicalDeviceImageFormatProperties2,
530 extensions[Extension::VK_KHR_get_physical_device_properties2]
533 vkGetPhysicalDeviceMemoryProperties2,
534 extensions[Extension::VK_KHR_get_physical_device_properties2]
537 vkGetPhysicalDeviceProperties2,
538 extensions[Extension::VK_KHR_get_physical_device_properties2]
541 vkGetPhysicalDeviceQueueFamilyProperties2,
542 extensions[Extension::VK_KHR_get_physical_device_properties2]
545 vkGetPhysicalDeviceSparseImageFormatProperties2,
546 extensions[Extension::VK_KHR_get_physical_device_properties2]
550 extensions[Extension::VK_KHR_maintenance1]
553 vkUpdateDescriptorSetWithTemplate,
554 extensions[Extension::VK_KHR_descriptor_update_template]
556 macro_rules! proc_address {
557 ($name:ident, $pfn_name:ident, $required_scope:ident, $required_extension:expr) => {
558 if stringify!($name) == name {
559 if scope.$required_scope && $required_extension {
560 let f: $pfn_name = Some($name);
561 return unsafe { transmute(f) };
568 #[cfg_attr(rustfmt, rustfmt_skip)]
570 proc_address!(vkCreateInstance, PFN_vkCreateInstance, global, true);
571 proc_address!(vkEnumerateInstanceExtensionProperties, PFN_vkEnumerateInstanceExtensionProperties, global, true);
572 proc_address!(vkEnumerateInstanceLayerProperties, PFN_vkEnumerateInstanceLayerProperties, global, true);
573 proc_address!(vkEnumerateInstanceVersion, PFN_vkEnumerateInstanceVersion, global, true);
575 proc_address!(vkAllocateCommandBuffers, PFN_vkAllocateCommandBuffers, device, true);
576 proc_address!(vkAllocateDescriptorSets, PFN_vkAllocateDescriptorSets, device, true);
577 proc_address!(vkAllocateMemory, PFN_vkAllocateMemory, device, true);
578 proc_address!(vkBeginCommandBuffer, PFN_vkBeginCommandBuffer, device, true);
579 proc_address!(vkBindBufferMemory, PFN_vkBindBufferMemory, device, true);
580 proc_address!(vkBindBufferMemory2, PFN_vkBindBufferMemory2, device, true);
581 proc_address!(vkBindImageMemory, PFN_vkBindImageMemory, device, true);
582 proc_address!(vkBindImageMemory2, PFN_vkBindImageMemory2, device, true);
583 proc_address!(vkCmdBeginQuery, PFN_vkCmdBeginQuery, device, true);
584 proc_address!(vkCmdBeginRenderPass, PFN_vkCmdBeginRenderPass, device, true);
585 proc_address!(vkCmdBindDescriptorSets, PFN_vkCmdBindDescriptorSets, device, true);
586 proc_address!(vkCmdBindIndexBuffer, PFN_vkCmdBindIndexBuffer, device, true);
587 proc_address!(vkCmdBindPipeline, PFN_vkCmdBindPipeline, device, true);
588 proc_address!(vkCmdBindVertexBuffers, PFN_vkCmdBindVertexBuffers, device, true);
589 proc_address!(vkCmdBlitImage, PFN_vkCmdBlitImage, device, true);
590 proc_address!(vkCmdClearAttachments, PFN_vkCmdClearAttachments, device, true);
591 proc_address!(vkCmdClearColorImage, PFN_vkCmdClearColorImage, device, true);
592 proc_address!(vkCmdClearDepthStencilImage, PFN_vkCmdClearDepthStencilImage, device, true);
593 proc_address!(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer, device, true);
594 proc_address!(vkCmdCopyBufferToImage, PFN_vkCmdCopyBufferToImage, device, true);
595 proc_address!(vkCmdCopyImage, PFN_vkCmdCopyImage, device, true);
596 proc_address!(vkCmdCopyImageToBuffer, PFN_vkCmdCopyImageToBuffer, device, true);
597 proc_address!(vkCmdCopyQueryPoolResults, PFN_vkCmdCopyQueryPoolResults, device, true);
598 proc_address!(vkCmdDispatch, PFN_vkCmdDispatch, device, true);
599 proc_address!(vkCmdDispatchBase, PFN_vkCmdDispatchBase, device, true);
600 proc_address!(vkCmdDispatchIndirect, PFN_vkCmdDispatchIndirect, device, true);
601 proc_address!(vkCmdDraw, PFN_vkCmdDraw, device, true);
602 proc_address!(vkCmdDrawIndexed, PFN_vkCmdDrawIndexed, device, true);
603 proc_address!(vkCmdDrawIndexedIndirect, PFN_vkCmdDrawIndexedIndirect, device, true);
604 proc_address!(vkCmdDrawIndirect, PFN_vkCmdDrawIndirect, device, true);
605 proc_address!(vkCmdEndQuery, PFN_vkCmdEndQuery, device, true);
606 proc_address!(vkCmdEndRenderPass, PFN_vkCmdEndRenderPass, device, true);
607 proc_address!(vkCmdExecuteCommands, PFN_vkCmdExecuteCommands, device, true);
608 proc_address!(vkCmdFillBuffer, PFN_vkCmdFillBuffer, device, true);
609 proc_address!(vkCmdNextSubpass, PFN_vkCmdNextSubpass, device, true);
610 proc_address!(vkCmdPipelineBarrier, PFN_vkCmdPipelineBarrier, device, true);
611 proc_address!(vkCmdPushConstants, PFN_vkCmdPushConstants, device, true);
612 proc_address!(vkCmdResetEvent, PFN_vkCmdResetEvent, device, true);
613 proc_address!(vkCmdResetQueryPool, PFN_vkCmdResetQueryPool, device, true);
614 proc_address!(vkCmdResolveImage, PFN_vkCmdResolveImage, device, true);
615 proc_address!(vkCmdSetBlendConstants, PFN_vkCmdSetBlendConstants, device, true);
616 proc_address!(vkCmdSetDepthBias, PFN_vkCmdSetDepthBias, device, true);
617 proc_address!(vkCmdSetDepthBounds, PFN_vkCmdSetDepthBounds, device, true);
618 proc_address!(vkCmdSetDeviceMask, PFN_vkCmdSetDeviceMask, device, true);
619 proc_address!(vkCmdSetEvent, PFN_vkCmdSetEvent, device, true);
620 proc_address!(vkCmdSetLineWidth, PFN_vkCmdSetLineWidth, device, true);
621 proc_address!(vkCmdSetScissor, PFN_vkCmdSetScissor, device, true);
622 proc_address!(vkCmdSetStencilCompareMask, PFN_vkCmdSetStencilCompareMask, device, true);
623 proc_address!(vkCmdSetStencilReference, PFN_vkCmdSetStencilReference, device, true);
624 proc_address!(vkCmdSetStencilWriteMask, PFN_vkCmdSetStencilWriteMask, device, true);
625 proc_address!(vkCmdSetViewport, PFN_vkCmdSetViewport, device, true);
626 proc_address!(vkCmdUpdateBuffer, PFN_vkCmdUpdateBuffer, device, true);
627 proc_address!(vkCmdWaitEvents, PFN_vkCmdWaitEvents, device, true);
628 proc_address!(vkCmdWriteTimestamp, PFN_vkCmdWriteTimestamp, device, true);
629 proc_address!(vkCreateBuffer, PFN_vkCreateBuffer, device, true);
630 proc_address!(vkCreateBufferView, PFN_vkCreateBufferView, device, true);
631 proc_address!(vkCreateCommandPool, PFN_vkCreateCommandPool, device, true);
632 proc_address!(vkCreateComputePipelines, PFN_vkCreateComputePipelines, device, true);
633 proc_address!(vkCreateDescriptorPool, PFN_vkCreateDescriptorPool, device, true);
634 proc_address!(vkCreateDescriptorSetLayout, PFN_vkCreateDescriptorSetLayout, device, true);
635 proc_address!(vkCreateDescriptorUpdateTemplate, PFN_vkCreateDescriptorUpdateTemplate, device, true);
636 proc_address!(vkCreateDevice, PFN_vkCreateDevice, instance, true);
637 proc_address!(vkCreateEvent, PFN_vkCreateEvent, device, true);
638 proc_address!(vkCreateFence, PFN_vkCreateFence, device, true);
639 proc_address!(vkCreateFramebuffer, PFN_vkCreateFramebuffer, device, true);
640 proc_address!(vkCreateGraphicsPipelines, PFN_vkCreateGraphicsPipelines, device, true);
641 proc_address!(vkCreateImage, PFN_vkCreateImage, device, true);
642 proc_address!(vkCreateImageView, PFN_vkCreateImageView, device, true);
643 proc_address!(vkCreatePipelineCache, PFN_vkCreatePipelineCache, device, true);
644 proc_address!(vkCreatePipelineLayout, PFN_vkCreatePipelineLayout, device, true);
645 proc_address!(vkCreateQueryPool, PFN_vkCreateQueryPool, device, true);
646 proc_address!(vkCreateRenderPass, PFN_vkCreateRenderPass, device, true);
647 proc_address!(vkCreateSampler, PFN_vkCreateSampler, device, true);
648 proc_address!(vkCreateSamplerYcbcrConversion, PFN_vkCreateSamplerYcbcrConversion, device, true);
649 proc_address!(vkCreateSemaphore, PFN_vkCreateSemaphore, device, true);
650 proc_address!(vkCreateShaderModule, PFN_vkCreateShaderModule, device, true);
651 proc_address!(vkDestroyBuffer, PFN_vkDestroyBuffer, device, true);
652 proc_address!(vkDestroyBufferView, PFN_vkDestroyBufferView, device, true);
653 proc_address!(vkDestroyCommandPool, PFN_vkDestroyCommandPool, device, true);
654 proc_address!(vkDestroyDescriptorPool, PFN_vkDestroyDescriptorPool, device, true);
655 proc_address!(vkDestroyDescriptorSetLayout, PFN_vkDestroyDescriptorSetLayout, device, true);
656 proc_address!(vkDestroyDescriptorUpdateTemplate, PFN_vkDestroyDescriptorUpdateTemplate, device, true);
657 proc_address!(vkDestroyDevice, PFN_vkDestroyDevice, device, true);
658 proc_address!(vkDestroyEvent, PFN_vkDestroyEvent, device, true);
659 proc_address!(vkDestroyFence, PFN_vkDestroyFence, device, true);
660 proc_address!(vkDestroyFramebuffer, PFN_vkDestroyFramebuffer, device, true);
661 proc_address!(vkDestroyImage, PFN_vkDestroyImage, device, true);
662 proc_address!(vkDestroyImageView, PFN_vkDestroyImageView, device, true);
663 proc_address!(vkDestroyInstance, PFN_vkDestroyInstance, instance, true);
664 proc_address!(vkDestroyPipeline, PFN_vkDestroyPipeline, device, true);
665 proc_address!(vkDestroyPipelineCache, PFN_vkDestroyPipelineCache, device, true);
666 proc_address!(vkDestroyPipelineLayout, PFN_vkDestroyPipelineLayout, device, true);
667 proc_address!(vkDestroyQueryPool, PFN_vkDestroyQueryPool, device, true);
668 proc_address!(vkDestroyRenderPass, PFN_vkDestroyRenderPass, device, true);
669 proc_address!(vkDestroySampler, PFN_vkDestroySampler, device, true);
670 proc_address!(vkDestroySamplerYcbcrConversion, PFN_vkDestroySamplerYcbcrConversion, device, true);
671 proc_address!(vkDestroySemaphore, PFN_vkDestroySemaphore, device, true);
672 proc_address!(vkDestroyShaderModule, PFN_vkDestroyShaderModule, device, true);
673 proc_address!(vkDeviceWaitIdle, PFN_vkDeviceWaitIdle, device, true);
674 proc_address!(vkEndCommandBuffer, PFN_vkEndCommandBuffer, device, true);
675 proc_address!(vkEnumerateDeviceExtensionProperties, PFN_vkEnumerateDeviceExtensionProperties, instance, true);
676 proc_address!(vkEnumerateDeviceLayerProperties, PFN_vkEnumerateDeviceLayerProperties, instance, true);
677 proc_address!(vkEnumeratePhysicalDeviceGroups, PFN_vkEnumeratePhysicalDeviceGroups, instance, true);
678 proc_address!(vkEnumeratePhysicalDevices, PFN_vkEnumeratePhysicalDevices, instance, true);
679 proc_address!(vkFlushMappedMemoryRanges, PFN_vkFlushMappedMemoryRanges, device, true);
680 proc_address!(vkFreeCommandBuffers, PFN_vkFreeCommandBuffers, device, true);
681 proc_address!(vkFreeDescriptorSets, PFN_vkFreeDescriptorSets, device, true);
682 proc_address!(vkFreeMemory, PFN_vkFreeMemory, device, true);
683 proc_address!(vkGetBufferMemoryRequirements, PFN_vkGetBufferMemoryRequirements, device, true);
684 proc_address!(vkGetBufferMemoryRequirements2, PFN_vkGetBufferMemoryRequirements2, device, true);
685 proc_address!(vkGetDescriptorSetLayoutSupport, PFN_vkGetDescriptorSetLayoutSupport, device, true);
686 proc_address!(vkGetDeviceGroupPeerMemoryFeatures, PFN_vkGetDeviceGroupPeerMemoryFeatures, device, true);
687 proc_address!(vkGetDeviceMemoryCommitment, PFN_vkGetDeviceMemoryCommitment, device, true);
688 proc_address!(vkGetDeviceProcAddr, PFN_vkGetDeviceProcAddr, device, true);
689 proc_address!(vkGetDeviceQueue, PFN_vkGetDeviceQueue, device, true);
690 proc_address!(vkGetDeviceQueue2, PFN_vkGetDeviceQueue2, device, true);
691 proc_address!(vkGetEventStatus, PFN_vkGetEventStatus, device, true);
692 proc_address!(vkGetFenceStatus, PFN_vkGetFenceStatus, device, true);
693 proc_address!(vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements, device, true);
694 proc_address!(vkGetImageMemoryRequirements2, PFN_vkGetImageMemoryRequirements2, device, true);
695 proc_address!(vkGetImageSparseMemoryRequirements, PFN_vkGetImageSparseMemoryRequirements, device, true);
696 proc_address!(vkGetImageSparseMemoryRequirements2, PFN_vkGetImageSparseMemoryRequirements2, device, true);
697 proc_address!(vkGetImageSubresourceLayout, PFN_vkGetImageSubresourceLayout, device, true);
698 proc_address!(vkGetInstanceProcAddr, PFN_vkGetInstanceProcAddr, device, true);
699 proc_address!(vkGetPhysicalDeviceExternalBufferProperties, PFN_vkGetPhysicalDeviceExternalBufferProperties, instance, true);
700 proc_address!(vkGetPhysicalDeviceExternalFenceProperties, PFN_vkGetPhysicalDeviceExternalFenceProperties, instance, true);
701 proc_address!(vkGetPhysicalDeviceExternalSemaphoreProperties, PFN_vkGetPhysicalDeviceExternalSemaphoreProperties, instance, true);
702 proc_address!(vkGetPhysicalDeviceFeatures, PFN_vkGetPhysicalDeviceFeatures, instance, true);
703 proc_address!(vkGetPhysicalDeviceFeatures2, PFN_vkGetPhysicalDeviceFeatures2, instance, true);
704 proc_address!(vkGetPhysicalDeviceFormatProperties, PFN_vkGetPhysicalDeviceFormatProperties, instance, true);
705 proc_address!(vkGetPhysicalDeviceFormatProperties2, PFN_vkGetPhysicalDeviceFormatProperties2, instance, true);
706 proc_address!(vkGetPhysicalDeviceImageFormatProperties, PFN_vkGetPhysicalDeviceImageFormatProperties, instance, true);
707 proc_address!(vkGetPhysicalDeviceImageFormatProperties2, PFN_vkGetPhysicalDeviceImageFormatProperties2, instance, true);
708 proc_address!(vkGetPhysicalDeviceMemoryProperties, PFN_vkGetPhysicalDeviceMemoryProperties, instance, true);
709 proc_address!(vkGetPhysicalDeviceMemoryProperties2, PFN_vkGetPhysicalDeviceMemoryProperties2, instance, true);
710 proc_address!(vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties, instance, true);
711 proc_address!(vkGetPhysicalDeviceProperties2, PFN_vkGetPhysicalDeviceProperties2, instance, true);
712 proc_address!(vkGetPhysicalDeviceQueueFamilyProperties, PFN_vkGetPhysicalDeviceQueueFamilyProperties, instance, true);
713 proc_address!(vkGetPhysicalDeviceQueueFamilyProperties2, PFN_vkGetPhysicalDeviceQueueFamilyProperties2, instance, true);
714 proc_address!(vkGetPhysicalDeviceSparseImageFormatProperties, PFN_vkGetPhysicalDeviceSparseImageFormatProperties, instance, true);
715 proc_address!(vkGetPhysicalDeviceSparseImageFormatProperties2, PFN_vkGetPhysicalDeviceSparseImageFormatProperties2, instance, true);
716 proc_address!(vkGetPipelineCacheData, PFN_vkGetPipelineCacheData, device, true);
717 proc_address!(vkGetQueryPoolResults, PFN_vkGetQueryPoolResults, device, true);
718 proc_address!(vkGetRenderAreaGranularity, PFN_vkGetRenderAreaGranularity, device, true);
719 proc_address!(vkInvalidateMappedMemoryRanges, PFN_vkInvalidateMappedMemoryRanges, device, true);
720 proc_address!(vkMapMemory, PFN_vkMapMemory, device, true);
721 proc_address!(vkMergePipelineCaches, PFN_vkMergePipelineCaches, device, true);
722 proc_address!(vkQueueBindSparse, PFN_vkQueueBindSparse, device, true);
723 proc_address!(vkQueueSubmit, PFN_vkQueueSubmit, device, true);
724 proc_address!(vkQueueWaitIdle, PFN_vkQueueWaitIdle, device, true);
725 proc_address!(vkResetCommandBuffer, PFN_vkResetCommandBuffer, device, true);
726 proc_address!(vkResetCommandPool, PFN_vkResetCommandPool, device, true);
727 proc_address!(vkResetDescriptorPool, PFN_vkResetDescriptorPool, device, true);
728 proc_address!(vkResetEvent, PFN_vkResetEvent, device, true);
729 proc_address!(vkResetFences, PFN_vkResetFences, device, true);
730 proc_address!(vkSetEvent, PFN_vkSetEvent, device, true);
731 proc_address!(vkTrimCommandPool, PFN_vkTrimCommandPool, device, true);
732 proc_address!(vkUnmapMemory, PFN_vkUnmapMemory, device, true);
733 proc_address!(vkUpdateDescriptorSets, PFN_vkUpdateDescriptorSets, device, true);
734 proc_address!(vkUpdateDescriptorSetWithTemplate, PFN_vkUpdateDescriptorSetWithTemplate, device, true);
735 proc_address!(vkWaitForFences, PFN_vkWaitForFences, device, true);
737 proc_address!(vkDestroySurfaceKHR, PFN_vkDestroySurfaceKHR, device, extensions[Extension::VK_KHR_surface]);
738 proc_address!(vkGetPhysicalDeviceSurfaceSupportKHR, PFN_vkGetPhysicalDeviceSurfaceSupportKHR, device, extensions[Extension::VK_KHR_surface]);
739 proc_address!(vkGetPhysicalDeviceSurfaceCapabilitiesKHR, PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, device, extensions[Extension::VK_KHR_surface]);
740 proc_address!(vkGetPhysicalDeviceSurfaceFormatsKHR, PFN_vkGetPhysicalDeviceSurfaceFormatsKHR, device, extensions[Extension::VK_KHR_surface]);
741 proc_address!(vkGetPhysicalDeviceSurfacePresentModesKHR, PFN_vkGetPhysicalDeviceSurfacePresentModesKHR, device, extensions[Extension::VK_KHR_surface]);
743 proc_address!(vkCreateSwapchainKHR, PFN_vkCreateSwapchainKHR, device, extensions[Extension::VK_KHR_swapchain]);
744 proc_address!(vkDestroySwapchainKHR, PFN_vkDestroySwapchainKHR, device, extensions[Extension::VK_KHR_swapchain]);
745 proc_address!(vkGetSwapchainImagesKHR, PFN_vkGetSwapchainImagesKHR, device, extensions[Extension::VK_KHR_swapchain]);
746 proc_address!(vkAcquireNextImageKHR, PFN_vkAcquireNextImageKHR, device, extensions[Extension::VK_KHR_swapchain]);
747 proc_address!(vkQueuePresentKHR, PFN_vkQueuePresentKHR, device, extensions[Extension::VK_KHR_swapchain]);
748 proc_address!(vkGetDeviceGroupPresentCapabilitiesKHR, PFN_vkGetDeviceGroupPresentCapabilitiesKHR, device, extensions[Extension::VK_KHR_swapchain]);
749 proc_address!(vkGetDeviceGroupSurfacePresentModesKHR, PFN_vkGetDeviceGroupSurfacePresentModesKHR, device, extensions[Extension::VK_KHR_swapchain]);
750 proc_address!(vkGetPhysicalDevicePresentRectanglesKHR, PFN_vkGetPhysicalDevicePresentRectanglesKHR, device, extensions[Extension::VK_KHR_swapchain]);
751 proc_address!(vkAcquireNextImage2KHR, PFN_vkAcquireNextImage2KHR, device, extensions[Extension::VK_KHR_swapchain]);
753 #[cfg(target_os = "linux")]
754 proc_address!(vkCreateXcbSurfaceKHR, PFN_vkCreateXcbSurfaceKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
755 #[cfg(target_os = "linux")]
756 proc_address!(vkGetPhysicalDeviceXcbPresentationSupportKHR, PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
758 proc_address!(vkCmdBeginConditionalRenderingEXT, PFN_vkCmdBeginConditionalRenderingEXT, device, unknown);
759 proc_address!(vkCmdBeginDebugUtilsLabelEXT, PFN_vkCmdBeginDebugUtilsLabelEXT, device, unknown);
760 proc_address!(vkCmdBeginRenderPass2KHR, PFN_vkCmdBeginRenderPass2KHR, device, unknown);
761 proc_address!(vkCmdBindShadingRateImageNV, PFN_vkCmdBindShadingRateImageNV, device, unknown);
762 proc_address!(vkCmdDebugMarkerBeginEXT, PFN_vkCmdDebugMarkerBeginEXT, device, unknown);
763 proc_address!(vkCmdDebugMarkerEndEXT, PFN_vkCmdDebugMarkerEndEXT, device, unknown);
764 proc_address!(vkCmdDebugMarkerInsertEXT, PFN_vkCmdDebugMarkerInsertEXT, device, unknown);
765 proc_address!(vkCmdDrawIndexedIndirectCountAMD, PFN_vkCmdDrawIndexedIndirectCountAMD, device, unknown);
766 proc_address!(vkCmdDrawIndexedIndirectCountKHR, PFN_vkCmdDrawIndexedIndirectCountKHR, device, unknown);
767 proc_address!(vkCmdDrawIndirectCountAMD, PFN_vkCmdDrawIndirectCountAMD, device, unknown);
768 proc_address!(vkCmdDrawIndirectCountKHR, PFN_vkCmdDrawIndirectCountKHR, device, unknown);
769 proc_address!(vkCmdDrawMeshTasksIndirectCountNV, PFN_vkCmdDrawMeshTasksIndirectCountNV, device, unknown);
770 proc_address!(vkCmdDrawMeshTasksIndirectNV, PFN_vkCmdDrawMeshTasksIndirectNV, device, unknown);
771 proc_address!(vkCmdDrawMeshTasksNV, PFN_vkCmdDrawMeshTasksNV, device, unknown);
772 proc_address!(vkCmdEndConditionalRenderingEXT, PFN_vkCmdEndConditionalRenderingEXT, device, unknown);
773 proc_address!(vkCmdEndDebugUtilsLabelEXT, PFN_vkCmdEndDebugUtilsLabelEXT, device, unknown);
774 proc_address!(vkCmdEndRenderPass2KHR, PFN_vkCmdEndRenderPass2KHR, device, unknown);
775 proc_address!(vkCmdInsertDebugUtilsLabelEXT, PFN_vkCmdInsertDebugUtilsLabelEXT, device, unknown);
776 proc_address!(vkCmdNextSubpass2KHR, PFN_vkCmdNextSubpass2KHR, device, unknown);
777 proc_address!(vkCmdPushDescriptorSetKHR, PFN_vkCmdPushDescriptorSetKHR, device, unknown);
778 proc_address!(vkCmdPushDescriptorSetWithTemplateKHR, PFN_vkCmdPushDescriptorSetWithTemplateKHR, device, unknown);
779 proc_address!(vkCmdSetCheckpointNV, PFN_vkCmdSetCheckpointNV, device, unknown);
780 proc_address!(vkCmdSetCoarseSampleOrderNV, PFN_vkCmdSetCoarseSampleOrderNV, device, unknown);
781 proc_address!(vkCmdSetDiscardRectangleEXT, PFN_vkCmdSetDiscardRectangleEXT, device, unknown);
782 proc_address!(vkCmdSetExclusiveScissorNV, PFN_vkCmdSetExclusiveScissorNV, device, unknown);
783 proc_address!(vkCmdSetSampleLocationsEXT, PFN_vkCmdSetSampleLocationsEXT, device, unknown);
784 proc_address!(vkCmdSetViewportShadingRatePaletteNV, PFN_vkCmdSetViewportShadingRatePaletteNV, device, unknown);
785 proc_address!(vkCmdSetViewportWScalingNV, PFN_vkCmdSetViewportWScalingNV, device, unknown);
786 proc_address!(vkCmdWriteBufferMarkerAMD, PFN_vkCmdWriteBufferMarkerAMD, device, unknown);
787 proc_address!(vkCreateDebugReportCallbackEXT, PFN_vkCreateDebugReportCallbackEXT, device, unknown);
788 proc_address!(vkCreateDebugUtilsMessengerEXT, PFN_vkCreateDebugUtilsMessengerEXT, device, unknown);
789 proc_address!(vkCreateDisplayModeKHR, PFN_vkCreateDisplayModeKHR, device, unknown);
790 proc_address!(vkCreateDisplayPlaneSurfaceKHR, PFN_vkCreateDisplayPlaneSurfaceKHR, device, unknown);
791 proc_address!(vkCreateRenderPass2KHR, PFN_vkCreateRenderPass2KHR, device, unknown);
792 proc_address!(vkCreateSharedSwapchainsKHR, PFN_vkCreateSharedSwapchainsKHR, device, unknown);
793 proc_address!(vkCreateValidationCacheEXT, PFN_vkCreateValidationCacheEXT, device, unknown);
794 proc_address!(vkDebugMarkerSetObjectNameEXT, PFN_vkDebugMarkerSetObjectNameEXT, device, unknown);
795 proc_address!(vkDebugMarkerSetObjectTagEXT, PFN_vkDebugMarkerSetObjectTagEXT, device, unknown);
796 proc_address!(vkDebugReportCallbackEXT, PFN_vkDebugReportCallbackEXT, device, unknown);
797 proc_address!(vkDebugReportMessageEXT, PFN_vkDebugReportMessageEXT, device, unknown);
798 proc_address!(vkDebugUtilsMessengerCallbackEXT, PFN_vkDebugUtilsMessengerCallbackEXT, device, unknown);
799 proc_address!(vkDestroyDebugReportCallbackEXT, PFN_vkDestroyDebugReportCallbackEXT, device, unknown);
800 proc_address!(vkDestroyDebugUtilsMessengerEXT, PFN_vkDestroyDebugUtilsMessengerEXT, device, unknown);
801 proc_address!(vkDestroyValidationCacheEXT, PFN_vkDestroyValidationCacheEXT, device, unknown);
802 proc_address!(vkDisplayPowerControlEXT, PFN_vkDisplayPowerControlEXT, device, unknown);
803 proc_address!(vkGetDisplayModeProperties2KHR, PFN_vkGetDisplayModeProperties2KHR, device, unknown);
804 proc_address!(vkGetDisplayModePropertiesKHR, PFN_vkGetDisplayModePropertiesKHR, device, unknown);
805 proc_address!(vkGetDisplayPlaneCapabilities2KHR, PFN_vkGetDisplayPlaneCapabilities2KHR, device, unknown);
806 proc_address!(vkGetDisplayPlaneCapabilitiesKHR, PFN_vkGetDisplayPlaneCapabilitiesKHR, device, unknown);
807 proc_address!(vkGetDisplayPlaneSupportedDisplaysKHR, PFN_vkGetDisplayPlaneSupportedDisplaysKHR, device, unknown);
808 proc_address!(vkGetFenceFdKHR, PFN_vkGetFenceFdKHR, device, unknown);
809 proc_address!(vkGetMemoryFdKHR, PFN_vkGetMemoryFdKHR, device, unknown);
810 proc_address!(vkGetMemoryFdPropertiesKHR, PFN_vkGetMemoryFdPropertiesKHR, device, unknown);
811 proc_address!(vkGetMemoryHostPointerPropertiesEXT, PFN_vkGetMemoryHostPointerPropertiesEXT, device, unknown);
812 proc_address!(vkGetPastPresentationTimingGOOGLE, PFN_vkGetPastPresentationTimingGOOGLE, device, unknown);
813 proc_address!(vkGetPhysicalDeviceDisplayPlaneProperties2KHR, PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, device, unknown);
814 proc_address!(vkGetPhysicalDeviceDisplayPlanePropertiesKHR, PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, device, unknown);
815 proc_address!(vkGetPhysicalDeviceDisplayProperties2KHR, PFN_vkGetPhysicalDeviceDisplayProperties2KHR, device, unknown);
816 proc_address!(vkGetPhysicalDeviceDisplayPropertiesKHR, PFN_vkGetPhysicalDeviceDisplayPropertiesKHR, device, unknown);
817 proc_address!(vkGetPhysicalDeviceExternalImageFormatPropertiesNV, PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, device, unknown);
818 proc_address!(vkGetPhysicalDeviceMultisamplePropertiesEXT, PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT, device, unknown);
819 proc_address!(vkGetPhysicalDeviceSurfaceCapabilities2EXT, PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT, device, unknown);
820 proc_address!(vkGetPhysicalDeviceSurfaceCapabilities2KHR, PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR, device, unknown);
821 proc_address!(vkGetPhysicalDeviceSurfaceFormats2KHR, PFN_vkGetPhysicalDeviceSurfaceFormats2KHR, device, unknown);
822 proc_address!(vkGetQueueCheckpointDataNV, PFN_vkGetQueueCheckpointDataNV, device, unknown);
823 proc_address!(vkGetRefreshCycleDurationGOOGLE, PFN_vkGetRefreshCycleDurationGOOGLE, device, unknown);
824 proc_address!(vkGetSemaphoreFdKHR, PFN_vkGetSemaphoreFdKHR, device, unknown);
825 proc_address!(vkGetShaderInfoAMD, PFN_vkGetShaderInfoAMD, device, unknown);
826 proc_address!(vkGetSwapchainCounterEXT, PFN_vkGetSwapchainCounterEXT, device, unknown);
827 proc_address!(vkGetSwapchainStatusKHR, PFN_vkGetSwapchainStatusKHR, device, unknown);
828 proc_address!(vkGetValidationCacheDataEXT, PFN_vkGetValidationCacheDataEXT, device, unknown);
829 proc_address!(vkImportFenceFdKHR, PFN_vkImportFenceFdKHR, device, unknown);
830 proc_address!(vkImportSemaphoreFdKHR, PFN_vkImportSemaphoreFdKHR, device, unknown);
831 proc_address!(vkMergeValidationCachesEXT, PFN_vkMergeValidationCachesEXT, device, unknown);
832 proc_address!(vkQueueBeginDebugUtilsLabelEXT, PFN_vkQueueBeginDebugUtilsLabelEXT, device, unknown);
833 proc_address!(vkQueueEndDebugUtilsLabelEXT, PFN_vkQueueEndDebugUtilsLabelEXT, device, unknown);
834 proc_address!(vkQueueInsertDebugUtilsLabelEXT, PFN_vkQueueInsertDebugUtilsLabelEXT, device, unknown);
835 proc_address!(vkRegisterDeviceEventEXT, PFN_vkRegisterDeviceEventEXT, device, unknown);
836 proc_address!(vkRegisterDisplayEventEXT, PFN_vkRegisterDisplayEventEXT, device, unknown);
837 proc_address!(vkReleaseDisplayEXT, PFN_vkReleaseDisplayEXT, device, unknown);
838 proc_address!(vkSetDebugUtilsObjectNameEXT, PFN_vkSetDebugUtilsObjectNameEXT, device, unknown);
839 proc_address!(vkSetDebugUtilsObjectTagEXT, PFN_vkSetDebugUtilsObjectTagEXT, device, unknown);
840 proc_address!(vkSetHdrMetadataEXT, PFN_vkSetHdrMetadataEXT, device, unknown);
841 proc_address!(vkSubmitDebugUtilsMessageEXT, PFN_vkSubmitDebugUtilsMessageEXT, device, unknown);
844 //eprintln!("unknown function: {:?}", name);
848 #[derive(Debug, Copy, Clone)]
849 pub struct Features {
850 features: api::VkPhysicalDeviceFeatures,
851 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures,
852 sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures,
853 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures,
854 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures,
855 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures,
856 multiview_features: api::VkPhysicalDeviceMultiviewFeatures,
862 features: api::VkPhysicalDeviceFeatures {
863 robustBufferAccess: api::VK_TRUE,
864 fullDrawIndexUint32: api::VK_TRUE,
865 imageCubeArray: api::VK_TRUE,
866 independentBlend: api::VK_FALSE,
867 geometryShader: api::VK_FALSE,
868 tessellationShader: api::VK_FALSE,
869 sampleRateShading: api::VK_FALSE,
870 dualSrcBlend: api::VK_FALSE,
871 logicOp: api::VK_TRUE,
872 multiDrawIndirect: api::VK_TRUE,
873 drawIndirectFirstInstance: api::VK_TRUE,
874 depthClamp: api::VK_FALSE,
875 depthBiasClamp: api::VK_FALSE,
876 fillModeNonSolid: api::VK_TRUE,
877 depthBounds: api::VK_FALSE,
878 wideLines: api::VK_FALSE,
879 largePoints: api::VK_FALSE,
880 alphaToOne: api::VK_TRUE,
881 multiViewport: api::VK_TRUE,
882 samplerAnisotropy: api::VK_FALSE,
883 textureCompressionETC2: api::VK_FALSE, // FIXME: enable texture compression
884 textureCompressionASTC_LDR: api::VK_FALSE, // FIXME: enable texture compression
885 textureCompressionBC: api::VK_FALSE, // FIXME: enable texture compression
886 occlusionQueryPrecise: api::VK_FALSE,
887 pipelineStatisticsQuery: api::VK_FALSE,
888 vertexPipelineStoresAndAtomics: api::VK_TRUE,
889 fragmentStoresAndAtomics: api::VK_TRUE,
890 shaderTessellationAndGeometryPointSize: api::VK_FALSE,
891 shaderImageGatherExtended: api::VK_FALSE,
892 shaderStorageImageExtendedFormats: api::VK_FALSE,
893 shaderStorageImageMultisample: api::VK_FALSE,
894 shaderStorageImageReadWithoutFormat: api::VK_FALSE,
895 shaderStorageImageWriteWithoutFormat: api::VK_FALSE,
896 shaderUniformBufferArrayDynamicIndexing: api::VK_TRUE,
897 shaderSampledImageArrayDynamicIndexing: api::VK_TRUE,
898 shaderStorageBufferArrayDynamicIndexing: api::VK_TRUE,
899 shaderStorageImageArrayDynamicIndexing: api::VK_TRUE,
900 shaderClipDistance: api::VK_FALSE,
901 shaderCullDistance: api::VK_FALSE,
902 shaderFloat64: api::VK_TRUE,
903 shaderInt64: api::VK_TRUE,
904 shaderInt16: api::VK_TRUE,
905 shaderResourceResidency: api::VK_FALSE,
906 shaderResourceMinLod: api::VK_FALSE,
907 sparseBinding: api::VK_FALSE,
908 sparseResidencyBuffer: api::VK_FALSE,
909 sparseResidencyImage2D: api::VK_FALSE,
910 sparseResidencyImage3D: api::VK_FALSE,
911 sparseResidency2Samples: api::VK_FALSE,
912 sparseResidency4Samples: api::VK_FALSE,
913 sparseResidency8Samples: api::VK_FALSE,
914 sparseResidency16Samples: api::VK_FALSE,
915 sparseResidencyAliased: api::VK_FALSE,
916 variableMultisampleRate: api::VK_FALSE,
917 inheritedQueries: api::VK_FALSE,
919 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures {
920 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
922 storageBuffer16BitAccess: api::VK_TRUE,
923 uniformAndStorageBuffer16BitAccess: api::VK_TRUE,
924 storagePushConstant16: api::VK_TRUE,
925 storageInputOutput16: api::VK_TRUE,
927 sampler_ycbcr_conversion_features:
928 api::VkPhysicalDeviceSamplerYcbcrConversionFeatures {
929 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
931 samplerYcbcrConversion: api::VK_FALSE,
933 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures {
934 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
936 variablePointersStorageBuffer: api::VK_TRUE,
937 variablePointers: api::VK_TRUE,
939 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures {
940 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
942 shaderDrawParameters: api::VK_TRUE,
944 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures {
945 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
947 protectedMemory: api::VK_FALSE,
949 multiview_features: api::VkPhysicalDeviceMultiviewFeatures {
950 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
952 multiview: api::VK_FALSE,
953 multiviewGeometryShader: api::VK_FALSE,
954 multiviewTessellationShader: api::VK_FALSE,
958 fn splat(value: bool) -> Self {
959 let value32 = if value { api::VK_TRUE } else { api::VK_FALSE };
961 features: api::VkPhysicalDeviceFeatures {
962 robustBufferAccess: value32,
963 fullDrawIndexUint32: value32,
964 imageCubeArray: value32,
965 independentBlend: value32,
966 geometryShader: value32,
967 tessellationShader: value32,
968 sampleRateShading: value32,
969 dualSrcBlend: value32,
971 multiDrawIndirect: value32,
972 drawIndirectFirstInstance: value32,
974 depthBiasClamp: value32,
975 fillModeNonSolid: value32,
976 depthBounds: value32,
978 largePoints: value32,
980 multiViewport: value32,
981 samplerAnisotropy: value32,
982 textureCompressionETC2: value32,
983 textureCompressionASTC_LDR: value32,
984 textureCompressionBC: value32,
985 occlusionQueryPrecise: value32,
986 pipelineStatisticsQuery: value32,
987 vertexPipelineStoresAndAtomics: value32,
988 fragmentStoresAndAtomics: value32,
989 shaderTessellationAndGeometryPointSize: value32,
990 shaderImageGatherExtended: value32,
991 shaderStorageImageExtendedFormats: value32,
992 shaderStorageImageMultisample: value32,
993 shaderStorageImageReadWithoutFormat: value32,
994 shaderStorageImageWriteWithoutFormat: value32,
995 shaderUniformBufferArrayDynamicIndexing: value32,
996 shaderSampledImageArrayDynamicIndexing: value32,
997 shaderStorageBufferArrayDynamicIndexing: value32,
998 shaderStorageImageArrayDynamicIndexing: value32,
999 shaderClipDistance: value32,
1000 shaderCullDistance: value32,
1001 shaderFloat64: value32,
1002 shaderInt64: value32,
1003 shaderInt16: value32,
1004 shaderResourceResidency: value32,
1005 shaderResourceMinLod: value32,
1006 sparseBinding: value32,
1007 sparseResidencyBuffer: value32,
1008 sparseResidencyImage2D: value32,
1009 sparseResidencyImage3D: value32,
1010 sparseResidency2Samples: value32,
1011 sparseResidency4Samples: value32,
1012 sparseResidency8Samples: value32,
1013 sparseResidency16Samples: value32,
1014 sparseResidencyAliased: value32,
1015 variableMultisampleRate: value32,
1016 inheritedQueries: value32,
1018 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures {
1019 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
1021 storageBuffer16BitAccess: value32,
1022 uniformAndStorageBuffer16BitAccess: value32,
1023 storagePushConstant16: value32,
1024 storageInputOutput16: value32,
1026 sampler_ycbcr_conversion_features:
1027 api::VkPhysicalDeviceSamplerYcbcrConversionFeatures {
1028 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
1030 samplerYcbcrConversion: value32,
1032 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures {
1033 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
1035 variablePointersStorageBuffer: value32,
1036 variablePointers: value32,
1038 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures {
1039 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
1041 shaderDrawParameters: value32,
1043 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures {
1044 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
1046 protectedMemory: value32,
1048 multiview_features: api::VkPhysicalDeviceMultiviewFeatures {
1049 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
1052 multiviewGeometryShader: value32,
1053 multiviewTessellationShader: value32,
1057 fn visit2_mut<F: FnMut(&mut bool, &mut bool)>(&mut self, rhs: &mut Self, f: F) {
1058 struct VisitorStruct<F: FnMut(&mut bool, &mut bool)>(F);
1060 fn visit(&mut self, v1: &mut T, v2: &mut T);
1062 impl<F: FnMut(&mut bool, &mut bool)> Visitor<bool> for VisitorStruct<F> {
1063 fn visit(&mut self, v1: &mut bool, v2: &mut bool) {
1067 impl<F: FnMut(&mut bool, &mut bool)> Visitor<api::VkBool32> for VisitorStruct<F> {
1068 fn visit(&mut self, value1: &mut api::VkBool32, value2: &mut api::VkBool32) {
1069 let mut temp1 = *value1 != api::VK_FALSE;
1070 let mut temp2 = *value2 != api::VK_FALSE;
1071 (self.0)(&mut temp1, &mut temp2);
1072 *value1 = if temp1 { api::VK_TRUE } else { api::VK_FALSE };
1073 *value2 = if temp2 { api::VK_TRUE } else { api::VK_FALSE };
1076 let mut visitor = VisitorStruct(f);
1077 macro_rules! visit {
1078 ($member1:ident.$member2:ident) => {
1079 visitor.visit(&mut self.$member1.$member2, &mut rhs.$member1.$member2)
1081 ($member:ident) => {
1082 visitor.visit(&mut self.$member1, &mut rhs.$member1)
1085 visit!(features.robustBufferAccess);
1086 visit!(features.fullDrawIndexUint32);
1087 visit!(features.imageCubeArray);
1088 visit!(features.independentBlend);
1089 visit!(features.geometryShader);
1090 visit!(features.tessellationShader);
1091 visit!(features.sampleRateShading);
1092 visit!(features.dualSrcBlend);
1093 visit!(features.logicOp);
1094 visit!(features.multiDrawIndirect);
1095 visit!(features.drawIndirectFirstInstance);
1096 visit!(features.depthClamp);
1097 visit!(features.depthBiasClamp);
1098 visit!(features.fillModeNonSolid);
1099 visit!(features.depthBounds);
1100 visit!(features.wideLines);
1101 visit!(features.largePoints);
1102 visit!(features.alphaToOne);
1103 visit!(features.multiViewport);
1104 visit!(features.samplerAnisotropy);
1105 visit!(features.textureCompressionETC2);
1106 visit!(features.textureCompressionASTC_LDR);
1107 visit!(features.textureCompressionBC);
1108 visit!(features.occlusionQueryPrecise);
1109 visit!(features.pipelineStatisticsQuery);
1110 visit!(features.vertexPipelineStoresAndAtomics);
1111 visit!(features.fragmentStoresAndAtomics);
1112 visit!(features.shaderTessellationAndGeometryPointSize);
1113 visit!(features.shaderImageGatherExtended);
1114 visit!(features.shaderStorageImageExtendedFormats);
1115 visit!(features.shaderStorageImageMultisample);
1116 visit!(features.shaderStorageImageReadWithoutFormat);
1117 visit!(features.shaderStorageImageWriteWithoutFormat);
1118 visit!(features.shaderUniformBufferArrayDynamicIndexing);
1119 visit!(features.shaderSampledImageArrayDynamicIndexing);
1120 visit!(features.shaderStorageBufferArrayDynamicIndexing);
1121 visit!(features.shaderStorageImageArrayDynamicIndexing);
1122 visit!(features.shaderClipDistance);
1123 visit!(features.shaderCullDistance);
1124 visit!(features.shaderFloat64);
1125 visit!(features.shaderInt64);
1126 visit!(features.shaderInt16);
1127 visit!(features.shaderResourceResidency);
1128 visit!(features.shaderResourceMinLod);
1129 visit!(features.sparseBinding);
1130 visit!(features.sparseResidencyBuffer);
1131 visit!(features.sparseResidencyImage2D);
1132 visit!(features.sparseResidencyImage3D);
1133 visit!(features.sparseResidency2Samples);
1134 visit!(features.sparseResidency4Samples);
1135 visit!(features.sparseResidency8Samples);
1136 visit!(features.sparseResidency16Samples);
1137 visit!(features.sparseResidencyAliased);
1138 visit!(features.variableMultisampleRate);
1139 visit!(features.inheritedQueries);
1140 visit!(physical_device_16bit_storage_features.storageBuffer16BitAccess);
1141 visit!(physical_device_16bit_storage_features.uniformAndStorageBuffer16BitAccess);
1142 visit!(physical_device_16bit_storage_features.storagePushConstant16);
1143 visit!(physical_device_16bit_storage_features.storageInputOutput16);
1144 visit!(sampler_ycbcr_conversion_features.samplerYcbcrConversion);
1145 visit!(variable_pointer_features.variablePointersStorageBuffer);
1146 visit!(variable_pointer_features.variablePointers);
1147 visit!(shader_draw_parameter_features.shaderDrawParameters);
1148 visit!(protected_memory_features.protectedMemory);
1149 visit!(multiview_features.multiview);
1150 visit!(multiview_features.multiviewGeometryShader);
1151 visit!(multiview_features.multiviewTessellationShader);
1153 fn visit2<F: FnMut(bool, bool)>(mut self, mut rhs: Self, mut f: F) {
1154 self.visit2_mut(&mut rhs, |v1, v2| f(*v1, *v2));
1156 fn visit_mut<F: FnMut(&mut bool)>(&mut self, mut f: F) {
1157 let mut rhs = *self;
1158 self.visit2_mut(&mut rhs, |v, _| f(v));
1161 fn visit<F: FnMut(bool)>(mut self, mut f: F) {
1162 self.visit_mut(|v| f(*v));
1166 trait ImportExportFeatureSet<T> {
1167 fn import_feature_set(&mut self, features: &T);
1168 fn export_feature_set(&self, features: &mut T);
1171 impl ImportExportFeatureSet<api::VkPhysicalDeviceFeatures> for Features {
1172 fn import_feature_set(&mut self, features: &api::VkPhysicalDeviceFeatures) {
1173 self.features = *features;
1175 fn export_feature_set(&self, features: &mut api::VkPhysicalDeviceFeatures) {
1176 *features = self.features;
1180 impl ImportExportFeatureSet<api::VkPhysicalDeviceFeatures2> for Features {
1181 fn import_feature_set(&mut self, features: &api::VkPhysicalDeviceFeatures2) {
1182 self.features = features.features;
1184 fn export_feature_set(&self, features: &mut api::VkPhysicalDeviceFeatures2) {
1185 features.features = self.features;
1189 macro_rules! impl_import_export_feature_set {
1190 ($type:ident, $member:ident) => {
1191 impl ImportExportFeatureSet<api::$type> for Features {
1192 fn import_feature_set(&mut self, features: &api::$type) {
1193 self.$member = api::$type {
1194 sType: self.$member.sType,
1195 pNext: self.$member.pNext,
1199 fn export_feature_set(&self, features: &mut api::$type) {
1200 *features = api::$type {
1201 sType: features.sType,
1202 pNext: features.pNext,
1210 impl_import_export_feature_set!(
1211 VkPhysicalDevice16BitStorageFeatures,
1212 physical_device_16bit_storage_features
1215 impl_import_export_feature_set!(
1216 VkPhysicalDeviceSamplerYcbcrConversionFeatures,
1217 sampler_ycbcr_conversion_features
1220 impl_import_export_feature_set!(
1221 VkPhysicalDeviceVariablePointerFeatures,
1222 variable_pointer_features
1225 impl_import_export_feature_set!(
1226 VkPhysicalDeviceShaderDrawParameterFeatures,
1227 shader_draw_parameter_features
1230 impl_import_export_feature_set!(
1231 VkPhysicalDeviceProtectedMemoryFeatures,
1232 protected_memory_features
1235 impl_import_export_feature_set!(VkPhysicalDeviceMultiviewFeatures, multiview_features);
1237 impl Eq for Features {}
1239 impl PartialEq for Features {
1240 fn eq(&self, rhs: &Self) -> bool {
1241 let mut equal = true;
1242 self.visit2(*rhs, |a, b| equal &= a == b);
1247 impl BitAndAssign for Features {
1248 fn bitand_assign(&mut self, mut rhs: Self) {
1249 self.visit2_mut(&mut rhs, |l, r| *l &= *r);
1253 impl BitOrAssign for Features {
1254 fn bitor_assign(&mut self, mut rhs: Self) {
1255 self.visit2_mut(&mut rhs, |l, r| *l |= *r);
1259 impl BitXorAssign for Features {
1260 fn bitxor_assign(&mut self, mut rhs: Self) {
1261 self.visit2_mut(&mut rhs, |l, r| *l ^= *r);
1265 impl BitAnd for Features {
1267 fn bitand(mut self, rhs: Self) -> Self {
1273 impl BitOr for Features {
1275 fn bitor(mut self, rhs: Self) -> Self {
1281 impl BitXor for Features {
1283 fn bitxor(mut self, rhs: Self) -> Self {
1289 impl Not for Features {
1291 fn not(mut self) -> Self {
1292 self.visit_mut(|v| *v = !*v);
1301 physical_device: SharedHandle<api::VkPhysicalDevice>,
1302 extensions: Extensions,
1305 queues: Vec<Vec<OwnedHandle<api::VkQueue>>>,
1310 physical_device: SharedHandle<api::VkPhysicalDevice>,
1311 create_info: *const api::VkDeviceCreateInfo,
1312 ) -> Result<OwnedHandle<api::VkDevice>, api::VkResult> {
1313 parse_next_chain_const! {
1315 root = api::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
1316 device_group_device_create_info: api::VkDeviceGroupDeviceCreateInfo = api::VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO,
1317 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
1318 physical_device_features_2: api::VkPhysicalDeviceFeatures2 = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
1319 physical_device_multiview_features: api::VkPhysicalDeviceMultiviewFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
1320 physical_device_protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
1321 physical_device_sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
1322 physical_device_shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
1323 physical_device_variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
1325 let create_info = &*create_info;
1326 if create_info.enabledLayerCount != 0 {
1327 return Err(api::VK_ERROR_LAYER_NOT_PRESENT);
1329 let mut enabled_extensions = physical_device.enabled_extensions;
1330 for &extension_name in util::to_slice(
1331 create_info.ppEnabledExtensionNames,
1332 create_info.enabledExtensionCount as usize,
1334 let extension: Extension = CStr::from_ptr(extension_name)
1336 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?
1338 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?;
1339 assert_eq!(extension.get_scope(), ExtensionScope::Device);
1340 enabled_extensions[extension] = true;
1342 for extension in enabled_extensions
1344 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
1346 let missing_extensions = extension.get_required_extensions() & !enabled_extensions;
1347 for missing_extension in missing_extensions
1349 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
1352 "extension {} enabled but required extension {} is not enabled",
1353 extension.get_name(),
1354 missing_extension.get_name()
1358 let mut selected_features = Features::splat(false);
1359 if !device_group_device_create_info.is_null() {
1360 let api::VkDeviceGroupDeviceCreateInfo {
1363 physicalDeviceCount: physical_device_count,
1364 pPhysicalDevices: physical_devices,
1365 } = *device_group_device_create_info;
1367 physical_device_count, 1,
1368 "multiple devices in a group are not implemented"
1372 physical_device.get_handle(),
1373 "unknown physical_device"
1376 if !physical_device_16bit_storage_features.is_null() {
1377 selected_features.import_feature_set(&*physical_device_16bit_storage_features);
1379 if !physical_device_features_2.is_null() {
1380 selected_features.import_feature_set(&*physical_device_features_2);
1381 } else if !create_info.pEnabledFeatures.is_null() {
1382 selected_features.import_feature_set(&*create_info.pEnabledFeatures);
1384 if !physical_device_multiview_features.is_null() {
1385 selected_features.import_feature_set(&*physical_device_multiview_features);
1387 if !physical_device_protected_memory_features.is_null() {
1388 selected_features.import_feature_set(&*physical_device_protected_memory_features);
1390 if !physical_device_sampler_ycbcr_conversion_features.is_null() {
1392 .import_feature_set(&*physical_device_sampler_ycbcr_conversion_features);
1394 if !physical_device_shader_draw_parameter_features.is_null() {
1395 selected_features.import_feature_set(&*physical_device_shader_draw_parameter_features);
1396 } else if enabled_extensions[Extension::VK_KHR_shader_draw_parameters] {
1398 .shader_draw_parameter_features
1399 .shaderDrawParameters = api::VK_TRUE;
1401 if !physical_device_variable_pointer_features.is_null() {
1402 selected_features.import_feature_set(&*physical_device_variable_pointer_features);
1404 if (selected_features & !physical_device.features) != Features::splat(false) {
1405 return Err(api::VK_ERROR_FEATURE_NOT_PRESENT);
1407 assert_ne!(create_info.queueCreateInfoCount, 0);
1408 let queue_create_infos = util::to_slice(
1409 create_info.pQueueCreateInfos,
1410 create_info.queueCreateInfoCount as usize,
1412 assert!(queue_create_infos.len() <= QUEUE_FAMILY_COUNT as usize);
1413 let mut total_queue_count = 0;
1414 let mut queue_counts: Vec<_> = Vec::new();
1415 for queue_create_info in queue_create_infos {
1416 parse_next_chain_const! {
1418 root = api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
1420 let api::VkDeviceQueueCreateInfo {
1424 queueFamilyIndex: queue_family_index,
1425 queueCount: queue_count,
1426 pQueuePriorities: queue_priorities,
1427 } = *queue_create_info;
1428 assert_eq!(flags & api::VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT, 0);
1429 assert!(queue_family_index < QUEUE_FAMILY_COUNT);
1430 assert!(queue_count <= QUEUE_COUNTS[queue_family_index as usize]);
1431 let queue_priorities = util::to_slice(queue_priorities, queue_count as usize);
1432 for &queue_priority in queue_priorities {
1433 assert!(queue_priority >= 0.0 && queue_priority <= 1.0);
1435 assert_eq!(QUEUE_FAMILY_COUNT, 1, "multiple queues are not implemented");
1437 QUEUE_COUNTS, [1; QUEUE_FAMILY_COUNT as usize],
1438 "multiple queues are not implemented"
1440 queue_counts.push(queue_count as usize);
1441 total_queue_count += queue_count as usize;
1443 assert!(total_queue_count <= TOTAL_QUEUE_COUNT);
1444 let mut queues = Vec::new();
1445 for queue_count in queue_counts {
1446 let mut queue_family_queues = Vec::new();
1447 for _queue_index in 0..queue_count {
1448 queue_family_queues.push(OwnedHandle::<api::VkQueue>::new(Queue {}));
1450 queues.push(queue_family_queues);
1452 Ok(OwnedHandle::<api::VkDevice>::new(Device {
1454 extensions: enabled_extensions,
1455 features: selected_features,
1461 pub struct PhysicalDevice {
1462 enabled_extensions: Extensions,
1463 allowed_extensions: Extensions,
1464 properties: api::VkPhysicalDeviceProperties,
1466 system_memory_size: u64,
1467 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties,
1468 multiview_properties: api::VkPhysicalDeviceMultiviewProperties,
1469 id_properties: api::VkPhysicalDeviceIDProperties,
1470 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties,
1471 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties,
1472 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties,
1475 impl PhysicalDevice {
1476 pub fn get_pipeline_cache_uuid() -> uuid::Uuid {
1477 // FIXME: return real uuid
1480 pub fn get_device_uuid() -> uuid::Uuid {
1481 // FIXME: return real uuid
1484 pub fn get_driver_uuid() -> uuid::Uuid {
1485 // FIXME: return real uuid
1488 pub fn get_limits() -> api::VkPhysicalDeviceLimits {
1489 #![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_update))]
1490 api::VkPhysicalDeviceLimits {
1491 maxImageDimension1D: !0,
1492 maxImageDimension2D: !0,
1493 maxImageDimension3D: !0,
1494 maxImageDimensionCube: !0,
1495 maxImageArrayLayers: !0,
1496 maxTexelBufferElements: !0,
1497 maxUniformBufferRange: !0,
1498 maxStorageBufferRange: !0,
1499 maxPushConstantsSize: !0,
1500 maxMemoryAllocationCount: !0,
1501 maxSamplerAllocationCount: !0,
1502 bufferImageGranularity: 1,
1503 sparseAddressSpaceSize: 0,
1504 maxBoundDescriptorSets: !0,
1505 maxPerStageDescriptorSamplers: !0,
1506 maxPerStageDescriptorUniformBuffers: !0,
1507 maxPerStageDescriptorStorageBuffers: !0,
1508 maxPerStageDescriptorSampledImages: !0,
1509 maxPerStageDescriptorStorageImages: !0,
1510 maxPerStageDescriptorInputAttachments: !0,
1511 maxPerStageResources: !0,
1512 maxDescriptorSetSamplers: !0,
1513 maxDescriptorSetUniformBuffers: !0,
1514 maxDescriptorSetUniformBuffersDynamic: !0,
1515 maxDescriptorSetStorageBuffers: !0,
1516 maxDescriptorSetStorageBuffersDynamic: !0,
1517 maxDescriptorSetSampledImages: !0,
1518 maxDescriptorSetStorageImages: !0,
1519 maxDescriptorSetInputAttachments: !0,
1520 maxVertexInputAttributes: !0,
1521 maxVertexInputBindings: !0,
1522 maxVertexInputAttributeOffset: !0,
1523 maxVertexInputBindingStride: !0,
1524 maxVertexOutputComponents: !0,
1525 maxTessellationGenerationLevel: 0,
1526 maxTessellationPatchSize: 0,
1527 maxTessellationControlPerVertexInputComponents: 0,
1528 maxTessellationControlPerVertexOutputComponents: 0,
1529 maxTessellationControlPerPatchOutputComponents: 0,
1530 maxTessellationControlTotalOutputComponents: 0,
1531 maxTessellationEvaluationInputComponents: 0,
1532 maxTessellationEvaluationOutputComponents: 0,
1533 maxGeometryShaderInvocations: 0,
1534 maxGeometryInputComponents: 0,
1535 maxGeometryOutputComponents: 0,
1536 maxGeometryOutputVertices: 0,
1537 maxGeometryTotalOutputComponents: 0,
1538 maxFragmentInputComponents: !0,
1539 maxFragmentOutputAttachments: !0,
1540 maxFragmentDualSrcAttachments: 0,
1541 maxFragmentCombinedOutputResources: !0,
1542 maxComputeSharedMemorySize: !0,
1543 maxComputeWorkGroupCount: [!0; 3],
1544 maxComputeWorkGroupInvocations: !0,
1545 maxComputeWorkGroupSize: [!0; 3],
1546 subPixelPrecisionBits: 4, // FIXME: update to correct value
1547 subTexelPrecisionBits: 4, // FIXME: update to correct value
1548 mipmapPrecisionBits: 4, // FIXME: update to correct value
1549 maxDrawIndexedIndexValue: !0,
1550 maxDrawIndirectCount: !0,
1551 maxSamplerLodBias: 2.0, // FIXME: update to correct value
1552 maxSamplerAnisotropy: 1.0,
1554 maxViewportDimensions: [4096; 2], // FIXME: update to correct value
1555 viewportBoundsRange: [-8192.0, 8191.0], // FIXME: update to correct value
1556 viewportSubPixelBits: 0,
1557 minMemoryMapAlignment: MIN_MEMORY_MAP_ALIGNMENT,
1558 minTexelBufferOffsetAlignment: 64, // FIXME: update to correct value
1559 minUniformBufferOffsetAlignment: 64, // FIXME: update to correct value
1560 minStorageBufferOffsetAlignment: 64, // FIXME: update to correct value
1561 minTexelOffset: -8, // FIXME: update to correct value
1562 maxTexelOffset: 7, // FIXME: update to correct value
1563 minTexelGatherOffset: 0,
1564 maxTexelGatherOffset: 0,
1565 minInterpolationOffset: 0.0,
1566 maxInterpolationOffset: 0.0,
1567 subPixelInterpolationOffsetBits: 0,
1568 maxFramebufferWidth: 4096, // FIXME: update to correct value
1569 maxFramebufferHeight: 4096, // FIXME: update to correct value
1570 maxFramebufferLayers: 256, // FIXME: update to correct value
1571 framebufferColorSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1572 framebufferDepthSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1573 framebufferStencilSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1574 framebufferNoAttachmentsSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1575 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1576 maxColorAttachments: 4,
1577 sampledImageColorSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1578 sampledImageIntegerSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1579 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1580 sampledImageDepthSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1581 sampledImageStencilSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1582 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1583 storageImageSampleCounts: api::VK_SAMPLE_COUNT_1_BIT, // FIXME: update to correct value
1584 maxSampleMaskWords: 1,
1585 timestampComputeAndGraphics: api::VK_FALSE,
1586 timestampPeriod: 0.0,
1587 maxClipDistances: 0,
1588 maxCullDistances: 0,
1589 maxCombinedClipAndCullDistances: 0,
1590 discreteQueuePriorities: 2,
1591 pointSizeRange: [1.0; 2],
1592 lineWidthRange: [1.0; 2],
1593 pointSizeGranularity: 0.0,
1594 lineWidthGranularity: 0.0,
1595 strictLines: api::VK_FALSE,
1596 standardSampleLocations: api::VK_TRUE,
1597 optimalBufferCopyOffsetAlignment: 16,
1598 optimalBufferCopyRowPitchAlignment: 16,
1599 nonCoherentAtomSize: 1, //TODO: check if this is correct
1600 ..unsafe { mem::zeroed() } // for padding fields
1603 pub fn get_format_properties(format: api::VkFormat) -> api::VkFormatProperties {
1605 api::VK_FORMAT_UNDEFINED => api::VkFormatProperties {
1606 linearTilingFeatures: 0,
1607 optimalTilingFeatures: 0,
1610 api::VK_FORMAT_R4G4_UNORM_PACK8 => api::VkFormatProperties {
1612 linearTilingFeatures: 0,
1613 optimalTilingFeatures: 0,
1616 api::VK_FORMAT_R4G4B4A4_UNORM_PACK16 => api::VkFormatProperties {
1618 linearTilingFeatures: 0,
1619 optimalTilingFeatures: 0,
1622 api::VK_FORMAT_B4G4R4A4_UNORM_PACK16 => api::VkFormatProperties {
1624 linearTilingFeatures: 0,
1625 optimalTilingFeatures: 0,
1628 api::VK_FORMAT_R5G6B5_UNORM_PACK16 => api::VkFormatProperties {
1630 linearTilingFeatures: 0,
1631 optimalTilingFeatures: 0,
1634 api::VK_FORMAT_B5G6R5_UNORM_PACK16 => api::VkFormatProperties {
1636 linearTilingFeatures: 0,
1637 optimalTilingFeatures: 0,
1640 api::VK_FORMAT_R5G5B5A1_UNORM_PACK16 => api::VkFormatProperties {
1642 linearTilingFeatures: 0,
1643 optimalTilingFeatures: 0,
1646 api::VK_FORMAT_B5G5R5A1_UNORM_PACK16 => api::VkFormatProperties {
1648 linearTilingFeatures: 0,
1649 optimalTilingFeatures: 0,
1652 api::VK_FORMAT_A1R5G5B5_UNORM_PACK16 => api::VkFormatProperties {
1654 linearTilingFeatures: 0,
1655 optimalTilingFeatures: 0,
1658 api::VK_FORMAT_R8_UNORM => api::VkFormatProperties {
1660 linearTilingFeatures: 0,
1661 optimalTilingFeatures: 0,
1664 api::VK_FORMAT_R8_SNORM => api::VkFormatProperties {
1666 linearTilingFeatures: 0,
1667 optimalTilingFeatures: 0,
1670 api::VK_FORMAT_R8_USCALED => api::VkFormatProperties {
1672 linearTilingFeatures: 0,
1673 optimalTilingFeatures: 0,
1676 api::VK_FORMAT_R8_SSCALED => api::VkFormatProperties {
1678 linearTilingFeatures: 0,
1679 optimalTilingFeatures: 0,
1682 api::VK_FORMAT_R8_UINT => api::VkFormatProperties {
1684 linearTilingFeatures: 0,
1685 optimalTilingFeatures: 0,
1688 api::VK_FORMAT_R8_SINT => api::VkFormatProperties {
1690 linearTilingFeatures: 0,
1691 optimalTilingFeatures: 0,
1694 api::VK_FORMAT_R8_SRGB => api::VkFormatProperties {
1696 linearTilingFeatures: 0,
1697 optimalTilingFeatures: 0,
1700 api::VK_FORMAT_R8G8_UNORM => api::VkFormatProperties {
1702 linearTilingFeatures: 0,
1703 optimalTilingFeatures: 0,
1706 api::VK_FORMAT_R8G8_SNORM => api::VkFormatProperties {
1708 linearTilingFeatures: 0,
1709 optimalTilingFeatures: 0,
1712 api::VK_FORMAT_R8G8_USCALED => api::VkFormatProperties {
1714 linearTilingFeatures: 0,
1715 optimalTilingFeatures: 0,
1718 api::VK_FORMAT_R8G8_SSCALED => api::VkFormatProperties {
1720 linearTilingFeatures: 0,
1721 optimalTilingFeatures: 0,
1724 api::VK_FORMAT_R8G8_UINT => api::VkFormatProperties {
1726 linearTilingFeatures: 0,
1727 optimalTilingFeatures: 0,
1730 api::VK_FORMAT_R8G8_SINT => api::VkFormatProperties {
1732 linearTilingFeatures: 0,
1733 optimalTilingFeatures: 0,
1736 api::VK_FORMAT_R8G8_SRGB => api::VkFormatProperties {
1738 linearTilingFeatures: 0,
1739 optimalTilingFeatures: 0,
1742 api::VK_FORMAT_R8G8B8_UNORM => api::VkFormatProperties {
1744 linearTilingFeatures: 0,
1745 optimalTilingFeatures: 0,
1748 api::VK_FORMAT_R8G8B8_SNORM => api::VkFormatProperties {
1750 linearTilingFeatures: 0,
1751 optimalTilingFeatures: 0,
1754 api::VK_FORMAT_R8G8B8_USCALED => api::VkFormatProperties {
1756 linearTilingFeatures: 0,
1757 optimalTilingFeatures: 0,
1760 api::VK_FORMAT_R8G8B8_SSCALED => api::VkFormatProperties {
1762 linearTilingFeatures: 0,
1763 optimalTilingFeatures: 0,
1766 api::VK_FORMAT_R8G8B8_UINT => api::VkFormatProperties {
1768 linearTilingFeatures: 0,
1769 optimalTilingFeatures: 0,
1772 api::VK_FORMAT_R8G8B8_SINT => api::VkFormatProperties {
1774 linearTilingFeatures: 0,
1775 optimalTilingFeatures: 0,
1778 api::VK_FORMAT_R8G8B8_SRGB => api::VkFormatProperties {
1780 linearTilingFeatures: 0,
1781 optimalTilingFeatures: 0,
1784 api::VK_FORMAT_B8G8R8_UNORM => api::VkFormatProperties {
1786 linearTilingFeatures: 0,
1787 optimalTilingFeatures: 0,
1790 api::VK_FORMAT_B8G8R8_SNORM => api::VkFormatProperties {
1792 linearTilingFeatures: 0,
1793 optimalTilingFeatures: 0,
1796 api::VK_FORMAT_B8G8R8_USCALED => api::VkFormatProperties {
1798 linearTilingFeatures: 0,
1799 optimalTilingFeatures: 0,
1802 api::VK_FORMAT_B8G8R8_SSCALED => api::VkFormatProperties {
1804 linearTilingFeatures: 0,
1805 optimalTilingFeatures: 0,
1808 api::VK_FORMAT_B8G8R8_UINT => api::VkFormatProperties {
1810 linearTilingFeatures: 0,
1811 optimalTilingFeatures: 0,
1814 api::VK_FORMAT_B8G8R8_SINT => api::VkFormatProperties {
1816 linearTilingFeatures: 0,
1817 optimalTilingFeatures: 0,
1820 api::VK_FORMAT_B8G8R8_SRGB => api::VkFormatProperties {
1822 linearTilingFeatures: 0,
1823 optimalTilingFeatures: 0,
1826 api::VK_FORMAT_R8G8B8A8_UNORM => api::VkFormatProperties {
1828 linearTilingFeatures: 0,
1829 optimalTilingFeatures: 0,
1832 api::VK_FORMAT_R8G8B8A8_SNORM => api::VkFormatProperties {
1834 linearTilingFeatures: 0,
1835 optimalTilingFeatures: 0,
1838 api::VK_FORMAT_R8G8B8A8_USCALED => api::VkFormatProperties {
1840 linearTilingFeatures: 0,
1841 optimalTilingFeatures: 0,
1844 api::VK_FORMAT_R8G8B8A8_SSCALED => api::VkFormatProperties {
1846 linearTilingFeatures: 0,
1847 optimalTilingFeatures: 0,
1850 api::VK_FORMAT_R8G8B8A8_UINT => api::VkFormatProperties {
1852 linearTilingFeatures: 0,
1853 optimalTilingFeatures: 0,
1856 api::VK_FORMAT_R8G8B8A8_SINT => api::VkFormatProperties {
1858 linearTilingFeatures: 0,
1859 optimalTilingFeatures: 0,
1862 api::VK_FORMAT_R8G8B8A8_SRGB => api::VkFormatProperties {
1864 linearTilingFeatures: 0,
1865 optimalTilingFeatures: 0,
1868 api::VK_FORMAT_B8G8R8A8_UNORM => api::VkFormatProperties {
1870 linearTilingFeatures: 0,
1871 optimalTilingFeatures: 0,
1874 api::VK_FORMAT_B8G8R8A8_SNORM => api::VkFormatProperties {
1876 linearTilingFeatures: 0,
1877 optimalTilingFeatures: 0,
1880 api::VK_FORMAT_B8G8R8A8_USCALED => api::VkFormatProperties {
1882 linearTilingFeatures: 0,
1883 optimalTilingFeatures: 0,
1886 api::VK_FORMAT_B8G8R8A8_SSCALED => api::VkFormatProperties {
1888 linearTilingFeatures: 0,
1889 optimalTilingFeatures: 0,
1892 api::VK_FORMAT_B8G8R8A8_UINT => api::VkFormatProperties {
1894 linearTilingFeatures: 0,
1895 optimalTilingFeatures: 0,
1898 api::VK_FORMAT_B8G8R8A8_SINT => api::VkFormatProperties {
1900 linearTilingFeatures: 0,
1901 optimalTilingFeatures: 0,
1904 api::VK_FORMAT_B8G8R8A8_SRGB => api::VkFormatProperties {
1906 linearTilingFeatures: 0,
1907 optimalTilingFeatures: 0,
1910 api::VK_FORMAT_A8B8G8R8_UNORM_PACK32 => api::VkFormatProperties {
1912 linearTilingFeatures: 0,
1913 optimalTilingFeatures: 0,
1916 api::VK_FORMAT_A8B8G8R8_SNORM_PACK32 => api::VkFormatProperties {
1918 linearTilingFeatures: 0,
1919 optimalTilingFeatures: 0,
1922 api::VK_FORMAT_A8B8G8R8_USCALED_PACK32 => api::VkFormatProperties {
1924 linearTilingFeatures: 0,
1925 optimalTilingFeatures: 0,
1928 api::VK_FORMAT_A8B8G8R8_SSCALED_PACK32 => api::VkFormatProperties {
1930 linearTilingFeatures: 0,
1931 optimalTilingFeatures: 0,
1934 api::VK_FORMAT_A8B8G8R8_UINT_PACK32 => api::VkFormatProperties {
1936 linearTilingFeatures: 0,
1937 optimalTilingFeatures: 0,
1940 api::VK_FORMAT_A8B8G8R8_SINT_PACK32 => api::VkFormatProperties {
1942 linearTilingFeatures: 0,
1943 optimalTilingFeatures: 0,
1946 api::VK_FORMAT_A8B8G8R8_SRGB_PACK32 => api::VkFormatProperties {
1948 linearTilingFeatures: 0,
1949 optimalTilingFeatures: 0,
1952 api::VK_FORMAT_A2R10G10B10_UNORM_PACK32 => api::VkFormatProperties {
1954 linearTilingFeatures: 0,
1955 optimalTilingFeatures: 0,
1958 api::VK_FORMAT_A2R10G10B10_SNORM_PACK32 => api::VkFormatProperties {
1960 linearTilingFeatures: 0,
1961 optimalTilingFeatures: 0,
1964 api::VK_FORMAT_A2R10G10B10_USCALED_PACK32 => api::VkFormatProperties {
1966 linearTilingFeatures: 0,
1967 optimalTilingFeatures: 0,
1970 api::VK_FORMAT_A2R10G10B10_SSCALED_PACK32 => api::VkFormatProperties {
1972 linearTilingFeatures: 0,
1973 optimalTilingFeatures: 0,
1976 api::VK_FORMAT_A2R10G10B10_UINT_PACK32 => api::VkFormatProperties {
1978 linearTilingFeatures: 0,
1979 optimalTilingFeatures: 0,
1982 api::VK_FORMAT_A2R10G10B10_SINT_PACK32 => api::VkFormatProperties {
1984 linearTilingFeatures: 0,
1985 optimalTilingFeatures: 0,
1988 api::VK_FORMAT_A2B10G10R10_UNORM_PACK32 => api::VkFormatProperties {
1990 linearTilingFeatures: 0,
1991 optimalTilingFeatures: 0,
1994 api::VK_FORMAT_A2B10G10R10_SNORM_PACK32 => api::VkFormatProperties {
1996 linearTilingFeatures: 0,
1997 optimalTilingFeatures: 0,
2000 api::VK_FORMAT_A2B10G10R10_USCALED_PACK32 => api::VkFormatProperties {
2002 linearTilingFeatures: 0,
2003 optimalTilingFeatures: 0,
2006 api::VK_FORMAT_A2B10G10R10_SSCALED_PACK32 => api::VkFormatProperties {
2008 linearTilingFeatures: 0,
2009 optimalTilingFeatures: 0,
2012 api::VK_FORMAT_A2B10G10R10_UINT_PACK32 => api::VkFormatProperties {
2014 linearTilingFeatures: 0,
2015 optimalTilingFeatures: 0,
2018 api::VK_FORMAT_A2B10G10R10_SINT_PACK32 => api::VkFormatProperties {
2020 linearTilingFeatures: 0,
2021 optimalTilingFeatures: 0,
2024 api::VK_FORMAT_R16_UNORM => api::VkFormatProperties {
2026 linearTilingFeatures: 0,
2027 optimalTilingFeatures: 0,
2030 api::VK_FORMAT_R16_SNORM => api::VkFormatProperties {
2032 linearTilingFeatures: 0,
2033 optimalTilingFeatures: 0,
2036 api::VK_FORMAT_R16_USCALED => api::VkFormatProperties {
2038 linearTilingFeatures: 0,
2039 optimalTilingFeatures: 0,
2042 api::VK_FORMAT_R16_SSCALED => api::VkFormatProperties {
2044 linearTilingFeatures: 0,
2045 optimalTilingFeatures: 0,
2048 api::VK_FORMAT_R16_UINT => api::VkFormatProperties {
2050 linearTilingFeatures: 0,
2051 optimalTilingFeatures: 0,
2054 api::VK_FORMAT_R16_SINT => api::VkFormatProperties {
2056 linearTilingFeatures: 0,
2057 optimalTilingFeatures: 0,
2060 api::VK_FORMAT_R16_SFLOAT => api::VkFormatProperties {
2062 linearTilingFeatures: 0,
2063 optimalTilingFeatures: 0,
2066 api::VK_FORMAT_R16G16_UNORM => api::VkFormatProperties {
2068 linearTilingFeatures: 0,
2069 optimalTilingFeatures: 0,
2072 api::VK_FORMAT_R16G16_SNORM => api::VkFormatProperties {
2074 linearTilingFeatures: 0,
2075 optimalTilingFeatures: 0,
2078 api::VK_FORMAT_R16G16_USCALED => api::VkFormatProperties {
2080 linearTilingFeatures: 0,
2081 optimalTilingFeatures: 0,
2084 api::VK_FORMAT_R16G16_SSCALED => api::VkFormatProperties {
2086 linearTilingFeatures: 0,
2087 optimalTilingFeatures: 0,
2090 api::VK_FORMAT_R16G16_UINT => api::VkFormatProperties {
2092 linearTilingFeatures: 0,
2093 optimalTilingFeatures: 0,
2096 api::VK_FORMAT_R16G16_SINT => api::VkFormatProperties {
2098 linearTilingFeatures: 0,
2099 optimalTilingFeatures: 0,
2102 api::VK_FORMAT_R16G16_SFLOAT => api::VkFormatProperties {
2104 linearTilingFeatures: 0,
2105 optimalTilingFeatures: 0,
2108 api::VK_FORMAT_R16G16B16_UNORM => api::VkFormatProperties {
2110 linearTilingFeatures: 0,
2111 optimalTilingFeatures: 0,
2114 api::VK_FORMAT_R16G16B16_SNORM => api::VkFormatProperties {
2116 linearTilingFeatures: 0,
2117 optimalTilingFeatures: 0,
2120 api::VK_FORMAT_R16G16B16_USCALED => api::VkFormatProperties {
2122 linearTilingFeatures: 0,
2123 optimalTilingFeatures: 0,
2126 api::VK_FORMAT_R16G16B16_SSCALED => api::VkFormatProperties {
2128 linearTilingFeatures: 0,
2129 optimalTilingFeatures: 0,
2132 api::VK_FORMAT_R16G16B16_UINT => api::VkFormatProperties {
2134 linearTilingFeatures: 0,
2135 optimalTilingFeatures: 0,
2138 api::VK_FORMAT_R16G16B16_SINT => api::VkFormatProperties {
2140 linearTilingFeatures: 0,
2141 optimalTilingFeatures: 0,
2144 api::VK_FORMAT_R16G16B16_SFLOAT => api::VkFormatProperties {
2146 linearTilingFeatures: 0,
2147 optimalTilingFeatures: 0,
2150 api::VK_FORMAT_R16G16B16A16_UNORM => api::VkFormatProperties {
2152 linearTilingFeatures: 0,
2153 optimalTilingFeatures: 0,
2156 api::VK_FORMAT_R16G16B16A16_SNORM => api::VkFormatProperties {
2158 linearTilingFeatures: 0,
2159 optimalTilingFeatures: 0,
2162 api::VK_FORMAT_R16G16B16A16_USCALED => api::VkFormatProperties {
2164 linearTilingFeatures: 0,
2165 optimalTilingFeatures: 0,
2168 api::VK_FORMAT_R16G16B16A16_SSCALED => api::VkFormatProperties {
2170 linearTilingFeatures: 0,
2171 optimalTilingFeatures: 0,
2174 api::VK_FORMAT_R16G16B16A16_UINT => api::VkFormatProperties {
2176 linearTilingFeatures: 0,
2177 optimalTilingFeatures: 0,
2180 api::VK_FORMAT_R16G16B16A16_SINT => api::VkFormatProperties {
2182 linearTilingFeatures: 0,
2183 optimalTilingFeatures: 0,
2186 api::VK_FORMAT_R16G16B16A16_SFLOAT => api::VkFormatProperties {
2188 linearTilingFeatures: 0,
2189 optimalTilingFeatures: 0,
2192 api::VK_FORMAT_R32_UINT => api::VkFormatProperties {
2194 linearTilingFeatures: 0,
2195 optimalTilingFeatures: 0,
2198 api::VK_FORMAT_R32_SINT => api::VkFormatProperties {
2200 linearTilingFeatures: 0,
2201 optimalTilingFeatures: 0,
2204 api::VK_FORMAT_R32_SFLOAT => api::VkFormatProperties {
2206 linearTilingFeatures: 0,
2207 optimalTilingFeatures: 0,
2210 api::VK_FORMAT_R32G32_UINT => api::VkFormatProperties {
2212 linearTilingFeatures: 0,
2213 optimalTilingFeatures: 0,
2216 api::VK_FORMAT_R32G32_SINT => api::VkFormatProperties {
2218 linearTilingFeatures: 0,
2219 optimalTilingFeatures: 0,
2222 api::VK_FORMAT_R32G32_SFLOAT => api::VkFormatProperties {
2224 linearTilingFeatures: 0,
2225 optimalTilingFeatures: 0,
2228 api::VK_FORMAT_R32G32B32_UINT => api::VkFormatProperties {
2230 linearTilingFeatures: 0,
2231 optimalTilingFeatures: 0,
2234 api::VK_FORMAT_R32G32B32_SINT => api::VkFormatProperties {
2236 linearTilingFeatures: 0,
2237 optimalTilingFeatures: 0,
2240 api::VK_FORMAT_R32G32B32_SFLOAT => api::VkFormatProperties {
2242 linearTilingFeatures: 0,
2243 optimalTilingFeatures: 0,
2246 api::VK_FORMAT_R32G32B32A32_UINT => api::VkFormatProperties {
2248 linearTilingFeatures: 0,
2249 optimalTilingFeatures: 0,
2252 api::VK_FORMAT_R32G32B32A32_SINT => api::VkFormatProperties {
2254 linearTilingFeatures: 0,
2255 optimalTilingFeatures: 0,
2258 api::VK_FORMAT_R32G32B32A32_SFLOAT => api::VkFormatProperties {
2260 linearTilingFeatures: 0,
2261 optimalTilingFeatures: 0,
2264 api::VK_FORMAT_R64_UINT => api::VkFormatProperties {
2266 linearTilingFeatures: 0,
2267 optimalTilingFeatures: 0,
2270 api::VK_FORMAT_R64_SINT => api::VkFormatProperties {
2272 linearTilingFeatures: 0,
2273 optimalTilingFeatures: 0,
2276 api::VK_FORMAT_R64_SFLOAT => api::VkFormatProperties {
2278 linearTilingFeatures: 0,
2279 optimalTilingFeatures: 0,
2282 api::VK_FORMAT_R64G64_UINT => api::VkFormatProperties {
2284 linearTilingFeatures: 0,
2285 optimalTilingFeatures: 0,
2288 api::VK_FORMAT_R64G64_SINT => api::VkFormatProperties {
2290 linearTilingFeatures: 0,
2291 optimalTilingFeatures: 0,
2294 api::VK_FORMAT_R64G64_SFLOAT => api::VkFormatProperties {
2296 linearTilingFeatures: 0,
2297 optimalTilingFeatures: 0,
2300 api::VK_FORMAT_R64G64B64_UINT => api::VkFormatProperties {
2302 linearTilingFeatures: 0,
2303 optimalTilingFeatures: 0,
2306 api::VK_FORMAT_R64G64B64_SINT => api::VkFormatProperties {
2308 linearTilingFeatures: 0,
2309 optimalTilingFeatures: 0,
2312 api::VK_FORMAT_R64G64B64_SFLOAT => api::VkFormatProperties {
2314 linearTilingFeatures: 0,
2315 optimalTilingFeatures: 0,
2318 api::VK_FORMAT_R64G64B64A64_UINT => api::VkFormatProperties {
2320 linearTilingFeatures: 0,
2321 optimalTilingFeatures: 0,
2324 api::VK_FORMAT_R64G64B64A64_SINT => api::VkFormatProperties {
2326 linearTilingFeatures: 0,
2327 optimalTilingFeatures: 0,
2330 api::VK_FORMAT_R64G64B64A64_SFLOAT => api::VkFormatProperties {
2332 linearTilingFeatures: 0,
2333 optimalTilingFeatures: 0,
2336 api::VK_FORMAT_B10G11R11_UFLOAT_PACK32 => api::VkFormatProperties {
2338 linearTilingFeatures: 0,
2339 optimalTilingFeatures: 0,
2342 api::VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 => api::VkFormatProperties {
2344 linearTilingFeatures: 0,
2345 optimalTilingFeatures: 0,
2348 api::VK_FORMAT_D16_UNORM => api::VkFormatProperties {
2350 linearTilingFeatures: 0,
2351 optimalTilingFeatures: 0,
2354 api::VK_FORMAT_X8_D24_UNORM_PACK32 => api::VkFormatProperties {
2356 linearTilingFeatures: 0,
2357 optimalTilingFeatures: 0,
2360 api::VK_FORMAT_D32_SFLOAT => api::VkFormatProperties {
2362 linearTilingFeatures: 0,
2363 optimalTilingFeatures: 0,
2366 api::VK_FORMAT_S8_UINT => api::VkFormatProperties {
2368 linearTilingFeatures: 0,
2369 optimalTilingFeatures: 0,
2372 api::VK_FORMAT_D16_UNORM_S8_UINT => api::VkFormatProperties {
2374 linearTilingFeatures: 0,
2375 optimalTilingFeatures: 0,
2378 api::VK_FORMAT_D24_UNORM_S8_UINT => api::VkFormatProperties {
2380 linearTilingFeatures: 0,
2381 optimalTilingFeatures: 0,
2384 api::VK_FORMAT_D32_SFLOAT_S8_UINT => api::VkFormatProperties {
2386 linearTilingFeatures: 0,
2387 optimalTilingFeatures: 0,
2390 api::VK_FORMAT_BC1_RGB_UNORM_BLOCK => api::VkFormatProperties {
2392 linearTilingFeatures: 0,
2393 optimalTilingFeatures: 0,
2396 api::VK_FORMAT_BC1_RGB_SRGB_BLOCK => api::VkFormatProperties {
2398 linearTilingFeatures: 0,
2399 optimalTilingFeatures: 0,
2402 api::VK_FORMAT_BC1_RGBA_UNORM_BLOCK => api::VkFormatProperties {
2404 linearTilingFeatures: 0,
2405 optimalTilingFeatures: 0,
2408 api::VK_FORMAT_BC1_RGBA_SRGB_BLOCK => api::VkFormatProperties {
2410 linearTilingFeatures: 0,
2411 optimalTilingFeatures: 0,
2414 api::VK_FORMAT_BC2_UNORM_BLOCK => api::VkFormatProperties {
2416 linearTilingFeatures: 0,
2417 optimalTilingFeatures: 0,
2420 api::VK_FORMAT_BC2_SRGB_BLOCK => api::VkFormatProperties {
2422 linearTilingFeatures: 0,
2423 optimalTilingFeatures: 0,
2426 api::VK_FORMAT_BC3_UNORM_BLOCK => api::VkFormatProperties {
2428 linearTilingFeatures: 0,
2429 optimalTilingFeatures: 0,
2432 api::VK_FORMAT_BC3_SRGB_BLOCK => api::VkFormatProperties {
2434 linearTilingFeatures: 0,
2435 optimalTilingFeatures: 0,
2438 api::VK_FORMAT_BC4_UNORM_BLOCK => api::VkFormatProperties {
2440 linearTilingFeatures: 0,
2441 optimalTilingFeatures: 0,
2444 api::VK_FORMAT_BC4_SNORM_BLOCK => api::VkFormatProperties {
2446 linearTilingFeatures: 0,
2447 optimalTilingFeatures: 0,
2450 api::VK_FORMAT_BC5_UNORM_BLOCK => api::VkFormatProperties {
2452 linearTilingFeatures: 0,
2453 optimalTilingFeatures: 0,
2456 api::VK_FORMAT_BC5_SNORM_BLOCK => api::VkFormatProperties {
2458 linearTilingFeatures: 0,
2459 optimalTilingFeatures: 0,
2462 api::VK_FORMAT_BC6H_UFLOAT_BLOCK => api::VkFormatProperties {
2464 linearTilingFeatures: 0,
2465 optimalTilingFeatures: 0,
2468 api::VK_FORMAT_BC6H_SFLOAT_BLOCK => api::VkFormatProperties {
2470 linearTilingFeatures: 0,
2471 optimalTilingFeatures: 0,
2474 api::VK_FORMAT_BC7_UNORM_BLOCK => api::VkFormatProperties {
2476 linearTilingFeatures: 0,
2477 optimalTilingFeatures: 0,
2480 api::VK_FORMAT_BC7_SRGB_BLOCK => api::VkFormatProperties {
2482 linearTilingFeatures: 0,
2483 optimalTilingFeatures: 0,
2486 api::VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK => api::VkFormatProperties {
2488 linearTilingFeatures: 0,
2489 optimalTilingFeatures: 0,
2492 api::VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK => api::VkFormatProperties {
2494 linearTilingFeatures: 0,
2495 optimalTilingFeatures: 0,
2498 api::VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK => api::VkFormatProperties {
2500 linearTilingFeatures: 0,
2501 optimalTilingFeatures: 0,
2504 api::VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK => api::VkFormatProperties {
2506 linearTilingFeatures: 0,
2507 optimalTilingFeatures: 0,
2510 api::VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK => api::VkFormatProperties {
2512 linearTilingFeatures: 0,
2513 optimalTilingFeatures: 0,
2516 api::VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK => api::VkFormatProperties {
2518 linearTilingFeatures: 0,
2519 optimalTilingFeatures: 0,
2522 api::VK_FORMAT_EAC_R11_UNORM_BLOCK => api::VkFormatProperties {
2524 linearTilingFeatures: 0,
2525 optimalTilingFeatures: 0,
2528 api::VK_FORMAT_EAC_R11_SNORM_BLOCK => api::VkFormatProperties {
2530 linearTilingFeatures: 0,
2531 optimalTilingFeatures: 0,
2534 api::VK_FORMAT_EAC_R11G11_UNORM_BLOCK => api::VkFormatProperties {
2536 linearTilingFeatures: 0,
2537 optimalTilingFeatures: 0,
2540 api::VK_FORMAT_EAC_R11G11_SNORM_BLOCK => api::VkFormatProperties {
2542 linearTilingFeatures: 0,
2543 optimalTilingFeatures: 0,
2546 api::VK_FORMAT_ASTC_4x4_UNORM_BLOCK => api::VkFormatProperties {
2548 linearTilingFeatures: 0,
2549 optimalTilingFeatures: 0,
2552 api::VK_FORMAT_ASTC_4x4_SRGB_BLOCK => api::VkFormatProperties {
2554 linearTilingFeatures: 0,
2555 optimalTilingFeatures: 0,
2558 api::VK_FORMAT_ASTC_5x4_UNORM_BLOCK => api::VkFormatProperties {
2560 linearTilingFeatures: 0,
2561 optimalTilingFeatures: 0,
2564 api::VK_FORMAT_ASTC_5x4_SRGB_BLOCK => api::VkFormatProperties {
2566 linearTilingFeatures: 0,
2567 optimalTilingFeatures: 0,
2570 api::VK_FORMAT_ASTC_5x5_UNORM_BLOCK => api::VkFormatProperties {
2572 linearTilingFeatures: 0,
2573 optimalTilingFeatures: 0,
2576 api::VK_FORMAT_ASTC_5x5_SRGB_BLOCK => api::VkFormatProperties {
2578 linearTilingFeatures: 0,
2579 optimalTilingFeatures: 0,
2582 api::VK_FORMAT_ASTC_6x5_UNORM_BLOCK => api::VkFormatProperties {
2584 linearTilingFeatures: 0,
2585 optimalTilingFeatures: 0,
2588 api::VK_FORMAT_ASTC_6x5_SRGB_BLOCK => api::VkFormatProperties {
2590 linearTilingFeatures: 0,
2591 optimalTilingFeatures: 0,
2594 api::VK_FORMAT_ASTC_6x6_UNORM_BLOCK => api::VkFormatProperties {
2596 linearTilingFeatures: 0,
2597 optimalTilingFeatures: 0,
2600 api::VK_FORMAT_ASTC_6x6_SRGB_BLOCK => api::VkFormatProperties {
2602 linearTilingFeatures: 0,
2603 optimalTilingFeatures: 0,
2606 api::VK_FORMAT_ASTC_8x5_UNORM_BLOCK => api::VkFormatProperties {
2608 linearTilingFeatures: 0,
2609 optimalTilingFeatures: 0,
2612 api::VK_FORMAT_ASTC_8x5_SRGB_BLOCK => api::VkFormatProperties {
2614 linearTilingFeatures: 0,
2615 optimalTilingFeatures: 0,
2618 api::VK_FORMAT_ASTC_8x6_UNORM_BLOCK => api::VkFormatProperties {
2620 linearTilingFeatures: 0,
2621 optimalTilingFeatures: 0,
2624 api::VK_FORMAT_ASTC_8x6_SRGB_BLOCK => api::VkFormatProperties {
2626 linearTilingFeatures: 0,
2627 optimalTilingFeatures: 0,
2630 api::VK_FORMAT_ASTC_8x8_UNORM_BLOCK => api::VkFormatProperties {
2632 linearTilingFeatures: 0,
2633 optimalTilingFeatures: 0,
2636 api::VK_FORMAT_ASTC_8x8_SRGB_BLOCK => api::VkFormatProperties {
2638 linearTilingFeatures: 0,
2639 optimalTilingFeatures: 0,
2642 api::VK_FORMAT_ASTC_10x5_UNORM_BLOCK => api::VkFormatProperties {
2644 linearTilingFeatures: 0,
2645 optimalTilingFeatures: 0,
2648 api::VK_FORMAT_ASTC_10x5_SRGB_BLOCK => api::VkFormatProperties {
2650 linearTilingFeatures: 0,
2651 optimalTilingFeatures: 0,
2654 api::VK_FORMAT_ASTC_10x6_UNORM_BLOCK => api::VkFormatProperties {
2656 linearTilingFeatures: 0,
2657 optimalTilingFeatures: 0,
2660 api::VK_FORMAT_ASTC_10x6_SRGB_BLOCK => api::VkFormatProperties {
2662 linearTilingFeatures: 0,
2663 optimalTilingFeatures: 0,
2666 api::VK_FORMAT_ASTC_10x8_UNORM_BLOCK => api::VkFormatProperties {
2668 linearTilingFeatures: 0,
2669 optimalTilingFeatures: 0,
2672 api::VK_FORMAT_ASTC_10x8_SRGB_BLOCK => api::VkFormatProperties {
2674 linearTilingFeatures: 0,
2675 optimalTilingFeatures: 0,
2678 api::VK_FORMAT_ASTC_10x10_UNORM_BLOCK => api::VkFormatProperties {
2680 linearTilingFeatures: 0,
2681 optimalTilingFeatures: 0,
2684 api::VK_FORMAT_ASTC_10x10_SRGB_BLOCK => api::VkFormatProperties {
2686 linearTilingFeatures: 0,
2687 optimalTilingFeatures: 0,
2690 api::VK_FORMAT_ASTC_12x10_UNORM_BLOCK => api::VkFormatProperties {
2692 linearTilingFeatures: 0,
2693 optimalTilingFeatures: 0,
2696 api::VK_FORMAT_ASTC_12x10_SRGB_BLOCK => api::VkFormatProperties {
2698 linearTilingFeatures: 0,
2699 optimalTilingFeatures: 0,
2702 api::VK_FORMAT_ASTC_12x12_UNORM_BLOCK => api::VkFormatProperties {
2704 linearTilingFeatures: 0,
2705 optimalTilingFeatures: 0,
2708 api::VK_FORMAT_ASTC_12x12_SRGB_BLOCK => api::VkFormatProperties {
2710 linearTilingFeatures: 0,
2711 optimalTilingFeatures: 0,
2714 api::VK_FORMAT_G8B8G8R8_422_UNORM => api::VkFormatProperties {
2716 linearTilingFeatures: 0,
2717 optimalTilingFeatures: 0,
2720 api::VK_FORMAT_B8G8R8G8_422_UNORM => api::VkFormatProperties {
2722 linearTilingFeatures: 0,
2723 optimalTilingFeatures: 0,
2726 api::VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM => api::VkFormatProperties {
2728 linearTilingFeatures: 0,
2729 optimalTilingFeatures: 0,
2732 api::VK_FORMAT_G8_B8R8_2PLANE_420_UNORM => api::VkFormatProperties {
2734 linearTilingFeatures: 0,
2735 optimalTilingFeatures: 0,
2738 api::VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM => api::VkFormatProperties {
2740 linearTilingFeatures: 0,
2741 optimalTilingFeatures: 0,
2744 api::VK_FORMAT_G8_B8R8_2PLANE_422_UNORM => api::VkFormatProperties {
2746 linearTilingFeatures: 0,
2747 optimalTilingFeatures: 0,
2750 api::VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM => api::VkFormatProperties {
2752 linearTilingFeatures: 0,
2753 optimalTilingFeatures: 0,
2756 api::VK_FORMAT_R10X6_UNORM_PACK16 => api::VkFormatProperties {
2758 linearTilingFeatures: 0,
2759 optimalTilingFeatures: 0,
2762 api::VK_FORMAT_R10X6G10X6_UNORM_2PACK16 => api::VkFormatProperties {
2764 linearTilingFeatures: 0,
2765 optimalTilingFeatures: 0,
2768 api::VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 => api::VkFormatProperties {
2770 linearTilingFeatures: 0,
2771 optimalTilingFeatures: 0,
2774 api::VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 => api::VkFormatProperties {
2776 linearTilingFeatures: 0,
2777 optimalTilingFeatures: 0,
2780 api::VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 => api::VkFormatProperties {
2782 linearTilingFeatures: 0,
2783 optimalTilingFeatures: 0,
2786 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
2788 linearTilingFeatures: 0,
2789 optimalTilingFeatures: 0,
2792 api::VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
2794 linearTilingFeatures: 0,
2795 optimalTilingFeatures: 0,
2798 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
2800 linearTilingFeatures: 0,
2801 optimalTilingFeatures: 0,
2804 api::VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
2806 linearTilingFeatures: 0,
2807 optimalTilingFeatures: 0,
2810 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 => api::VkFormatProperties {
2812 linearTilingFeatures: 0,
2813 optimalTilingFeatures: 0,
2816 api::VK_FORMAT_R12X4_UNORM_PACK16 => api::VkFormatProperties {
2818 linearTilingFeatures: 0,
2819 optimalTilingFeatures: 0,
2822 api::VK_FORMAT_R12X4G12X4_UNORM_2PACK16 => api::VkFormatProperties {
2824 linearTilingFeatures: 0,
2825 optimalTilingFeatures: 0,
2828 api::VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 => api::VkFormatProperties {
2830 linearTilingFeatures: 0,
2831 optimalTilingFeatures: 0,
2834 api::VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 => api::VkFormatProperties {
2836 linearTilingFeatures: 0,
2837 optimalTilingFeatures: 0,
2840 api::VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 => api::VkFormatProperties {
2842 linearTilingFeatures: 0,
2843 optimalTilingFeatures: 0,
2846 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
2848 linearTilingFeatures: 0,
2849 optimalTilingFeatures: 0,
2852 api::VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
2854 linearTilingFeatures: 0,
2855 optimalTilingFeatures: 0,
2858 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
2860 linearTilingFeatures: 0,
2861 optimalTilingFeatures: 0,
2864 api::VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
2866 linearTilingFeatures: 0,
2867 optimalTilingFeatures: 0,
2870 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 => api::VkFormatProperties {
2872 linearTilingFeatures: 0,
2873 optimalTilingFeatures: 0,
2876 api::VK_FORMAT_G16B16G16R16_422_UNORM => api::VkFormatProperties {
2878 linearTilingFeatures: 0,
2879 optimalTilingFeatures: 0,
2882 api::VK_FORMAT_B16G16R16G16_422_UNORM => api::VkFormatProperties {
2884 linearTilingFeatures: 0,
2885 optimalTilingFeatures: 0,
2888 api::VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM => api::VkFormatProperties {
2890 linearTilingFeatures: 0,
2891 optimalTilingFeatures: 0,
2894 api::VK_FORMAT_G16_B16R16_2PLANE_420_UNORM => api::VkFormatProperties {
2896 linearTilingFeatures: 0,
2897 optimalTilingFeatures: 0,
2900 api::VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM => api::VkFormatProperties {
2902 linearTilingFeatures: 0,
2903 optimalTilingFeatures: 0,
2906 api::VK_FORMAT_G16_B16R16_2PLANE_422_UNORM => api::VkFormatProperties {
2908 linearTilingFeatures: 0,
2909 optimalTilingFeatures: 0,
2912 api::VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM => api::VkFormatProperties {
2914 linearTilingFeatures: 0,
2915 optimalTilingFeatures: 0,
2918 _ => panic!("unknown format {}", format),
2923 pub struct Instance {
2924 physical_device: OwnedHandle<api::VkPhysicalDevice>,
2929 create_info: *const api::VkInstanceCreateInfo,
2930 ) -> Result<api::VkInstance, api::VkResult> {
2931 parse_next_chain_const! {
2933 root = api::VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
2935 let create_info = &*create_info;
2936 if create_info.enabledLayerCount != 0 {
2937 return Err(api::VK_ERROR_LAYER_NOT_PRESENT);
2939 let mut enabled_extensions = Extensions::create_empty();
2940 for &extension_name in util::to_slice(
2941 create_info.ppEnabledExtensionNames,
2942 create_info.enabledExtensionCount as usize,
2944 let extension: Extension = CStr::from_ptr(extension_name)
2946 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?
2948 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?;
2949 assert_eq!(extension.get_scope(), ExtensionScope::Instance);
2950 enabled_extensions[extension] = true;
2952 for extension in enabled_extensions
2954 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
2956 let missing_extensions = extension.get_required_extensions() & !enabled_extensions;
2957 for missing_extension in missing_extensions
2959 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
2962 "extension {} enabled but required extension {} is not enabled",
2963 extension.get_name(),
2964 missing_extension.get_name()
2968 let system_memory_size;
2969 match sys_info::mem_info() {
2971 eprintln!("mem_info error: {}", error);
2972 return Err(api::VK_ERROR_INITIALIZATION_FAILED);
2974 Ok(info) => system_memory_size = info.total * 1024,
2976 let mut device_name = [0; api::VK_MAX_PHYSICAL_DEVICE_NAME_SIZE as usize];
2977 util::copy_str_to_char_array(&mut device_name, KAZAN_DEVICE_NAME);
2978 #[cfg_attr(feature = "cargo-clippy", allow(clippy::needless_update))]
2979 let retval = OwnedHandle::<api::VkInstance>::new(Instance {
2980 physical_device: OwnedHandle::new(PhysicalDevice {
2982 allowed_extensions: enabled_extensions.get_allowed_extensions_from_instance_scope(),
2983 properties: api::VkPhysicalDeviceProperties {
2984 apiVersion: make_api_version(1, 1, api::VK_HEADER_VERSION),
2985 driverVersion: make_api_version(
2986 env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(),
2987 env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(),
2988 env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(),
2990 vendorID: api::VK_VENDOR_ID_KAZAN,
2992 deviceType: api::VK_PHYSICAL_DEVICE_TYPE_CPU,
2993 deviceName: device_name,
2994 pipelineCacheUUID: *PhysicalDevice::get_pipeline_cache_uuid().as_bytes(),
2995 limits: PhysicalDevice::get_limits(),
2996 sparseProperties: api::VkPhysicalDeviceSparseProperties {
2997 residencyStandard2DBlockShape: api::VK_FALSE,
2998 residencyStandard2DMultisampleBlockShape: api::VK_FALSE,
2999 residencyStandard3DBlockShape: api::VK_FALSE,
3000 residencyAlignedMipSize: api::VK_FALSE,
3001 residencyNonResidentStrict: api::VK_FALSE,
3003 ..mem::zeroed() // for padding fields
3005 features: Features::new(),
3007 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties {
3008 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES,
3010 pointClippingBehavior: api::VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES,
3012 multiview_properties: api::VkPhysicalDeviceMultiviewProperties {
3013 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
3015 maxMultiviewViewCount: 6,
3016 maxMultiviewInstanceIndex: !0,
3018 id_properties: api::VkPhysicalDeviceIDProperties {
3019 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES,
3021 deviceUUID: *PhysicalDevice::get_device_uuid().as_bytes(),
3022 driverUUID: *PhysicalDevice::get_driver_uuid().as_bytes(),
3023 deviceLUID: [0; api::VK_LUID_SIZE as usize],
3025 deviceLUIDValid: api::VK_FALSE,
3027 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties {
3028 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
3030 maxPerSetDescriptors: !0,
3031 maxMemoryAllocationSize: isize::max_value() as u64,
3032 ..mem::zeroed() // for padding fields
3034 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties {
3035 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES,
3037 protectedNoFault: api::VK_FALSE,
3039 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties {
3040 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES,
3042 subgroupSize: 1, // FIXME fill in correct value
3043 supportedStages: api::VK_SHADER_STAGE_COMPUTE_BIT,
3044 supportedOperations: api::VK_SUBGROUP_FEATURE_BASIC_BIT,
3045 quadOperationsInAllStages: api::VK_FALSE,
3053 #[allow(non_snake_case)]
3054 pub unsafe extern "system" fn vkGetInstanceProcAddr(
3055 instance: api::VkInstance,
3056 name: *const c_char,
3057 ) -> api::PFN_vkVoidFunction {
3058 match instance.get() {
3059 Some(_) => get_proc_address(
3061 GetProcAddressScope::Instance,
3062 &SharedHandle::from(instance)
3065 .allowed_extensions,
3067 None => get_proc_address(
3069 GetProcAddressScope::Global,
3070 &Extensions::create_empty(),
3075 pub fn make_api_version(major: u32, minor: u32, patch: u32) -> u32 {
3076 assert!(major < (1 << 10));
3077 assert!(minor < (1 << 10));
3078 assert!(patch < (1 << 12));
3079 (major << 22) | (minor << 12) | patch
3082 #[allow(non_snake_case)]
3083 pub unsafe extern "system" fn vkEnumerateInstanceVersion(api_version: *mut u32) -> api::VkResult {
3084 *api_version = make_api_version(1, 1, api::VK_HEADER_VERSION);
3088 pub unsafe fn enumerate_helper<T, Item, I: IntoIterator<Item = Item>, AF: FnMut(&mut T, Item)>(
3089 api_value_count: *mut u32,
3092 mut assign_function: AF,
3093 ) -> api::VkResult {
3094 let mut retval = api::VK_SUCCESS;
3095 let mut api_values = if api_values.is_null() {
3098 Some(util::to_slice_mut(api_values, *api_value_count as usize))
3100 let mut final_count = 0;
3101 for value in values {
3102 if let Some(api_values) = &mut api_values {
3103 if final_count >= api_values.len() {
3104 retval = api::VK_INCOMPLETE;
3107 assign_function(&mut api_values[final_count], value);
3114 assert_eq!(final_count as u32 as usize, final_count);
3115 *api_value_count = final_count as u32;
3119 #[allow(non_snake_case)]
3120 pub unsafe extern "system" fn vkEnumerateInstanceLayerProperties(
3121 property_count: *mut u32,
3122 properties: *mut api::VkLayerProperties,
3123 ) -> api::VkResult {
3124 enumerate_helper(property_count, properties, &[], |l, r| *l = *r)
3127 #[allow(non_snake_case)]
3128 pub unsafe extern "system" fn vkEnumerateInstanceExtensionProperties(
3129 layer_name: *const c_char,
3130 property_count: *mut u32,
3131 properties: *mut api::VkExtensionProperties,
3132 ) -> api::VkResult {
3133 enumerate_extension_properties(
3137 ExtensionScope::Instance,
3141 #[allow(non_snake_case)]
3142 pub unsafe extern "system" fn vkCreateInstance(
3143 create_info: *const api::VkInstanceCreateInfo,
3144 _allocator: *const api::VkAllocationCallbacks,
3145 instance: *mut api::VkInstance,
3146 ) -> api::VkResult {
3147 *instance = Handle::null();
3148 match Instance::new(create_info) {
3153 Err(error) => error,
3157 #[allow(non_snake_case)]
3158 pub unsafe extern "system" fn vkDestroyInstance(
3159 instance: api::VkInstance,
3160 _allocator: *const api::VkAllocationCallbacks,
3162 OwnedHandle::from(instance);
3165 #[allow(non_snake_case)]
3166 pub unsafe extern "system" fn vkEnumeratePhysicalDevices(
3167 instance: api::VkInstance,
3168 physical_device_count: *mut u32,
3169 physical_devices: *mut api::VkPhysicalDevice,
3170 ) -> api::VkResult {
3171 let instance = SharedHandle::from(instance).unwrap();
3173 physical_device_count,
3175 iter::once(instance.physical_device.get_handle()),
3180 #[allow(non_snake_case)]
3181 pub unsafe extern "system" fn vkGetPhysicalDeviceFeatures(
3182 physical_device: api::VkPhysicalDevice,
3183 features: *mut api::VkPhysicalDeviceFeatures,
3185 let mut v = api::VkPhysicalDeviceFeatures2 {
3186 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
3188 features: mem::zeroed(),
3190 vkGetPhysicalDeviceFeatures2(physical_device, &mut v);
3191 *features = v.features;
3194 #[allow(non_snake_case)]
3195 pub unsafe extern "system" fn vkGetPhysicalDeviceFormatProperties(
3196 physical_device: api::VkPhysicalDevice,
3197 format: api::VkFormat,
3198 format_properties: *mut api::VkFormatProperties,
3200 let mut format_properties2 = api::VkFormatProperties2 {
3201 sType: api::VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
3203 formatProperties: mem::zeroed(),
3205 vkGetPhysicalDeviceFormatProperties2(physical_device, format, &mut format_properties2);
3206 *format_properties = format_properties2.formatProperties;
3209 #[allow(non_snake_case)]
3210 pub unsafe extern "system" fn vkGetPhysicalDeviceImageFormatProperties(
3211 _physicalDevice: api::VkPhysicalDevice,
3212 _format: api::VkFormat,
3213 _type_: api::VkImageType,
3214 _tiling: api::VkImageTiling,
3215 _usage: api::VkImageUsageFlags,
3216 _flags: api::VkImageCreateFlags,
3217 _pImageFormatProperties: *mut api::VkImageFormatProperties,
3218 ) -> api::VkResult {
3222 #[allow(non_snake_case)]
3223 pub unsafe extern "system" fn vkGetPhysicalDeviceProperties(
3224 physical_device: api::VkPhysicalDevice,
3225 properties: *mut api::VkPhysicalDeviceProperties,
3227 let physical_device = SharedHandle::from(physical_device).unwrap();
3228 *properties = physical_device.properties;
3231 unsafe fn get_physical_device_queue_family_properties(
3232 _physical_device: SharedHandle<api::VkPhysicalDevice>,
3233 queue_family_properties: &mut api::VkQueueFamilyProperties2,
3236 parse_next_chain_mut! {
3237 queue_family_properties,
3238 root = api::VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2,
3240 queue_family_properties.queueFamilyProperties = api::VkQueueFamilyProperties {
3241 queueFlags: api::VK_QUEUE_GRAPHICS_BIT
3242 | api::VK_QUEUE_COMPUTE_BIT
3243 | api::VK_QUEUE_TRANSFER_BIT,
3244 queueCount: queue_count,
3245 timestampValidBits: 0,
3246 minImageTransferGranularity: api::VkExtent3D {
3254 #[allow(non_snake_case)]
3255 pub unsafe extern "system" fn vkGetPhysicalDeviceQueueFamilyProperties(
3256 physical_device: api::VkPhysicalDevice,
3257 queue_family_property_count: *mut u32,
3258 queue_family_properties: *mut api::VkQueueFamilyProperties,
3261 queue_family_property_count,
3262 queue_family_properties,
3263 QUEUE_COUNTS.iter(),
3264 |queue_family_properties, &count| {
3265 let mut queue_family_properties2 = api::VkQueueFamilyProperties2 {
3266 sType: api::VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2,
3268 queueFamilyProperties: mem::zeroed(),
3270 get_physical_device_queue_family_properties(
3271 SharedHandle::from(physical_device).unwrap(),
3272 &mut queue_family_properties2,
3275 *queue_family_properties = queue_family_properties2.queueFamilyProperties;
3280 #[allow(non_snake_case)]
3281 pub unsafe extern "system" fn vkGetPhysicalDeviceMemoryProperties(
3282 physical_device: api::VkPhysicalDevice,
3283 memory_properties: *mut api::VkPhysicalDeviceMemoryProperties,
3285 let mut memory_properties2 = api::VkPhysicalDeviceMemoryProperties2 {
3286 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
3288 memoryProperties: mem::zeroed(),
3290 vkGetPhysicalDeviceMemoryProperties2(physical_device, &mut memory_properties2);
3291 *memory_properties = memory_properties2.memoryProperties;
3294 #[allow(non_snake_case)]
3295 pub unsafe extern "system" fn vkGetDeviceProcAddr(
3296 device: api::VkDevice,
3297 name: *const c_char,
3298 ) -> api::PFN_vkVoidFunction {
3301 GetProcAddressScope::Device,
3302 &SharedHandle::from(device).unwrap().extensions,
3306 #[allow(non_snake_case)]
3307 pub unsafe extern "system" fn vkCreateDevice(
3308 physical_device: api::VkPhysicalDevice,
3309 create_info: *const api::VkDeviceCreateInfo,
3310 _allocator: *const api::VkAllocationCallbacks,
3311 device: *mut api::VkDevice,
3312 ) -> api::VkResult {
3313 *device = Handle::null();
3314 match Device::new(SharedHandle::from(physical_device).unwrap(), create_info) {
3319 Err(error) => error,
3323 #[allow(non_snake_case)]
3324 pub unsafe extern "system" fn vkDestroyDevice(
3325 device: api::VkDevice,
3326 _allocator: *const api::VkAllocationCallbacks,
3328 OwnedHandle::from(device);
3331 unsafe fn enumerate_extension_properties(
3332 layer_name: *const c_char,
3333 property_count: *mut u32,
3334 properties: *mut api::VkExtensionProperties,
3335 extension_scope: ExtensionScope,
3336 ) -> api::VkResult {
3337 if !layer_name.is_null() {
3338 return api::VK_ERROR_LAYER_NOT_PRESENT;
3343 Extensions::default().iter().filter_map(
3344 |(extension, _): (Extension, _)| -> Option<api::VkExtensionProperties> {
3345 if extension.get_scope() == extension_scope {
3346 Some(extension.get_properties())
3356 #[allow(non_snake_case)]
3357 pub unsafe extern "system" fn vkEnumerateDeviceExtensionProperties(
3358 _physical_device: api::VkPhysicalDevice,
3359 layer_name: *const c_char,
3360 property_count: *mut u32,
3361 properties: *mut api::VkExtensionProperties,
3362 ) -> api::VkResult {
3363 enumerate_extension_properties(
3367 ExtensionScope::Device,
3371 #[allow(non_snake_case)]
3372 pub unsafe extern "system" fn vkEnumerateDeviceLayerProperties(
3373 _physicalDevice: api::VkPhysicalDevice,
3374 _pPropertyCount: *mut u32,
3375 _pProperties: *mut api::VkLayerProperties,
3376 ) -> api::VkResult {
3380 #[allow(non_snake_case)]
3381 pub unsafe extern "system" fn vkGetDeviceQueue(
3382 device: api::VkDevice,
3383 queue_family_index: u32,
3385 queue: *mut api::VkQueue,
3389 &api::VkDeviceQueueInfo2 {
3390 sType: api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
3393 queueFamilyIndex: queue_family_index,
3394 queueIndex: queue_index,
3400 #[allow(non_snake_case)]
3401 pub unsafe extern "system" fn vkQueueSubmit(
3402 _queue: api::VkQueue,
3404 _pSubmits: *const api::VkSubmitInfo,
3405 _fence: api::VkFence,
3406 ) -> api::VkResult {
3410 #[allow(non_snake_case)]
3411 pub unsafe extern "system" fn vkQueueWaitIdle(_queue: api::VkQueue) -> api::VkResult {
3415 #[allow(non_snake_case)]
3416 pub unsafe extern "system" fn vkDeviceWaitIdle(_device: api::VkDevice) -> api::VkResult {
3420 #[allow(non_snake_case)]
3421 pub unsafe extern "system" fn vkAllocateMemory(
3422 _device: api::VkDevice,
3423 allocate_info: *const api::VkMemoryAllocateInfo,
3424 _allocator: *const api::VkAllocationCallbacks,
3425 memory: *mut api::VkDeviceMemory,
3426 ) -> api::VkResult {
3427 parse_next_chain_const! {
3429 root = api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
3430 export_memory_allocate_info: api::VkExportMemoryAllocateInfo = api::VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
3431 memory_allocate_flags_info: api::VkMemoryAllocateFlagsInfo = api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO,
3432 memory_dedicated_allocate_info: api::VkMemoryDedicatedAllocateInfo = api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
3434 let allocate_info = &*allocate_info;
3435 if !export_memory_allocate_info.is_null() {
3438 if !memory_allocate_flags_info.is_null() {
3441 if !memory_dedicated_allocate_info.is_null() {
3444 match DeviceMemoryType::from_index(allocate_info.memoryTypeIndex).unwrap() {
3445 DeviceMemoryType::Main => {
3446 if allocate_info.allocationSize > isize::max_value() as u64 {
3447 return api::VK_ERROR_OUT_OF_DEVICE_MEMORY;
3449 match DeviceMemory::allocate_from_default_heap(DeviceMemoryLayout::calculate(
3450 allocate_info.allocationSize as usize,
3451 MIN_MEMORY_MAP_ALIGNMENT,
3454 *memory = OwnedHandle::<api::VkDeviceMemory>::new(new_memory).take();
3457 Err(_) => api::VK_ERROR_OUT_OF_DEVICE_MEMORY,
3463 #[allow(non_snake_case)]
3464 pub unsafe extern "system" fn vkFreeMemory(
3465 _device: api::VkDevice,
3466 memory: api::VkDeviceMemory,
3467 _allocator: *const api::VkAllocationCallbacks,
3469 if !memory.is_null() {
3470 OwnedHandle::from(memory);
3474 #[allow(non_snake_case)]
3475 pub unsafe extern "system" fn vkMapMemory(
3476 _device: api::VkDevice,
3477 memory: api::VkDeviceMemory,
3478 offset: api::VkDeviceSize,
3479 _size: api::VkDeviceSize,
3480 _flags: api::VkMemoryMapFlags,
3481 data: *mut *mut c_void,
3482 ) -> api::VkResult {
3483 let memory = SharedHandle::from(memory).unwrap();
3484 // remember to keep vkUnmapMemory up to date
3485 *data = memory.get().as_ptr().offset(offset as isize) as *mut c_void;
3489 #[allow(non_snake_case)]
3490 pub unsafe extern "system" fn vkUnmapMemory(_device: api::VkDevice, _memory: api::VkDeviceMemory) {}
3492 #[allow(non_snake_case)]
3493 pub unsafe extern "system" fn vkFlushMappedMemoryRanges(
3494 _device: api::VkDevice,
3495 _memoryRangeCount: u32,
3496 _pMemoryRanges: *const api::VkMappedMemoryRange,
3497 ) -> api::VkResult {
3501 #[allow(non_snake_case)]
3502 pub unsafe extern "system" fn vkInvalidateMappedMemoryRanges(
3503 _device: api::VkDevice,
3504 _memoryRangeCount: u32,
3505 _pMemoryRanges: *const api::VkMappedMemoryRange,
3506 ) -> api::VkResult {
3510 #[allow(non_snake_case)]
3511 pub unsafe extern "system" fn vkGetDeviceMemoryCommitment(
3512 _device: api::VkDevice,
3513 _memory: api::VkDeviceMemory,
3514 _pCommittedMemoryInBytes: *mut api::VkDeviceSize,
3519 #[allow(non_snake_case)]
3520 pub unsafe extern "system" fn vkBindBufferMemory(
3521 device: api::VkDevice,
3522 buffer: api::VkBuffer,
3523 memory: api::VkDeviceMemory,
3524 memory_offset: api::VkDeviceSize,
3525 ) -> api::VkResult {
3526 vkBindBufferMemory2(
3529 &api::VkBindBufferMemoryInfo {
3530 sType: api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
3534 memoryOffset: memory_offset,
3539 #[allow(non_snake_case)]
3540 pub unsafe extern "system" fn vkBindImageMemory(
3541 device: api::VkDevice,
3542 image: api::VkImage,
3543 memory: api::VkDeviceMemory,
3544 memory_offset: api::VkDeviceSize,
3545 ) -> api::VkResult {
3549 &api::VkBindImageMemoryInfo {
3550 sType: api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
3554 memoryOffset: memory_offset,
3559 #[allow(non_snake_case)]
3560 pub unsafe extern "system" fn vkGetBufferMemoryRequirements(
3561 device: api::VkDevice,
3562 buffer: api::VkBuffer,
3563 memory_requirements: *mut api::VkMemoryRequirements,
3565 let mut memory_requirements_2 = api::VkMemoryRequirements2 {
3566 sType: api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
3568 memoryRequirements: mem::zeroed(),
3570 vkGetBufferMemoryRequirements2(
3572 &api::VkBufferMemoryRequirementsInfo2 {
3573 sType: api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
3577 &mut memory_requirements_2,
3579 *memory_requirements = memory_requirements_2.memoryRequirements;
3582 #[allow(non_snake_case)]
3583 pub unsafe extern "system" fn vkGetImageMemoryRequirements(
3584 device: api::VkDevice,
3585 image: api::VkImage,
3586 memory_requirements: *mut api::VkMemoryRequirements,
3588 let mut memory_requirements_2 = api::VkMemoryRequirements2 {
3589 sType: api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
3591 memoryRequirements: mem::zeroed(),
3593 vkGetImageMemoryRequirements2(
3595 &api::VkImageMemoryRequirementsInfo2 {
3596 sType: api::VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
3600 &mut memory_requirements_2,
3602 *memory_requirements = memory_requirements_2.memoryRequirements;
3605 #[allow(non_snake_case)]
3606 pub unsafe extern "system" fn vkGetImageSparseMemoryRequirements(
3607 _device: api::VkDevice,
3608 _image: api::VkImage,
3609 _pSparseMemoryRequirementCount: *mut u32,
3610 _pSparseMemoryRequirements: *mut api::VkSparseImageMemoryRequirements,
3615 #[allow(non_snake_case)]
3616 pub unsafe extern "system" fn vkGetPhysicalDeviceSparseImageFormatProperties(
3617 _physicalDevice: api::VkPhysicalDevice,
3618 _format: api::VkFormat,
3619 _type_: api::VkImageType,
3620 _samples: api::VkSampleCountFlagBits,
3621 _usage: api::VkImageUsageFlags,
3622 _tiling: api::VkImageTiling,
3623 _pPropertyCount: *mut u32,
3624 _pProperties: *mut api::VkSparseImageFormatProperties,
3629 #[allow(non_snake_case)]
3630 pub unsafe extern "system" fn vkQueueBindSparse(
3631 _queue: api::VkQueue,
3632 _bindInfoCount: u32,
3633 _pBindInfo: *const api::VkBindSparseInfo,
3634 _fence: api::VkFence,
3635 ) -> api::VkResult {
3639 #[allow(non_snake_case)]
3640 pub unsafe extern "system" fn vkCreateFence(
3641 _device: api::VkDevice,
3642 _pCreateInfo: *const api::VkFenceCreateInfo,
3643 _pAllocator: *const api::VkAllocationCallbacks,
3644 _pFence: *mut api::VkFence,
3645 ) -> api::VkResult {
3649 #[allow(non_snake_case)]
3650 pub unsafe extern "system" fn vkDestroyFence(
3651 _device: api::VkDevice,
3652 _fence: api::VkFence,
3653 _pAllocator: *const api::VkAllocationCallbacks,
3658 #[allow(non_snake_case)]
3659 pub unsafe extern "system" fn vkResetFences(
3660 _device: api::VkDevice,
3662 _pFences: *const api::VkFence,
3663 ) -> api::VkResult {
3667 #[allow(non_snake_case)]
3668 pub unsafe extern "system" fn vkGetFenceStatus(
3669 _device: api::VkDevice,
3670 _fence: api::VkFence,
3671 ) -> api::VkResult {
3675 #[allow(non_snake_case)]
3676 pub unsafe extern "system" fn vkWaitForFences(
3677 _device: api::VkDevice,
3679 _pFences: *const api::VkFence,
3680 _waitAll: api::VkBool32,
3682 ) -> api::VkResult {
3686 #[allow(non_snake_case)]
3687 pub unsafe extern "system" fn vkCreateSemaphore(
3688 _device: api::VkDevice,
3689 _pCreateInfo: *const api::VkSemaphoreCreateInfo,
3690 _pAllocator: *const api::VkAllocationCallbacks,
3691 _pSemaphore: *mut api::VkSemaphore,
3692 ) -> api::VkResult {
3696 #[allow(non_snake_case)]
3697 pub unsafe extern "system" fn vkDestroySemaphore(
3698 _device: api::VkDevice,
3699 _semaphore: api::VkSemaphore,
3700 _pAllocator: *const api::VkAllocationCallbacks,
3705 #[allow(non_snake_case)]
3706 pub unsafe extern "system" fn vkCreateEvent(
3707 _device: api::VkDevice,
3708 _pCreateInfo: *const api::VkEventCreateInfo,
3709 _pAllocator: *const api::VkAllocationCallbacks,
3710 _pEvent: *mut api::VkEvent,
3711 ) -> api::VkResult {
3715 #[allow(non_snake_case)]
3716 pub unsafe extern "system" fn vkDestroyEvent(
3717 _device: api::VkDevice,
3718 _event: api::VkEvent,
3719 _pAllocator: *const api::VkAllocationCallbacks,
3724 #[allow(non_snake_case)]
3725 pub unsafe extern "system" fn vkGetEventStatus(
3726 _device: api::VkDevice,
3727 _event: api::VkEvent,
3728 ) -> api::VkResult {
3732 #[allow(non_snake_case)]
3733 pub unsafe extern "system" fn vkSetEvent(
3734 _device: api::VkDevice,
3735 _event: api::VkEvent,
3736 ) -> api::VkResult {
3740 #[allow(non_snake_case)]
3741 pub unsafe extern "system" fn vkResetEvent(
3742 _device: api::VkDevice,
3743 _event: api::VkEvent,
3744 ) -> api::VkResult {
3748 #[allow(non_snake_case)]
3749 pub unsafe extern "system" fn vkCreateQueryPool(
3750 _device: api::VkDevice,
3751 _pCreateInfo: *const api::VkQueryPoolCreateInfo,
3752 _pAllocator: *const api::VkAllocationCallbacks,
3753 _pQueryPool: *mut api::VkQueryPool,
3754 ) -> api::VkResult {
3758 #[allow(non_snake_case)]
3759 pub unsafe extern "system" fn vkDestroyQueryPool(
3760 _device: api::VkDevice,
3761 _queryPool: api::VkQueryPool,
3762 _pAllocator: *const api::VkAllocationCallbacks,
3767 #[allow(non_snake_case)]
3768 pub unsafe extern "system" fn vkGetQueryPoolResults(
3769 _device: api::VkDevice,
3770 _queryPool: api::VkQueryPool,
3774 _pData: *mut c_void,
3775 _stride: api::VkDeviceSize,
3776 _flags: api::VkQueryResultFlags,
3777 ) -> api::VkResult {
3781 #[allow(non_snake_case)]
3782 pub unsafe extern "system" fn vkCreateBuffer(
3783 _device: api::VkDevice,
3784 create_info: *const api::VkBufferCreateInfo,
3785 _allocator: *const api::VkAllocationCallbacks,
3786 buffer: *mut api::VkBuffer,
3787 ) -> api::VkResult {
3788 parse_next_chain_const! {
3790 root = api::VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
3791 external_memory_buffer: api::VkExternalMemoryBufferCreateInfo = api::VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO,
3793 let create_info = &*create_info;
3794 if !external_memory_buffer.is_null() {
3795 let external_memory_buffer = &*external_memory_buffer;
3796 assert_eq!(external_memory_buffer.handleTypes, 0);
3798 if create_info.size > isize::max_value() as u64 {
3799 return api::VK_ERROR_OUT_OF_DEVICE_MEMORY;
3801 *buffer = OwnedHandle::<api::VkBuffer>::new(Buffer {
3802 size: create_info.size as usize,
3809 #[allow(non_snake_case)]
3810 pub unsafe extern "system" fn vkDestroyBuffer(
3811 _device: api::VkDevice,
3812 buffer: api::VkBuffer,
3813 _allocator: *const api::VkAllocationCallbacks,
3815 OwnedHandle::from(buffer);
3818 #[allow(non_snake_case)]
3819 pub unsafe extern "system" fn vkCreateBufferView(
3820 _device: api::VkDevice,
3821 _pCreateInfo: *const api::VkBufferViewCreateInfo,
3822 _pAllocator: *const api::VkAllocationCallbacks,
3823 _pView: *mut api::VkBufferView,
3824 ) -> api::VkResult {
3828 #[allow(non_snake_case)]
3829 pub unsafe extern "system" fn vkDestroyBufferView(
3830 _device: api::VkDevice,
3831 _bufferView: api::VkBufferView,
3832 _pAllocator: *const api::VkAllocationCallbacks,
3837 #[allow(non_snake_case)]
3838 pub unsafe extern "system" fn vkCreateImage(
3839 _device: api::VkDevice,
3840 create_info: *const api::VkImageCreateInfo,
3841 _allocator: *const api::VkAllocationCallbacks,
3842 image: *mut api::VkImage,
3843 ) -> api::VkResult {
3844 parse_next_chain_const! {
3846 root = api::VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
3847 external_memory_image_create_info: api::VkExternalMemoryImageCreateInfo = api::VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
3848 image_swapchain_create_info: api::VkImageSwapchainCreateInfoKHR = api::VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR,
3850 let create_info = &*create_info;
3851 if !external_memory_image_create_info.is_null() {
3854 if !image_swapchain_create_info.is_null() {
3857 *image = OwnedHandle::<api::VkImage>::new(Image {
3858 properties: ImageProperties {
3859 supported_tilings: match create_info.tiling {
3860 api::VK_IMAGE_TILING_OPTIMAL => SupportedTilings::Any,
3861 api::VK_IMAGE_TILING_LINEAR => SupportedTilings::LinearOnly,
3862 _ => unreachable!("invalid image tiling"),
3864 format: create_info.format,
3865 extents: create_info.extent,
3866 array_layers: create_info.arrayLayers,
3867 mip_levels: create_info.mipLevels,
3868 multisample_count: match create_info.samples {
3869 api::VK_SAMPLE_COUNT_1_BIT => ImageMultisampleCount::Count1,
3870 api::VK_SAMPLE_COUNT_4_BIT => ImageMultisampleCount::Count4,
3871 _ => unreachable!("invalid sample count"),
3873 swapchain_present_tiling: None,
3881 #[allow(non_snake_case)]
3882 pub unsafe extern "system" fn vkDestroyImage(
3883 _device: api::VkDevice,
3884 image: api::VkImage,
3885 _allocator: *const api::VkAllocationCallbacks,
3887 OwnedHandle::from(image);
3890 #[allow(non_snake_case)]
3891 pub unsafe extern "system" fn vkGetImageSubresourceLayout(
3892 _device: api::VkDevice,
3893 _image: api::VkImage,
3894 _pSubresource: *const api::VkImageSubresource,
3895 _pLayout: *mut api::VkSubresourceLayout,
3900 #[allow(non_snake_case)]
3901 pub unsafe extern "system" fn vkCreateImageView(
3902 _device: api::VkDevice,
3903 create_info: *const api::VkImageViewCreateInfo,
3904 _allocator: *const api::VkAllocationCallbacks,
3905 view: *mut api::VkImageView,
3906 ) -> api::VkResult {
3907 parse_next_chain_const! {
3909 root = api::VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
3911 let create_info = &*create_info;
3912 let new_view = OwnedHandle::<api::VkImageView>::new(ImageView {
3913 image: SharedHandle::from(create_info.image).unwrap(),
3914 view_type: ImageViewType::from(create_info.viewType),
3915 format: create_info.format,
3916 component_mapping: ComponentMapping::from(create_info.components).unwrap(),
3917 subresource_range: create_info.subresourceRange,
3919 *view = new_view.take();
3923 #[allow(non_snake_case)]
3924 pub unsafe extern "system" fn vkDestroyImageView(
3925 _device: api::VkDevice,
3926 image_view: api::VkImageView,
3927 _allocator: *const api::VkAllocationCallbacks,
3929 OwnedHandle::from(image_view);
3932 #[allow(non_snake_case)]
3933 pub unsafe extern "system" fn vkCreateShaderModule(
3934 _device: api::VkDevice,
3935 create_info: *const api::VkShaderModuleCreateInfo,
3936 _allocator: *const api::VkAllocationCallbacks,
3937 shader_module: *mut api::VkShaderModule,
3938 ) -> api::VkResult {
3939 parse_next_chain_const! {
3941 root = api::VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
3943 let create_info = &*create_info;
3944 const U32_BYTE_COUNT: usize = 4;
3945 assert_eq!(U32_BYTE_COUNT, mem::size_of::<u32>());
3946 assert_eq!(create_info.codeSize % U32_BYTE_COUNT, 0);
3947 assert_ne!(create_info.codeSize, 0);
3948 let code = util::to_slice(create_info.pCode, create_info.codeSize / U32_BYTE_COUNT);
3949 *shader_module = OwnedHandle::<api::VkShaderModule>::new(ShaderModule {
3950 code: code.to_owned(),
3956 #[allow(non_snake_case)]
3957 pub unsafe extern "system" fn vkDestroyShaderModule(
3958 _device: api::VkDevice,
3959 shader_module: api::VkShaderModule,
3960 _allocator: *const api::VkAllocationCallbacks,
3962 OwnedHandle::from(shader_module);
3965 #[allow(non_snake_case)]
3966 pub unsafe extern "system" fn vkCreatePipelineCache(
3967 _device: api::VkDevice,
3968 _pCreateInfo: *const api::VkPipelineCacheCreateInfo,
3969 _pAllocator: *const api::VkAllocationCallbacks,
3970 _pPipelineCache: *mut api::VkPipelineCache,
3971 ) -> api::VkResult {
3975 #[allow(non_snake_case)]
3976 pub unsafe extern "system" fn vkDestroyPipelineCache(
3977 _device: api::VkDevice,
3978 _pipelineCache: api::VkPipelineCache,
3979 _pAllocator: *const api::VkAllocationCallbacks,
3984 #[allow(non_snake_case)]
3985 pub unsafe extern "system" fn vkGetPipelineCacheData(
3986 _device: api::VkDevice,
3987 _pipelineCache: api::VkPipelineCache,
3988 _pDataSize: *mut usize,
3989 _pData: *mut c_void,
3990 ) -> api::VkResult {
3994 #[allow(non_snake_case)]
3995 pub unsafe extern "system" fn vkMergePipelineCaches(
3996 _device: api::VkDevice,
3997 _dstCache: api::VkPipelineCache,
3998 _srcCacheCount: u32,
3999 _pSrcCaches: *const api::VkPipelineCache,
4000 ) -> api::VkResult {
4004 #[allow(non_snake_case)]
4005 pub unsafe extern "system" fn vkCreateGraphicsPipelines(
4006 device: api::VkDevice,
4007 pipeline_cache: api::VkPipelineCache,
4008 create_info_count: u32,
4009 create_infos: *const api::VkGraphicsPipelineCreateInfo,
4010 _allocator: *const api::VkAllocationCallbacks,
4011 pipelines: *mut api::VkPipeline,
4012 ) -> api::VkResult {
4013 pipeline::create_pipelines::<pipeline::GraphicsPipeline>(
4014 SharedHandle::from(device).unwrap(),
4015 SharedHandle::from(pipeline_cache),
4016 util::to_slice(create_infos, create_info_count as usize),
4017 util::to_slice_mut(pipelines, create_info_count as usize),
4021 #[allow(non_snake_case)]
4022 pub unsafe extern "system" fn vkCreateComputePipelines(
4023 device: api::VkDevice,
4024 pipeline_cache: api::VkPipelineCache,
4025 create_info_count: u32,
4026 create_infos: *const api::VkComputePipelineCreateInfo,
4027 _allocator: *const api::VkAllocationCallbacks,
4028 pipelines: *mut api::VkPipeline,
4029 ) -> api::VkResult {
4030 pipeline::create_pipelines::<pipeline::ComputePipeline>(
4031 SharedHandle::from(device).unwrap(),
4032 SharedHandle::from(pipeline_cache),
4033 util::to_slice(create_infos, create_info_count as usize),
4034 util::to_slice_mut(pipelines, create_info_count as usize),
4038 #[allow(non_snake_case)]
4039 pub unsafe extern "system" fn vkDestroyPipeline(
4040 _device: api::VkDevice,
4041 pipeline: api::VkPipeline,
4042 _allocator: *const api::VkAllocationCallbacks,
4044 OwnedHandle::from(pipeline);
4047 #[allow(non_snake_case)]
4048 pub unsafe extern "system" fn vkCreatePipelineLayout(
4049 _device: api::VkDevice,
4050 create_info: *const api::VkPipelineLayoutCreateInfo,
4051 _allocator: *const api::VkAllocationCallbacks,
4052 pipeline_layout: *mut api::VkPipelineLayout,
4053 ) -> api::VkResult {
4054 parse_next_chain_const! {
4056 root = api::VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
4058 let create_info = &*create_info;
4059 let set_layouts = util::to_slice(create_info.pSetLayouts, create_info.setLayoutCount as usize);
4060 let push_constant_ranges = util::to_slice(
4061 create_info.pPushConstantRanges,
4062 create_info.pushConstantRangeCount as usize,
4064 let push_constants_size = push_constant_ranges
4066 .map(|v| v.size as usize + v.offset as usize)
4069 let descriptor_set_layouts: Vec<_> = set_layouts
4071 .map(|v| SharedHandle::from(*v).unwrap())
4073 let shader_compiler_pipeline_layout = shader_compiler::PipelineLayout {
4074 push_constants_size,
4075 descriptor_sets: descriptor_set_layouts
4078 |descriptor_set_layout| shader_compiler::DescriptorSetLayout {
4079 bindings: descriptor_set_layout
4083 Some(match *binding.as_ref()? {
4084 DescriptorLayout::Sampler {
4086 immutable_samplers: _,
4087 } => shader_compiler::DescriptorLayout::Sampler { count },
4088 DescriptorLayout::CombinedImageSampler {
4090 immutable_samplers: _,
4091 } => shader_compiler::DescriptorLayout::CombinedImageSampler {
4094 DescriptorLayout::SampledImage { count } => {
4095 shader_compiler::DescriptorLayout::SampledImage { count }
4097 DescriptorLayout::StorageImage { count } => {
4098 shader_compiler::DescriptorLayout::StorageImage { count }
4100 DescriptorLayout::UniformTexelBuffer { count } => {
4101 shader_compiler::DescriptorLayout::UniformTexelBuffer { count }
4103 DescriptorLayout::StorageTexelBuffer { count } => {
4104 shader_compiler::DescriptorLayout::StorageTexelBuffer { count }
4106 DescriptorLayout::UniformBuffer { count } => {
4107 shader_compiler::DescriptorLayout::UniformBuffer { count }
4109 DescriptorLayout::StorageBuffer { count } => {
4110 shader_compiler::DescriptorLayout::StorageBuffer { count }
4112 DescriptorLayout::UniformBufferDynamic { count } => {
4113 shader_compiler::DescriptorLayout::UniformBufferDynamic {
4117 DescriptorLayout::StorageBufferDynamic { count } => {
4118 shader_compiler::DescriptorLayout::StorageBufferDynamic {
4122 DescriptorLayout::InputAttachment { count } => {
4123 shader_compiler::DescriptorLayout::InputAttachment { count }
4132 *pipeline_layout = OwnedHandle::<api::VkPipelineLayout>::new(PipelineLayout {
4133 push_constants_size,
4134 push_constant_ranges: push_constant_ranges.into(),
4135 descriptor_set_layouts,
4136 shader_compiler_pipeline_layout,
4142 #[allow(non_snake_case)]
4143 pub unsafe extern "system" fn vkDestroyPipelineLayout(
4144 _device: api::VkDevice,
4145 pipeline_layout: api::VkPipelineLayout,
4146 _allocator: *const api::VkAllocationCallbacks,
4148 OwnedHandle::from(pipeline_layout);
4151 #[allow(non_snake_case)]
4152 pub unsafe extern "system" fn vkCreateSampler(
4153 _device: api::VkDevice,
4154 create_info: *const api::VkSamplerCreateInfo,
4155 _allocator: *const api::VkAllocationCallbacks,
4156 sampler: *mut api::VkSampler,
4157 ) -> api::VkResult {
4158 parse_next_chain_const! {
4160 root = api::VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
4162 let create_info = &*create_info;
4163 *sampler = OwnedHandle::<api::VkSampler>::new(Sampler {
4164 mag_filter: create_info.magFilter,
4165 min_filter: create_info.minFilter,
4166 mipmap_mode: create_info.mipmapMode,
4168 create_info.addressModeU,
4169 create_info.addressModeV,
4170 create_info.addressModeW,
4172 mip_lod_bias: create_info.mipLodBias,
4173 anisotropy: if create_info.anisotropyEnable != api::VK_FALSE {
4174 Some(sampler::AnisotropySettings {
4175 max: create_info.maxAnisotropy,
4180 compare_op: if create_info.compareEnable != api::VK_FALSE {
4181 Some(create_info.compareOp)
4185 min_lod: create_info.minLod,
4186 max_lod: create_info.maxLod,
4187 border_color: create_info.borderColor,
4188 unnormalized_coordinates: create_info.unnormalizedCoordinates != api::VK_FALSE,
4189 sampler_ycbcr_conversion: None,
4195 #[allow(non_snake_case)]
4196 pub unsafe extern "system" fn vkDestroySampler(
4197 _device: api::VkDevice,
4198 sampler: api::VkSampler,
4199 _allocator: *const api::VkAllocationCallbacks,
4201 OwnedHandle::from(sampler);
4204 #[allow(non_snake_case)]
4205 pub unsafe extern "system" fn vkCreateDescriptorSetLayout(
4206 _device: api::VkDevice,
4207 create_info: *const api::VkDescriptorSetLayoutCreateInfo,
4208 _allocator: *const api::VkAllocationCallbacks,
4209 set_layout: *mut api::VkDescriptorSetLayout,
4210 ) -> api::VkResult {
4211 parse_next_chain_const! {
4213 root = api::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
4215 let create_info = &*create_info;
4216 let bindings = util::to_slice(create_info.pBindings, create_info.bindingCount as usize);
4217 let max_binding = bindings.iter().map(|v| v.binding).max().unwrap_or(0) as usize;
4218 let mut bindings_map: Vec<Option<DescriptorLayout>> = (0..=max_binding).map(|_| None).collect();
4219 for binding in bindings {
4220 let bindings_map_entry = &mut bindings_map[binding.binding as usize];
4222 bindings_map_entry.is_none(),
4223 "duplicate binding: {}",
4226 *bindings_map_entry = Some(DescriptorLayout::from(binding));
4228 *set_layout = OwnedHandle::<api::VkDescriptorSetLayout>::new(DescriptorSetLayout {
4229 bindings: bindings_map,
4235 #[allow(non_snake_case)]
4236 pub unsafe extern "system" fn vkDestroyDescriptorSetLayout(
4237 _device: api::VkDevice,
4238 descriptor_set_layout: api::VkDescriptorSetLayout,
4239 _allocator: *const api::VkAllocationCallbacks,
4241 OwnedHandle::from(descriptor_set_layout);
4244 #[allow(non_snake_case)]
4245 pub unsafe extern "system" fn vkCreateDescriptorPool(
4246 _device: api::VkDevice,
4247 create_info: *const api::VkDescriptorPoolCreateInfo,
4248 _allocator: *const api::VkAllocationCallbacks,
4249 descriptor_pool: *mut api::VkDescriptorPool,
4250 ) -> api::VkResult {
4251 parse_next_chain_const! {
4253 root = api::VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
4255 *descriptor_pool = OwnedHandle::<api::VkDescriptorPool>::new(DescriptorPool::new()).take();
4259 #[allow(non_snake_case)]
4260 pub unsafe extern "system" fn vkDestroyDescriptorPool(
4261 _device: api::VkDevice,
4262 descriptor_pool: api::VkDescriptorPool,
4263 _allocator: *const api::VkAllocationCallbacks,
4265 OwnedHandle::from(descriptor_pool);
4268 #[allow(non_snake_case)]
4269 pub unsafe extern "system" fn vkResetDescriptorPool(
4270 _device: api::VkDevice,
4271 descriptor_pool: api::VkDescriptorPool,
4272 _flags: api::VkDescriptorPoolResetFlags,
4273 ) -> api::VkResult {
4274 MutHandle::from(descriptor_pool).unwrap().reset();
4278 #[allow(non_snake_case)]
4279 pub unsafe extern "system" fn vkAllocateDescriptorSets(
4280 _device: api::VkDevice,
4281 allocate_info: *const api::VkDescriptorSetAllocateInfo,
4282 descriptor_sets: *mut api::VkDescriptorSet,
4283 ) -> api::VkResult {
4284 parse_next_chain_const! {
4286 root = api::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
4288 let allocate_info = &*allocate_info;
4289 let mut descriptor_pool = MutHandle::from(allocate_info.descriptorPool).unwrap();
4290 let descriptor_sets =
4291 util::to_slice_mut(descriptor_sets, allocate_info.descriptorSetCount as usize);
4292 let descriptor_set_layouts = util::to_slice(
4293 allocate_info.pSetLayouts,
4294 allocate_info.descriptorSetCount as usize,
4296 descriptor_pool.allocate(
4297 descriptor_set_layouts
4299 .map(|descriptor_set_layout| DescriptorSet {
4300 bindings: SharedHandle::from(*descriptor_set_layout)
4304 .map(|layout| layout.as_ref().map(Descriptor::from))
4312 #[allow(non_snake_case)]
4313 pub unsafe extern "system" fn vkFreeDescriptorSets(
4314 _device: api::VkDevice,
4315 descriptor_pool: api::VkDescriptorPool,
4316 descriptor_set_count: u32,
4317 descriptor_sets: *const api::VkDescriptorSet,
4318 ) -> api::VkResult {
4319 let mut descriptor_pool = MutHandle::from(descriptor_pool).unwrap();
4320 let descriptor_sets = util::to_slice(descriptor_sets, descriptor_set_count as usize);
4321 descriptor_pool.free(descriptor_sets);
4325 #[allow(non_snake_case)]
4326 pub unsafe extern "system" fn vkUpdateDescriptorSets(
4327 _device: api::VkDevice,
4328 descriptor_write_count: u32,
4329 descriptor_writes: *const api::VkWriteDescriptorSet,
4330 descriptor_copy_count: u32,
4331 descriptor_copies: *const api::VkCopyDescriptorSet,
4333 let descriptor_writes = util::to_slice(descriptor_writes, descriptor_write_count as usize);
4334 let descriptor_copies = util::to_slice(descriptor_copies, descriptor_copy_count as usize);
4335 for descriptor_write in descriptor_writes {
4336 parse_next_chain_const! {
4338 root = api::VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
4340 let mut descriptor_set = MutHandle::from(descriptor_write.dstSet).unwrap();
4341 let mut binding_index = descriptor_write.dstBinding as usize;
4342 let mut elements = DescriptorWriteArg::from(descriptor_write);
4343 let mut start_element = Some(descriptor_write.dstArrayElement as usize);
4344 while elements.len() != 0 {
4345 let binding = descriptor_set.bindings[binding_index].as_mut().unwrap();
4347 assert_eq!(binding.descriptor_type(), descriptor_write.descriptorType);
4348 if binding.element_count() == 0 {
4349 assert_eq!(start_element, None);
4352 let start_element = start_element.take().unwrap_or(0);
4353 let used_elements = elements
4355 .min(binding.element_count().checked_sub(start_element).unwrap());
4356 binding.write(start_element, elements.slice_to(..used_elements));
4357 elements = elements.slice_from(used_elements..);
4360 for descriptor_copy in descriptor_copies {
4361 parse_next_chain_const! {
4363 root = api::VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET,
4369 #[allow(non_snake_case)]
4370 pub unsafe extern "system" fn vkCreateFramebuffer(
4371 _device: api::VkDevice,
4372 _pCreateInfo: *const api::VkFramebufferCreateInfo,
4373 _pAllocator: *const api::VkAllocationCallbacks,
4374 _pFramebuffer: *mut api::VkFramebuffer,
4375 ) -> api::VkResult {
4379 #[allow(non_snake_case)]
4380 pub unsafe extern "system" fn vkDestroyFramebuffer(
4381 _device: api::VkDevice,
4382 _framebuffer: api::VkFramebuffer,
4383 _pAllocator: *const api::VkAllocationCallbacks,
4388 #[allow(non_snake_case)]
4389 pub unsafe extern "system" fn vkCreateRenderPass(
4390 _device: api::VkDevice,
4391 create_info: *const api::VkRenderPassCreateInfo,
4392 _allocator: *const api::VkAllocationCallbacks,
4393 render_pass: *mut api::VkRenderPass,
4394 ) -> api::VkResult {
4395 parse_next_chain_const! {
4397 root = api::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
4399 // FIXME: finish implementing
4400 *render_pass = OwnedHandle::<api::VkRenderPass>::new(RenderPass {}).take();
4404 #[allow(non_snake_case)]
4405 pub unsafe extern "system" fn vkDestroyRenderPass(
4406 _device: api::VkDevice,
4407 render_pass: api::VkRenderPass,
4408 _allocator: *const api::VkAllocationCallbacks,
4410 OwnedHandle::from(render_pass);
4413 #[allow(non_snake_case)]
4414 pub unsafe extern "system" fn vkGetRenderAreaGranularity(
4415 _device: api::VkDevice,
4416 _renderPass: api::VkRenderPass,
4417 _pGranularity: *mut api::VkExtent2D,
4422 #[allow(non_snake_case)]
4423 pub unsafe extern "system" fn vkCreateCommandPool(
4424 _device: api::VkDevice,
4425 _pCreateInfo: *const api::VkCommandPoolCreateInfo,
4426 _pAllocator: *const api::VkAllocationCallbacks,
4427 _pCommandPool: *mut api::VkCommandPool,
4428 ) -> api::VkResult {
4432 #[allow(non_snake_case)]
4433 pub unsafe extern "system" fn vkDestroyCommandPool(
4434 _device: api::VkDevice,
4435 _commandPool: api::VkCommandPool,
4436 _pAllocator: *const api::VkAllocationCallbacks,
4441 #[allow(non_snake_case)]
4442 pub unsafe extern "system" fn vkResetCommandPool(
4443 _device: api::VkDevice,
4444 _commandPool: api::VkCommandPool,
4445 _flags: api::VkCommandPoolResetFlags,
4446 ) -> api::VkResult {
4450 #[allow(non_snake_case)]
4451 pub unsafe extern "system" fn vkAllocateCommandBuffers(
4452 _device: api::VkDevice,
4453 _pAllocateInfo: *const api::VkCommandBufferAllocateInfo,
4454 _pCommandBuffers: *mut api::VkCommandBuffer,
4455 ) -> api::VkResult {
4459 #[allow(non_snake_case)]
4460 pub unsafe extern "system" fn vkFreeCommandBuffers(
4461 _device: api::VkDevice,
4462 _commandPool: api::VkCommandPool,
4463 _commandBufferCount: u32,
4464 _pCommandBuffers: *const api::VkCommandBuffer,
4469 #[allow(non_snake_case)]
4470 pub unsafe extern "system" fn vkBeginCommandBuffer(
4471 _commandBuffer: api::VkCommandBuffer,
4472 _pBeginInfo: *const api::VkCommandBufferBeginInfo,
4473 ) -> api::VkResult {
4477 #[allow(non_snake_case)]
4478 pub unsafe extern "system" fn vkEndCommandBuffer(
4479 _commandBuffer: api::VkCommandBuffer,
4480 ) -> api::VkResult {
4484 #[allow(non_snake_case)]
4485 pub unsafe extern "system" fn vkResetCommandBuffer(
4486 _commandBuffer: api::VkCommandBuffer,
4487 _flags: api::VkCommandBufferResetFlags,
4488 ) -> api::VkResult {
4492 #[allow(non_snake_case)]
4493 pub unsafe extern "system" fn vkCmdBindPipeline(
4494 _commandBuffer: api::VkCommandBuffer,
4495 _pipelineBindPoint: api::VkPipelineBindPoint,
4496 _pipeline: api::VkPipeline,
4501 #[allow(non_snake_case)]
4502 pub unsafe extern "system" fn vkCmdSetViewport(
4503 _commandBuffer: api::VkCommandBuffer,
4504 _firstViewport: u32,
4505 _viewportCount: u32,
4506 _pViewports: *const api::VkViewport,
4511 #[allow(non_snake_case)]
4512 pub unsafe extern "system" fn vkCmdSetScissor(
4513 _commandBuffer: api::VkCommandBuffer,
4516 _pScissors: *const api::VkRect2D,
4521 #[allow(non_snake_case)]
4522 pub unsafe extern "system" fn vkCmdSetLineWidth(
4523 _commandBuffer: api::VkCommandBuffer,
4529 #[allow(non_snake_case)]
4530 pub unsafe extern "system" fn vkCmdSetDepthBias(
4531 _commandBuffer: api::VkCommandBuffer,
4532 _depthBiasConstantFactor: f32,
4533 _depthBiasClamp: f32,
4534 _depthBiasSlopeFactor: f32,
4539 #[allow(non_snake_case)]
4540 pub unsafe extern "system" fn vkCmdSetBlendConstants(
4541 _commandBuffer: api::VkCommandBuffer,
4542 _blendConstants: *const f32,
4547 #[allow(non_snake_case)]
4548 pub unsafe extern "system" fn vkCmdSetDepthBounds(
4549 _commandBuffer: api::VkCommandBuffer,
4550 _minDepthBounds: f32,
4551 _maxDepthBounds: f32,
4556 #[allow(non_snake_case)]
4557 pub unsafe extern "system" fn vkCmdSetStencilCompareMask(
4558 _commandBuffer: api::VkCommandBuffer,
4559 _faceMask: api::VkStencilFaceFlags,
4565 #[allow(non_snake_case)]
4566 pub unsafe extern "system" fn vkCmdSetStencilWriteMask(
4567 _commandBuffer: api::VkCommandBuffer,
4568 _faceMask: api::VkStencilFaceFlags,
4574 #[allow(non_snake_case)]
4575 pub unsafe extern "system" fn vkCmdSetStencilReference(
4576 _commandBuffer: api::VkCommandBuffer,
4577 _faceMask: api::VkStencilFaceFlags,
4583 #[allow(non_snake_case)]
4584 pub unsafe extern "system" fn vkCmdBindDescriptorSets(
4585 _commandBuffer: api::VkCommandBuffer,
4586 _pipelineBindPoint: api::VkPipelineBindPoint,
4587 _layout: api::VkPipelineLayout,
4589 _descriptorSetCount: u32,
4590 _pDescriptorSets: *const api::VkDescriptorSet,
4591 _dynamicOffsetCount: u32,
4592 _pDynamicOffsets: *const u32,
4597 #[allow(non_snake_case)]
4598 pub unsafe extern "system" fn vkCmdBindIndexBuffer(
4599 _commandBuffer: api::VkCommandBuffer,
4600 _buffer: api::VkBuffer,
4601 _offset: api::VkDeviceSize,
4602 _indexType: api::VkIndexType,
4607 #[allow(non_snake_case)]
4608 pub unsafe extern "system" fn vkCmdBindVertexBuffers(
4609 _commandBuffer: api::VkCommandBuffer,
4612 _pBuffers: *const api::VkBuffer,
4613 _pOffsets: *const api::VkDeviceSize,
4618 #[allow(non_snake_case)]
4619 pub unsafe extern "system" fn vkCmdDraw(
4620 _commandBuffer: api::VkCommandBuffer,
4622 _instanceCount: u32,
4624 _firstInstance: u32,
4629 #[allow(non_snake_case)]
4630 pub unsafe extern "system" fn vkCmdDrawIndexed(
4631 _commandBuffer: api::VkCommandBuffer,
4633 _instanceCount: u32,
4636 _firstInstance: u32,
4641 #[allow(non_snake_case)]
4642 pub unsafe extern "system" fn vkCmdDrawIndirect(
4643 _commandBuffer: api::VkCommandBuffer,
4644 _buffer: api::VkBuffer,
4645 _offset: api::VkDeviceSize,
4652 #[allow(non_snake_case)]
4653 pub unsafe extern "system" fn vkCmdDrawIndexedIndirect(
4654 _commandBuffer: api::VkCommandBuffer,
4655 _buffer: api::VkBuffer,
4656 _offset: api::VkDeviceSize,
4663 #[allow(non_snake_case)]
4664 pub unsafe extern "system" fn vkCmdDispatch(
4665 _commandBuffer: api::VkCommandBuffer,
4673 #[allow(non_snake_case)]
4674 pub unsafe extern "system" fn vkCmdDispatchIndirect(
4675 _commandBuffer: api::VkCommandBuffer,
4676 _buffer: api::VkBuffer,
4677 _offset: api::VkDeviceSize,
4682 #[allow(non_snake_case)]
4683 pub unsafe extern "system" fn vkCmdCopyBuffer(
4684 _commandBuffer: api::VkCommandBuffer,
4685 _srcBuffer: api::VkBuffer,
4686 _dstBuffer: api::VkBuffer,
4688 _pRegions: *const api::VkBufferCopy,
4693 #[allow(non_snake_case)]
4694 pub unsafe extern "system" fn vkCmdCopyImage(
4695 _commandBuffer: api::VkCommandBuffer,
4696 _srcImage: api::VkImage,
4697 _srcImageLayout: api::VkImageLayout,
4698 _dstImage: api::VkImage,
4699 _dstImageLayout: api::VkImageLayout,
4701 _pRegions: *const api::VkImageCopy,
4706 #[allow(non_snake_case)]
4707 pub unsafe extern "system" fn vkCmdBlitImage(
4708 _commandBuffer: api::VkCommandBuffer,
4709 _srcImage: api::VkImage,
4710 _srcImageLayout: api::VkImageLayout,
4711 _dstImage: api::VkImage,
4712 _dstImageLayout: api::VkImageLayout,
4714 _pRegions: *const api::VkImageBlit,
4715 _filter: api::VkFilter,
4720 #[allow(non_snake_case)]
4721 pub unsafe extern "system" fn vkCmdCopyBufferToImage(
4722 _commandBuffer: api::VkCommandBuffer,
4723 _srcBuffer: api::VkBuffer,
4724 _dstImage: api::VkImage,
4725 _dstImageLayout: api::VkImageLayout,
4727 _pRegions: *const api::VkBufferImageCopy,
4732 #[allow(non_snake_case)]
4733 pub unsafe extern "system" fn vkCmdCopyImageToBuffer(
4734 _commandBuffer: api::VkCommandBuffer,
4735 _srcImage: api::VkImage,
4736 _srcImageLayout: api::VkImageLayout,
4737 _dstBuffer: api::VkBuffer,
4739 _pRegions: *const api::VkBufferImageCopy,
4744 #[allow(non_snake_case)]
4745 pub unsafe extern "system" fn vkCmdUpdateBuffer(
4746 _commandBuffer: api::VkCommandBuffer,
4747 _dstBuffer: api::VkBuffer,
4748 _dstOffset: api::VkDeviceSize,
4749 _dataSize: api::VkDeviceSize,
4750 _pData: *const c_void,
4755 #[allow(non_snake_case)]
4756 pub unsafe extern "system" fn vkCmdFillBuffer(
4757 _commandBuffer: api::VkCommandBuffer,
4758 _dstBuffer: api::VkBuffer,
4759 _dstOffset: api::VkDeviceSize,
4760 _size: api::VkDeviceSize,
4766 #[allow(non_snake_case)]
4767 pub unsafe extern "system" fn vkCmdClearColorImage(
4768 _commandBuffer: api::VkCommandBuffer,
4769 _image: api::VkImage,
4770 _imageLayout: api::VkImageLayout,
4771 _pColor: *const api::VkClearColorValue,
4773 _pRanges: *const api::VkImageSubresourceRange,
4778 #[allow(non_snake_case)]
4779 pub unsafe extern "system" fn vkCmdClearDepthStencilImage(
4780 _commandBuffer: api::VkCommandBuffer,
4781 _image: api::VkImage,
4782 _imageLayout: api::VkImageLayout,
4783 _pDepthStencil: *const api::VkClearDepthStencilValue,
4785 _pRanges: *const api::VkImageSubresourceRange,
4790 #[allow(non_snake_case)]
4791 pub unsafe extern "system" fn vkCmdClearAttachments(
4792 _commandBuffer: api::VkCommandBuffer,
4793 _attachmentCount: u32,
4794 _pAttachments: *const api::VkClearAttachment,
4796 _pRects: *const api::VkClearRect,
4801 #[allow(non_snake_case)]
4802 pub unsafe extern "system" fn vkCmdResolveImage(
4803 _commandBuffer: api::VkCommandBuffer,
4804 _srcImage: api::VkImage,
4805 _srcImageLayout: api::VkImageLayout,
4806 _dstImage: api::VkImage,
4807 _dstImageLayout: api::VkImageLayout,
4809 _pRegions: *const api::VkImageResolve,
4814 #[allow(non_snake_case)]
4815 pub unsafe extern "system" fn vkCmdSetEvent(
4816 _commandBuffer: api::VkCommandBuffer,
4817 _event: api::VkEvent,
4818 _stageMask: api::VkPipelineStageFlags,
4823 #[allow(non_snake_case)]
4824 pub unsafe extern "system" fn vkCmdResetEvent(
4825 _commandBuffer: api::VkCommandBuffer,
4826 _event: api::VkEvent,
4827 _stageMask: api::VkPipelineStageFlags,
4832 #[allow(non_snake_case)]
4833 pub unsafe extern "system" fn vkCmdWaitEvents(
4834 _commandBuffer: api::VkCommandBuffer,
4836 _pEvents: *const api::VkEvent,
4837 _srcStageMask: api::VkPipelineStageFlags,
4838 _dstStageMask: api::VkPipelineStageFlags,
4839 _memoryBarrierCount: u32,
4840 _pMemoryBarriers: *const api::VkMemoryBarrier,
4841 _bufferMemoryBarrierCount: u32,
4842 _pBufferMemoryBarriers: *const api::VkBufferMemoryBarrier,
4843 _imageMemoryBarrierCount: u32,
4844 _pImageMemoryBarriers: *const api::VkImageMemoryBarrier,
4849 #[allow(non_snake_case)]
4850 pub unsafe extern "system" fn vkCmdPipelineBarrier(
4851 _commandBuffer: api::VkCommandBuffer,
4852 _srcStageMask: api::VkPipelineStageFlags,
4853 _dstStageMask: api::VkPipelineStageFlags,
4854 _dependencyFlags: api::VkDependencyFlags,
4855 _memoryBarrierCount: u32,
4856 _pMemoryBarriers: *const api::VkMemoryBarrier,
4857 _bufferMemoryBarrierCount: u32,
4858 _pBufferMemoryBarriers: *const api::VkBufferMemoryBarrier,
4859 _imageMemoryBarrierCount: u32,
4860 _pImageMemoryBarriers: *const api::VkImageMemoryBarrier,
4865 #[allow(non_snake_case)]
4866 pub unsafe extern "system" fn vkCmdBeginQuery(
4867 _commandBuffer: api::VkCommandBuffer,
4868 _queryPool: api::VkQueryPool,
4870 _flags: api::VkQueryControlFlags,
4875 #[allow(non_snake_case)]
4876 pub unsafe extern "system" fn vkCmdEndQuery(
4877 _commandBuffer: api::VkCommandBuffer,
4878 _queryPool: api::VkQueryPool,
4884 #[allow(non_snake_case)]
4885 pub unsafe extern "system" fn vkCmdResetQueryPool(
4886 _commandBuffer: api::VkCommandBuffer,
4887 _queryPool: api::VkQueryPool,
4894 #[allow(non_snake_case)]
4895 pub unsafe extern "system" fn vkCmdWriteTimestamp(
4896 _commandBuffer: api::VkCommandBuffer,
4897 _pipelineStage: api::VkPipelineStageFlagBits,
4898 _queryPool: api::VkQueryPool,
4904 #[allow(non_snake_case)]
4905 pub unsafe extern "system" fn vkCmdCopyQueryPoolResults(
4906 _commandBuffer: api::VkCommandBuffer,
4907 _queryPool: api::VkQueryPool,
4910 _dstBuffer: api::VkBuffer,
4911 _dstOffset: api::VkDeviceSize,
4912 _stride: api::VkDeviceSize,
4913 _flags: api::VkQueryResultFlags,
4918 #[allow(non_snake_case)]
4919 pub unsafe extern "system" fn vkCmdPushConstants(
4920 _commandBuffer: api::VkCommandBuffer,
4921 _layout: api::VkPipelineLayout,
4922 _stageFlags: api::VkShaderStageFlags,
4925 _pValues: *const c_void,
4930 #[allow(non_snake_case)]
4931 pub unsafe extern "system" fn vkCmdBeginRenderPass(
4932 _commandBuffer: api::VkCommandBuffer,
4933 _pRenderPassBegin: *const api::VkRenderPassBeginInfo,
4934 _contents: api::VkSubpassContents,
4939 #[allow(non_snake_case)]
4940 pub unsafe extern "system" fn vkCmdNextSubpass(
4941 _commandBuffer: api::VkCommandBuffer,
4942 _contents: api::VkSubpassContents,
4947 #[allow(non_snake_case)]
4948 pub unsafe extern "system" fn vkCmdEndRenderPass(_commandBuffer: api::VkCommandBuffer) {
4952 #[allow(non_snake_case)]
4953 pub unsafe extern "system" fn vkCmdExecuteCommands(
4954 _commandBuffer: api::VkCommandBuffer,
4955 _commandBufferCount: u32,
4956 _pCommandBuffers: *const api::VkCommandBuffer,
4961 #[allow(non_snake_case)]
4962 pub unsafe extern "system" fn vkBindBufferMemory2(
4963 _device: api::VkDevice,
4964 bind_info_count: u32,
4965 bind_infos: *const api::VkBindBufferMemoryInfo,
4966 ) -> api::VkResult {
4967 assert_ne!(bind_info_count, 0);
4968 let bind_infos = util::to_slice(bind_infos, bind_info_count as usize);
4969 for bind_info in bind_infos {
4970 parse_next_chain_const! {
4972 root = api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
4973 device_group_info: api::VkBindBufferMemoryDeviceGroupInfo = api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO,
4975 if !device_group_info.is_null() {
4976 let device_group_info = &*device_group_info;
4977 if device_group_info.deviceIndexCount == 0 {
4979 assert_eq!(device_group_info.deviceIndexCount, 1);
4980 assert_eq!(*device_group_info.pDeviceIndices, 0);
4983 let bind_info = &*bind_info;
4984 let mut buffer = MutHandle::from(bind_info.buffer).unwrap();
4985 let device_memory = SharedHandle::from(bind_info.memory).unwrap();
4986 let device_memory_size = device_memory.size();
4987 assert!(bind_info.memoryOffset < device_memory_size as u64);
4988 let offset = bind_info.memoryOffset as usize;
4989 assert!(buffer.size.checked_add(offset).unwrap() <= device_memory_size);
4990 assert_eq!(offset % BUFFER_ALIGNMENT, 0);
4991 buffer.memory = Some(BufferMemory {
4999 #[allow(non_snake_case)]
5000 pub unsafe extern "system" fn vkBindImageMemory2(
5001 _device: api::VkDevice,
5002 bind_info_count: u32,
5003 bind_infos: *const api::VkBindImageMemoryInfo,
5004 ) -> api::VkResult {
5005 assert_ne!(bind_info_count, 0);
5006 let bind_infos = util::to_slice(bind_infos, bind_info_count as usize);
5007 for bind_info in bind_infos {
5008 parse_next_chain_const! {
5010 root = api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
5011 device_group_info: api::VkBindImageMemoryDeviceGroupInfo = api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO,
5012 swapchain_info: api::VkBindImageMemorySwapchainInfoKHR = api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR,
5013 plane_info: api::VkBindImagePlaneMemoryInfo = api::VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO,
5015 if !device_group_info.is_null() {
5016 let device_group_info = &*device_group_info;
5017 if device_group_info.deviceIndexCount == 0 {
5019 assert_eq!(device_group_info.deviceIndexCount, 1);
5020 assert_eq!(*device_group_info.pDeviceIndices, 0);
5023 if !swapchain_info.is_null() {
5026 if !plane_info.is_null() {
5029 let bind_info = &*bind_info;
5030 let mut image = MutHandle::from(bind_info.image).unwrap();
5031 let device_memory = SharedHandle::from(bind_info.memory).unwrap();
5032 let device_memory_size = device_memory.size();
5033 let image_memory_layout = image.properties.computed_properties().memory_layout;
5034 assert!(bind_info.memoryOffset < device_memory_size as u64);
5035 let offset = bind_info.memoryOffset as usize;
5036 assert!(image_memory_layout.size.checked_add(offset).unwrap() <= device_memory_size);
5037 assert_eq!(offset % image_memory_layout.alignment, 0);
5038 image.memory = Some(ImageMemory {
5046 #[allow(non_snake_case)]
5047 pub unsafe extern "system" fn vkGetDeviceGroupPeerMemoryFeatures(
5048 _device: api::VkDevice,
5050 _localDeviceIndex: u32,
5051 _remoteDeviceIndex: u32,
5052 _pPeerMemoryFeatures: *mut api::VkPeerMemoryFeatureFlags,
5057 #[allow(non_snake_case)]
5058 pub unsafe extern "system" fn vkCmdSetDeviceMask(
5059 _commandBuffer: api::VkCommandBuffer,
5065 #[allow(non_snake_case)]
5066 pub unsafe extern "system" fn vkCmdDispatchBase(
5067 _commandBuffer: api::VkCommandBuffer,
5078 #[allow(non_snake_case)]
5079 pub unsafe extern "system" fn vkEnumeratePhysicalDeviceGroups(
5080 instance: api::VkInstance,
5081 physical_device_group_count: *mut u32,
5082 physical_device_group_properties: *mut api::VkPhysicalDeviceGroupProperties,
5083 ) -> api::VkResult {
5085 physical_device_group_count,
5086 physical_device_group_properties,
5088 |physical_device_group_properties, _| {
5089 parse_next_chain_mut! {
5090 physical_device_group_properties,
5091 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES,
5093 let mut physical_devices = [Handle::null(); api::VK_MAX_DEVICE_GROUP_SIZE as usize];
5094 physical_devices[0] = SharedHandle::from(instance)
5098 *physical_device_group_properties = api::VkPhysicalDeviceGroupProperties {
5099 sType: physical_device_group_properties.sType,
5100 pNext: physical_device_group_properties.pNext,
5101 physicalDeviceCount: 1,
5102 physicalDevices: physical_devices,
5103 subsetAllocation: api::VK_TRUE,
5109 #[allow(non_snake_case)]
5110 pub unsafe extern "system" fn vkGetImageMemoryRequirements2(
5111 _device: api::VkDevice,
5112 info: *const api::VkImageMemoryRequirementsInfo2,
5113 memory_requirements: *mut api::VkMemoryRequirements2,
5115 #![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_update))]
5116 parse_next_chain_const! {
5118 root = api::VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
5119 image_plane_memory_requirements_info: api::VkImagePlaneMemoryRequirementsInfo = api::VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO,
5121 parse_next_chain_mut! {
5122 memory_requirements,
5123 root = api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
5124 dedicated_requirements: api::VkMemoryDedicatedRequirements = api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS,
5126 if !image_plane_memory_requirements_info.is_null() {
5130 let image = SharedHandle::from(info.image).unwrap();
5131 let memory_requirements = &mut *memory_requirements;
5132 let layout = image.properties.computed_properties().memory_layout;
5133 memory_requirements.memoryRequirements = api::VkMemoryRequirements {
5134 size: layout.size as u64,
5135 alignment: layout.alignment as u64,
5136 memoryTypeBits: DeviceMemoryType::Main.to_bits(),
5137 ..mem::zeroed() // for padding fields
5139 if !dedicated_requirements.is_null() {
5140 let dedicated_requirements = &mut *dedicated_requirements;
5141 dedicated_requirements.prefersDedicatedAllocation = api::VK_FALSE;
5142 dedicated_requirements.requiresDedicatedAllocation = api::VK_FALSE;
5146 #[allow(non_snake_case)]
5147 pub unsafe extern "system" fn vkGetBufferMemoryRequirements2(
5148 _device: api::VkDevice,
5149 info: *const api::VkBufferMemoryRequirementsInfo2,
5150 memory_requirements: *mut api::VkMemoryRequirements2,
5152 #![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_update))]
5153 parse_next_chain_const! {
5155 root = api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
5157 parse_next_chain_mut! {
5158 memory_requirements,
5159 root = api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
5160 dedicated_requirements: api::VkMemoryDedicatedRequirements = api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS,
5162 let memory_requirements = &mut *memory_requirements;
5164 let buffer = SharedHandle::from(info.buffer).unwrap();
5165 let layout = DeviceMemoryLayout::calculate(buffer.size, BUFFER_ALIGNMENT);
5166 memory_requirements.memoryRequirements = api::VkMemoryRequirements {
5167 size: layout.size as u64,
5168 alignment: layout.alignment as u64,
5169 memoryTypeBits: DeviceMemoryType::Main.to_bits(),
5170 ..mem::zeroed() // for padding fields
5172 if !dedicated_requirements.is_null() {
5173 let dedicated_requirements = &mut *dedicated_requirements;
5174 dedicated_requirements.prefersDedicatedAllocation = api::VK_FALSE;
5175 dedicated_requirements.requiresDedicatedAllocation = api::VK_FALSE;
5179 #[allow(non_snake_case)]
5180 pub unsafe extern "system" fn vkGetImageSparseMemoryRequirements2(
5181 _device: api::VkDevice,
5182 _pInfo: *const api::VkImageSparseMemoryRequirementsInfo2,
5183 _pSparseMemoryRequirementCount: *mut u32,
5184 _pSparseMemoryRequirements: *mut api::VkSparseImageMemoryRequirements2,
5189 #[allow(non_snake_case)]
5190 pub unsafe extern "system" fn vkGetPhysicalDeviceFeatures2(
5191 physical_device: api::VkPhysicalDevice,
5192 features: *mut api::VkPhysicalDeviceFeatures2,
5194 parse_next_chain_mut! {
5196 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
5197 sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
5198 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
5199 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
5200 physical_device_shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
5201 physical_device_protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
5202 physical_device_multiview_features: api::VkPhysicalDeviceMultiviewFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
5204 let physical_device = SharedHandle::from(physical_device).unwrap();
5205 physical_device.features.export_feature_set(&mut *features);
5206 if !sampler_ycbcr_conversion_features.is_null() {
5209 .export_feature_set(&mut *sampler_ycbcr_conversion_features);
5211 if !physical_device_16bit_storage_features.is_null() {
5214 .export_feature_set(&mut *physical_device_16bit_storage_features);
5216 if !variable_pointer_features.is_null() {
5219 .export_feature_set(&mut *variable_pointer_features);
5221 if !physical_device_shader_draw_parameter_features.is_null() {
5224 .export_feature_set(&mut *physical_device_shader_draw_parameter_features);
5226 if !physical_device_protected_memory_features.is_null() {
5229 .export_feature_set(&mut *physical_device_protected_memory_features);
5231 if !physical_device_multiview_features.is_null() {
5234 .export_feature_set(&mut *physical_device_multiview_features);
5238 #[allow(non_snake_case)]
5239 pub unsafe extern "system" fn vkGetPhysicalDeviceProperties2(
5240 physical_device: api::VkPhysicalDevice,
5241 properties: *mut api::VkPhysicalDeviceProperties2,
5243 parse_next_chain_mut! {
5245 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
5246 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES,
5247 multiview_properties: api::VkPhysicalDeviceMultiviewProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
5248 id_properties: api::VkPhysicalDeviceIDProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES,
5249 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
5250 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES,
5251 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES,
5253 let properties = &mut *properties;
5254 let physical_device = SharedHandle::from(physical_device).unwrap();
5255 properties.properties = physical_device.properties;
5256 if !point_clipping_properties.is_null() {
5257 let point_clipping_properties = &mut *point_clipping_properties;
5258 *point_clipping_properties = api::VkPhysicalDevicePointClippingProperties {
5259 sType: point_clipping_properties.sType,
5260 pNext: point_clipping_properties.pNext,
5261 ..physical_device.point_clipping_properties
5264 if !multiview_properties.is_null() {
5265 let multiview_properties = &mut *multiview_properties;
5266 *multiview_properties = api::VkPhysicalDeviceMultiviewProperties {
5267 sType: multiview_properties.sType,
5268 pNext: multiview_properties.pNext,
5269 ..physical_device.multiview_properties
5272 if !id_properties.is_null() {
5273 let id_properties = &mut *id_properties;
5274 *id_properties = api::VkPhysicalDeviceIDProperties {
5275 sType: id_properties.sType,
5276 pNext: id_properties.pNext,
5277 ..physical_device.id_properties
5280 if !maintenance_3_properties.is_null() {
5281 let maintenance_3_properties = &mut *maintenance_3_properties;
5282 *maintenance_3_properties = api::VkPhysicalDeviceMaintenance3Properties {
5283 sType: maintenance_3_properties.sType,
5284 pNext: maintenance_3_properties.pNext,
5285 ..physical_device.maintenance_3_properties
5288 if !protected_memory_properties.is_null() {
5289 let protected_memory_properties = &mut *protected_memory_properties;
5290 *protected_memory_properties = api::VkPhysicalDeviceProtectedMemoryProperties {
5291 sType: protected_memory_properties.sType,
5292 pNext: protected_memory_properties.pNext,
5293 ..physical_device.protected_memory_properties
5296 if !subgroup_properties.is_null() {
5297 let subgroup_properties = &mut *subgroup_properties;
5298 *subgroup_properties = api::VkPhysicalDeviceSubgroupProperties {
5299 sType: subgroup_properties.sType,
5300 pNext: subgroup_properties.pNext,
5301 ..physical_device.subgroup_properties
5306 #[allow(non_snake_case)]
5307 pub unsafe extern "system" fn vkGetPhysicalDeviceFormatProperties2(
5308 _physical_device: api::VkPhysicalDevice,
5309 format: api::VkFormat,
5310 format_properties: *mut api::VkFormatProperties2,
5312 parse_next_chain_mut! {
5314 root = api::VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
5316 let format_properties = &mut *format_properties;
5317 format_properties.formatProperties = PhysicalDevice::get_format_properties(format);
5320 #[allow(non_snake_case)]
5321 pub unsafe extern "system" fn vkGetPhysicalDeviceImageFormatProperties2(
5322 _physicalDevice: api::VkPhysicalDevice,
5323 _pImageFormatInfo: *const api::VkPhysicalDeviceImageFormatInfo2,
5324 _pImageFormatProperties: *mut api::VkImageFormatProperties2,
5325 ) -> api::VkResult {
5329 #[allow(non_snake_case)]
5330 pub unsafe extern "system" fn vkGetPhysicalDeviceQueueFamilyProperties2(
5331 physical_device: api::VkPhysicalDevice,
5332 queue_family_property_count: *mut u32,
5333 queue_family_properties: *mut api::VkQueueFamilyProperties2,
5336 queue_family_property_count,
5337 queue_family_properties,
5338 QUEUE_COUNTS.iter(),
5339 |queue_family_properties, &count| {
5340 get_physical_device_queue_family_properties(
5341 SharedHandle::from(physical_device).unwrap(),
5342 queue_family_properties,
5349 #[allow(non_snake_case)]
5350 pub unsafe extern "system" fn vkGetPhysicalDeviceMemoryProperties2(
5351 physical_device: api::VkPhysicalDevice,
5352 memory_properties: *mut api::VkPhysicalDeviceMemoryProperties2,
5354 #![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_update))]
5355 let physical_device = SharedHandle::from(physical_device).unwrap();
5356 parse_next_chain_mut! {
5358 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
5360 let memory_properties = &mut *memory_properties;
5361 let mut properties: api::VkPhysicalDeviceMemoryProperties = mem::zeroed();
5362 properties.memoryTypeCount = DeviceMemoryTypes::default().len() as u32;
5363 for (memory_type, _) in DeviceMemoryTypes::default().iter() {
5364 properties.memoryTypes[memory_type as usize] = api::VkMemoryType {
5365 propertyFlags: memory_type.flags(),
5366 heapIndex: memory_type.heap() as u32,
5369 properties.memoryHeapCount = DeviceMemoryHeaps::default().len() as u32;
5370 for (memory_heap, _) in DeviceMemoryHeaps::default().iter() {
5371 properties.memoryHeaps[memory_heap as usize] = api::VkMemoryHeap {
5372 size: match memory_heap {
5373 DeviceMemoryHeap::Main => physical_device.system_memory_size * 7 / 8,
5375 flags: memory_heap.flags(),
5376 ..mem::zeroed() // for padding fields
5379 memory_properties.memoryProperties = properties;
5382 #[allow(non_snake_case)]
5383 pub unsafe extern "system" fn vkGetPhysicalDeviceSparseImageFormatProperties2(
5384 _physicalDevice: api::VkPhysicalDevice,
5385 _pFormatInfo: *const api::VkPhysicalDeviceSparseImageFormatInfo2,
5386 _pPropertyCount: *mut u32,
5387 _pProperties: *mut api::VkSparseImageFormatProperties2,
5392 #[allow(non_snake_case)]
5393 pub unsafe extern "system" fn vkTrimCommandPool(
5394 _device: api::VkDevice,
5395 _commandPool: api::VkCommandPool,
5396 _flags: api::VkCommandPoolTrimFlags,
5401 #[allow(non_snake_case)]
5402 pub unsafe extern "system" fn vkGetDeviceQueue2(
5403 device: api::VkDevice,
5404 queue_info: *const api::VkDeviceQueueInfo2,
5405 queue: *mut api::VkQueue,
5407 parse_next_chain_const! {
5409 root = api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
5411 let queue_info = &*queue_info;
5412 assert_eq!(queue_info.flags, 0);
5413 let device = SharedHandle::from(device).unwrap();
5414 *queue = device.queues[queue_info.queueFamilyIndex as usize][queue_info.queueIndex as usize]
5418 #[allow(non_snake_case)]
5419 pub unsafe extern "system" fn vkCreateSamplerYcbcrConversion(
5420 _device: api::VkDevice,
5421 _pCreateInfo: *const api::VkSamplerYcbcrConversionCreateInfo,
5422 _pAllocator: *const api::VkAllocationCallbacks,
5423 _pYcbcrConversion: *mut api::VkSamplerYcbcrConversion,
5424 ) -> api::VkResult {
5428 #[allow(non_snake_case)]
5429 pub unsafe extern "system" fn vkDestroySamplerYcbcrConversion(
5430 _device: api::VkDevice,
5431 _ycbcrConversion: api::VkSamplerYcbcrConversion,
5432 _pAllocator: *const api::VkAllocationCallbacks,
5437 #[allow(non_snake_case)]
5438 pub unsafe extern "system" fn vkCreateDescriptorUpdateTemplate(
5439 _device: api::VkDevice,
5440 _pCreateInfo: *const api::VkDescriptorUpdateTemplateCreateInfo,
5441 _pAllocator: *const api::VkAllocationCallbacks,
5442 _pDescriptorUpdateTemplate: *mut api::VkDescriptorUpdateTemplate,
5443 ) -> api::VkResult {
5447 #[allow(non_snake_case)]
5448 pub unsafe extern "system" fn vkDestroyDescriptorUpdateTemplate(
5449 _device: api::VkDevice,
5450 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5451 _pAllocator: *const api::VkAllocationCallbacks,
5456 #[allow(non_snake_case)]
5457 pub unsafe extern "system" fn vkUpdateDescriptorSetWithTemplate(
5458 _device: api::VkDevice,
5459 _descriptorSet: api::VkDescriptorSet,
5460 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5461 _pData: *const c_void,
5466 #[allow(non_snake_case)]
5467 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalBufferProperties(
5468 _physicalDevice: api::VkPhysicalDevice,
5469 _pExternalBufferInfo: *const api::VkPhysicalDeviceExternalBufferInfo,
5470 _pExternalBufferProperties: *mut api::VkExternalBufferProperties,
5475 #[allow(non_snake_case)]
5476 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalFenceProperties(
5477 _physicalDevice: api::VkPhysicalDevice,
5478 _pExternalFenceInfo: *const api::VkPhysicalDeviceExternalFenceInfo,
5479 _pExternalFenceProperties: *mut api::VkExternalFenceProperties,
5484 #[allow(non_snake_case)]
5485 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalSemaphoreProperties(
5486 _physicalDevice: api::VkPhysicalDevice,
5487 _pExternalSemaphoreInfo: *const api::VkPhysicalDeviceExternalSemaphoreInfo,
5488 _pExternalSemaphoreProperties: *mut api::VkExternalSemaphoreProperties,
5493 #[allow(non_snake_case)]
5494 pub unsafe extern "system" fn vkGetDescriptorSetLayoutSupport(
5495 _device: api::VkDevice,
5496 _pCreateInfo: *const api::VkDescriptorSetLayoutCreateInfo,
5497 _pSupport: *mut api::VkDescriptorSetLayoutSupport,
5502 #[allow(non_snake_case)]
5503 pub unsafe extern "system" fn vkDestroySurfaceKHR(
5504 _instance: api::VkInstance,
5505 surface: api::VkSurfaceKHR,
5506 _allocator: *const api::VkAllocationCallbacks,
5508 if let Some(surface) = SharedHandle::from(surface) {
5509 let surface_implementation = SurfacePlatform::from(surface.platform)
5511 .get_surface_implementation();
5512 surface_implementation.destroy_surface(surface.into_nonnull());
5516 #[allow(non_snake_case)]
5517 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceSupportKHR(
5518 _physicalDevice: api::VkPhysicalDevice,
5519 _queueFamilyIndex: u32,
5520 _surface: api::VkSurfaceKHR,
5521 _pSupported: *mut api::VkBool32,
5522 ) -> api::VkResult {
5526 #[allow(non_snake_case)]
5527 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5528 physical_device: api::VkPhysicalDevice,
5529 surface: api::VkSurfaceKHR,
5530 surface_capabilities: *mut api::VkSurfaceCapabilitiesKHR,
5531 ) -> api::VkResult {
5532 let mut surface_capabilities_2 = api::VkSurfaceCapabilities2KHR {
5533 sType: api::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
5535 surfaceCapabilities: mem::zeroed(),
5537 match vkGetPhysicalDeviceSurfaceCapabilities2KHR(
5539 &api::VkPhysicalDeviceSurfaceInfo2KHR {
5540 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
5544 &mut surface_capabilities_2,
5546 api::VK_SUCCESS => {
5547 *surface_capabilities = surface_capabilities_2.surfaceCapabilities;
5554 #[allow(non_snake_case)]
5555 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceFormatsKHR(
5556 _physical_device: api::VkPhysicalDevice,
5557 surface: api::VkSurfaceKHR,
5558 surface_format_count: *mut u32,
5559 surface_formats: *mut api::VkSurfaceFormatKHR,
5560 ) -> api::VkResult {
5561 let surface_implementation =
5562 SurfacePlatform::from(SharedHandle::from(surface).unwrap().platform)
5564 .get_surface_implementation();
5565 let returned_surface_formats = match surface_implementation.get_surface_formats(surface) {
5566 Ok(returned_surface_formats) => returned_surface_formats,
5567 Err(result) => return result,
5570 surface_format_count,
5572 returned_surface_formats.iter(),
5577 #[allow(non_snake_case)]
5578 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfacePresentModesKHR(
5579 _physical_device: api::VkPhysicalDevice,
5580 surface: api::VkSurfaceKHR,
5581 present_mode_count: *mut u32,
5582 present_modes: *mut api::VkPresentModeKHR,
5583 ) -> api::VkResult {
5584 let surface_implementation =
5585 SurfacePlatform::from(SharedHandle::from(surface).unwrap().platform)
5587 .get_surface_implementation();
5588 let returned_present_modes = match surface_implementation.get_present_modes(surface) {
5589 Ok(returned_present_modes) => returned_present_modes,
5590 Err(result) => return result,
5595 returned_present_modes.iter(),
5600 #[allow(non_snake_case)]
5601 pub unsafe extern "system" fn vkCreateSwapchainKHR(
5602 _device: api::VkDevice,
5603 create_info: *const api::VkSwapchainCreateInfoKHR,
5604 _allocator: *const api::VkAllocationCallbacks,
5605 swapchain: *mut api::VkSwapchainKHR,
5606 ) -> api::VkResult {
5607 parse_next_chain_const! {
5609 root = api::VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
5610 device_group_swapchain_create_info: api::VkDeviceGroupSwapchainCreateInfoKHR = api::VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR,
5612 let create_info = &*create_info;
5613 let device_group_swapchain_create_info = if device_group_swapchain_create_info.is_null() {
5616 Some(&*device_group_swapchain_create_info)
5618 *swapchain = Handle::null();
5620 SurfacePlatform::from(SharedHandle::from(create_info.surface).unwrap().platform).unwrap();
5622 .get_surface_implementation()
5623 .build(create_info, device_group_swapchain_create_info)
5625 Ok(new_swapchain) => {
5626 *swapchain = OwnedHandle::<api::VkSwapchainKHR>::new(new_swapchain).take();
5629 Err(error) => error,
5633 #[allow(non_snake_case)]
5634 pub unsafe extern "system" fn vkDestroySwapchainKHR(
5635 _device: api::VkDevice,
5636 swapchain: api::VkSwapchainKHR,
5637 _allocator: *const api::VkAllocationCallbacks,
5639 OwnedHandle::from(swapchain);
5642 #[allow(non_snake_case)]
5643 pub unsafe extern "system" fn vkGetSwapchainImagesKHR(
5644 _device: api::VkDevice,
5645 _swapchain: api::VkSwapchainKHR,
5646 _pSwapchainImageCount: *mut u32,
5647 _pSwapchainImages: *mut api::VkImage,
5648 ) -> api::VkResult {
5652 #[allow(non_snake_case)]
5653 pub unsafe extern "system" fn vkAcquireNextImageKHR(
5654 _device: api::VkDevice,
5655 _swapchain: api::VkSwapchainKHR,
5657 _semaphore: api::VkSemaphore,
5658 _fence: api::VkFence,
5659 _pImageIndex: *mut u32,
5660 ) -> api::VkResult {
5664 #[allow(non_snake_case)]
5665 pub unsafe extern "system" fn vkQueuePresentKHR(
5666 _queue: api::VkQueue,
5667 _pPresentInfo: *const api::VkPresentInfoKHR,
5668 ) -> api::VkResult {
5672 #[allow(non_snake_case)]
5673 pub unsafe extern "system" fn vkGetDeviceGroupPresentCapabilitiesKHR(
5674 _device: api::VkDevice,
5675 _pDeviceGroupPresentCapabilities: *mut api::VkDeviceGroupPresentCapabilitiesKHR,
5676 ) -> api::VkResult {
5680 #[allow(non_snake_case)]
5681 pub unsafe extern "system" fn vkGetDeviceGroupSurfacePresentModesKHR(
5682 _device: api::VkDevice,
5683 _surface: api::VkSurfaceKHR,
5684 _pModes: *mut api::VkDeviceGroupPresentModeFlagsKHR,
5685 ) -> api::VkResult {
5689 #[allow(non_snake_case)]
5690 pub unsafe extern "system" fn vkGetPhysicalDevicePresentRectanglesKHR(
5691 _physicalDevice: api::VkPhysicalDevice,
5692 _surface: api::VkSurfaceKHR,
5693 _pRectCount: *mut u32,
5694 _pRects: *mut api::VkRect2D,
5695 ) -> api::VkResult {
5699 #[allow(non_snake_case)]
5700 pub unsafe extern "system" fn vkAcquireNextImage2KHR(
5701 _device: api::VkDevice,
5702 _pAcquireInfo: *const api::VkAcquireNextImageInfoKHR,
5703 _pImageIndex: *mut u32,
5704 ) -> api::VkResult {
5708 #[allow(non_snake_case)]
5709 #[cfg(kazan_include_unused_vulkan_api)]
5710 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPropertiesKHR(
5711 _physicalDevice: api::VkPhysicalDevice,
5712 _pPropertyCount: *mut u32,
5713 _pProperties: *mut api::VkDisplayPropertiesKHR,
5714 ) -> api::VkResult {
5718 #[allow(non_snake_case)]
5719 #[cfg(kazan_include_unused_vulkan_api)]
5720 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5721 _physicalDevice: api::VkPhysicalDevice,
5722 _pPropertyCount: *mut u32,
5723 _pProperties: *mut api::VkDisplayPlanePropertiesKHR,
5724 ) -> api::VkResult {
5728 #[allow(non_snake_case)]
5729 #[cfg(kazan_include_unused_vulkan_api)]
5730 pub unsafe extern "system" fn vkGetDisplayPlaneSupportedDisplaysKHR(
5731 _physicalDevice: api::VkPhysicalDevice,
5733 _pDisplayCount: *mut u32,
5734 _pDisplays: *mut api::VkDisplayKHR,
5735 ) -> api::VkResult {
5739 #[allow(non_snake_case)]
5740 #[cfg(kazan_include_unused_vulkan_api)]
5741 pub unsafe extern "system" fn vkGetDisplayModePropertiesKHR(
5742 _physicalDevice: api::VkPhysicalDevice,
5743 _display: api::VkDisplayKHR,
5744 _pPropertyCount: *mut u32,
5745 _pProperties: *mut api::VkDisplayModePropertiesKHR,
5746 ) -> api::VkResult {
5750 #[allow(non_snake_case)]
5751 #[cfg(kazan_include_unused_vulkan_api)]
5752 pub unsafe extern "system" fn vkCreateDisplayModeKHR(
5753 _physicalDevice: api::VkPhysicalDevice,
5754 _display: api::VkDisplayKHR,
5755 _pCreateInfo: *const api::VkDisplayModeCreateInfoKHR,
5756 _pAllocator: *const api::VkAllocationCallbacks,
5757 _pMode: *mut api::VkDisplayModeKHR,
5758 ) -> api::VkResult {
5762 #[allow(non_snake_case)]
5763 #[cfg(kazan_include_unused_vulkan_api)]
5764 pub unsafe extern "system" fn vkGetDisplayPlaneCapabilitiesKHR(
5765 _physicalDevice: api::VkPhysicalDevice,
5766 _mode: api::VkDisplayModeKHR,
5768 _pCapabilities: *mut api::VkDisplayPlaneCapabilitiesKHR,
5769 ) -> api::VkResult {
5773 #[allow(non_snake_case)]
5774 #[cfg(kazan_include_unused_vulkan_api)]
5775 pub unsafe extern "system" fn vkCreateDisplayPlaneSurfaceKHR(
5776 _instance: api::VkInstance,
5777 _pCreateInfo: *const api::VkDisplaySurfaceCreateInfoKHR,
5778 _pAllocator: *const api::VkAllocationCallbacks,
5779 _pSurface: *mut api::VkSurfaceKHR,
5780 ) -> api::VkResult {
5784 #[allow(non_snake_case)]
5785 #[cfg(kazan_include_unused_vulkan_api)]
5786 pub unsafe extern "system" fn vkCreateSharedSwapchainsKHR(
5787 _device: api::VkDevice,
5788 _swapchainCount: u32,
5789 _pCreateInfos: *const api::VkSwapchainCreateInfoKHR,
5790 _pAllocator: *const api::VkAllocationCallbacks,
5791 _pSwapchains: *mut api::VkSwapchainKHR,
5792 ) -> api::VkResult {
5796 #[allow(non_snake_case)]
5797 #[cfg(kazan_include_unused_vulkan_api)]
5798 pub unsafe extern "system" fn vkGetMemoryFdKHR(
5799 _device: api::VkDevice,
5800 _pGetFdInfo: *const api::VkMemoryGetFdInfoKHR,
5802 ) -> api::VkResult {
5806 #[allow(non_snake_case)]
5807 #[cfg(kazan_include_unused_vulkan_api)]
5808 pub unsafe extern "system" fn vkGetMemoryFdPropertiesKHR(
5809 _device: api::VkDevice,
5810 _handleType: api::VkExternalMemoryHandleTypeFlagBits,
5812 _pMemoryFdProperties: *mut api::VkMemoryFdPropertiesKHR,
5813 ) -> api::VkResult {
5817 #[allow(non_snake_case)]
5818 #[cfg(kazan_include_unused_vulkan_api)]
5819 pub unsafe extern "system" fn vkImportSemaphoreFdKHR(
5820 _device: api::VkDevice,
5821 _pImportSemaphoreFdInfo: *const api::VkImportSemaphoreFdInfoKHR,
5822 ) -> api::VkResult {
5826 #[allow(non_snake_case)]
5827 #[cfg(kazan_include_unused_vulkan_api)]
5828 pub unsafe extern "system" fn vkGetSemaphoreFdKHR(
5829 _device: api::VkDevice,
5830 _pGetFdInfo: *const api::VkSemaphoreGetFdInfoKHR,
5832 ) -> api::VkResult {
5836 #[allow(non_snake_case)]
5837 #[cfg(kazan_include_unused_vulkan_api)]
5838 pub unsafe extern "system" fn vkCmdPushDescriptorSetKHR(
5839 _commandBuffer: api::VkCommandBuffer,
5840 _pipelineBindPoint: api::VkPipelineBindPoint,
5841 _layout: api::VkPipelineLayout,
5843 _descriptorWriteCount: u32,
5844 _pDescriptorWrites: *const api::VkWriteDescriptorSet,
5849 #[allow(non_snake_case)]
5850 #[cfg(kazan_include_unused_vulkan_api)]
5851 pub unsafe extern "system" fn vkCmdPushDescriptorSetWithTemplateKHR(
5852 _commandBuffer: api::VkCommandBuffer,
5853 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5854 _layout: api::VkPipelineLayout,
5856 _pData: *const c_void,
5861 #[allow(non_snake_case)]
5862 #[cfg(kazan_include_unused_vulkan_api)]
5863 pub unsafe extern "system" fn vkCreateRenderPass2KHR(
5864 _device: api::VkDevice,
5865 _pCreateInfo: *const api::VkRenderPassCreateInfo2KHR,
5866 _pAllocator: *const api::VkAllocationCallbacks,
5867 _pRenderPass: *mut api::VkRenderPass,
5868 ) -> api::VkResult {
5872 #[allow(non_snake_case)]
5873 #[cfg(kazan_include_unused_vulkan_api)]
5874 pub unsafe extern "system" fn vkCmdBeginRenderPass2KHR(
5875 _commandBuffer: api::VkCommandBuffer,
5876 _pRenderPassBegin: *const api::VkRenderPassBeginInfo,
5877 _pSubpassBeginInfo: *const api::VkSubpassBeginInfoKHR,
5882 #[allow(non_snake_case)]
5883 #[cfg(kazan_include_unused_vulkan_api)]
5884 pub unsafe extern "system" fn vkCmdNextSubpass2KHR(
5885 _commandBuffer: api::VkCommandBuffer,
5886 _pSubpassBeginInfo: *const api::VkSubpassBeginInfoKHR,
5887 _pSubpassEndInfo: *const api::VkSubpassEndInfoKHR,
5892 #[allow(non_snake_case)]
5893 #[cfg(kazan_include_unused_vulkan_api)]
5894 pub unsafe extern "system" fn vkCmdEndRenderPass2KHR(
5895 _commandBuffer: api::VkCommandBuffer,
5896 _pSubpassEndInfo: *const api::VkSubpassEndInfoKHR,
5901 #[allow(non_snake_case)]
5902 #[cfg(kazan_include_unused_vulkan_api)]
5903 pub unsafe extern "system" fn vkGetSwapchainStatusKHR(
5904 _device: api::VkDevice,
5905 _swapchain: api::VkSwapchainKHR,
5906 ) -> api::VkResult {
5910 #[allow(non_snake_case)]
5911 #[cfg(kazan_include_unused_vulkan_api)]
5912 pub unsafe extern "system" fn vkImportFenceFdKHR(
5913 _device: api::VkDevice,
5914 _pImportFenceFdInfo: *const api::VkImportFenceFdInfoKHR,
5915 ) -> api::VkResult {
5919 #[allow(non_snake_case)]
5920 #[cfg(kazan_include_unused_vulkan_api)]
5921 pub unsafe extern "system" fn vkGetFenceFdKHR(
5922 _device: api::VkDevice,
5923 _pGetFdInfo: *const api::VkFenceGetFdInfoKHR,
5925 ) -> api::VkResult {
5929 #[allow(non_snake_case)]
5930 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilities2KHR(
5931 _physical_device: api::VkPhysicalDevice,
5932 surface_info: *const api::VkPhysicalDeviceSurfaceInfo2KHR,
5933 surface_capabilities: *mut api::VkSurfaceCapabilities2KHR,
5934 ) -> api::VkResult {
5935 parse_next_chain_const! {
5937 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
5939 let surface_info = &*surface_info;
5940 parse_next_chain_mut! {
5941 surface_capabilities,
5942 root = api::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
5944 let surface_capabilities = &mut *surface_capabilities;
5945 let surface_implementation =
5946 SurfacePlatform::from(SharedHandle::from(surface_info.surface).unwrap().platform)
5948 .get_surface_implementation();
5949 match surface_implementation.get_capabilities(surface_info.surface) {
5950 Ok(capabilities) => {
5951 surface_capabilities.surfaceCapabilities = capabilities;
5954 Err(result) => result,
5958 #[allow(non_snake_case)]
5959 #[cfg(kazan_include_unused_vulkan_api)]
5960 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceFormats2KHR(
5961 _physicalDevice: api::VkPhysicalDevice,
5962 _pSurfaceInfo: *const api::VkPhysicalDeviceSurfaceInfo2KHR,
5963 _pSurfaceFormatCount: *mut u32,
5964 _pSurfaceFormats: *mut api::VkSurfaceFormat2KHR,
5965 ) -> api::VkResult {
5969 #[allow(non_snake_case)]
5970 #[cfg(kazan_include_unused_vulkan_api)]
5971 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayProperties2KHR(
5972 _physicalDevice: api::VkPhysicalDevice,
5973 _pPropertyCount: *mut u32,
5974 _pProperties: *mut api::VkDisplayProperties2KHR,
5975 ) -> api::VkResult {
5979 #[allow(non_snake_case)]
5980 #[cfg(kazan_include_unused_vulkan_api)]
5981 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
5982 _physicalDevice: api::VkPhysicalDevice,
5983 _pPropertyCount: *mut u32,
5984 _pProperties: *mut api::VkDisplayPlaneProperties2KHR,
5985 ) -> api::VkResult {
5989 #[allow(non_snake_case)]
5990 #[cfg(kazan_include_unused_vulkan_api)]
5991 pub unsafe extern "system" fn vkGetDisplayModeProperties2KHR(
5992 _physicalDevice: api::VkPhysicalDevice,
5993 _display: api::VkDisplayKHR,
5994 _pPropertyCount: *mut u32,
5995 _pProperties: *mut api::VkDisplayModeProperties2KHR,
5996 ) -> api::VkResult {
6000 #[allow(non_snake_case)]
6001 #[cfg(kazan_include_unused_vulkan_api)]
6002 pub unsafe extern "system" fn vkGetDisplayPlaneCapabilities2KHR(
6003 _physicalDevice: api::VkPhysicalDevice,
6004 _pDisplayPlaneInfo: *const api::VkDisplayPlaneInfo2KHR,
6005 _pCapabilities: *mut api::VkDisplayPlaneCapabilities2KHR,
6006 ) -> api::VkResult {
6010 #[allow(non_snake_case)]
6011 #[cfg(kazan_include_unused_vulkan_api)]
6012 pub unsafe extern "system" fn vkCmdDrawIndirectCountKHR(
6013 _commandBuffer: api::VkCommandBuffer,
6014 _buffer: api::VkBuffer,
6015 _offset: api::VkDeviceSize,
6016 _countBuffer: api::VkBuffer,
6017 _countBufferOffset: api::VkDeviceSize,
6024 #[allow(non_snake_case)]
6025 #[cfg(kazan_include_unused_vulkan_api)]
6026 pub unsafe extern "system" fn vkCmdDrawIndexedIndirectCountKHR(
6027 _commandBuffer: api::VkCommandBuffer,
6028 _buffer: api::VkBuffer,
6029 _offset: api::VkDeviceSize,
6030 _countBuffer: api::VkBuffer,
6031 _countBufferOffset: api::VkDeviceSize,
6038 #[allow(non_snake_case)]
6039 #[cfg(kazan_include_unused_vulkan_api)]
6040 pub unsafe extern "system" fn vkCreateDebugReportCallbackEXT(
6041 _instance: api::VkInstance,
6042 _pCreateInfo: *const api::VkDebugReportCallbackCreateInfoEXT,
6043 _pAllocator: *const api::VkAllocationCallbacks,
6044 _pCallback: *mut api::VkDebugReportCallbackEXT,
6045 ) -> api::VkResult {
6049 #[allow(non_snake_case)]
6050 #[cfg(kazan_include_unused_vulkan_api)]
6051 pub unsafe extern "system" fn vkDestroyDebugReportCallbackEXT(
6052 _instance: api::VkInstance,
6053 _callback: api::VkDebugReportCallbackEXT,
6054 _pAllocator: *const api::VkAllocationCallbacks,
6059 #[allow(non_snake_case)]
6060 #[cfg(kazan_include_unused_vulkan_api)]
6061 pub unsafe extern "system" fn vkDebugReportMessageEXT(
6062 _instance: api::VkInstance,
6063 _flags: api::VkDebugReportFlagsEXT,
6064 _objectType: api::VkDebugReportObjectTypeEXT,
6068 _pLayerPrefix: *const c_char,
6069 _pMessage: *const c_char,
6074 #[allow(non_snake_case)]
6075 #[cfg(kazan_include_unused_vulkan_api)]
6076 pub unsafe extern "system" fn vkDebugMarkerSetObjectTagEXT(
6077 _device: api::VkDevice,
6078 _pTagInfo: *const api::VkDebugMarkerObjectTagInfoEXT,
6079 ) -> api::VkResult {
6083 #[allow(non_snake_case)]
6084 #[cfg(kazan_include_unused_vulkan_api)]
6085 pub unsafe extern "system" fn vkDebugMarkerSetObjectNameEXT(
6086 _device: api::VkDevice,
6087 _pNameInfo: *const api::VkDebugMarkerObjectNameInfoEXT,
6088 ) -> api::VkResult {
6092 #[allow(non_snake_case)]
6093 #[cfg(kazan_include_unused_vulkan_api)]
6094 pub unsafe extern "system" fn vkCmdDebugMarkerBeginEXT(
6095 _commandBuffer: api::VkCommandBuffer,
6096 _pMarkerInfo: *const api::VkDebugMarkerMarkerInfoEXT,
6101 #[allow(non_snake_case)]
6102 #[cfg(kazan_include_unused_vulkan_api)]
6103 pub unsafe extern "system" fn vkCmdDebugMarkerEndEXT(_commandBuffer: api::VkCommandBuffer) {
6107 #[allow(non_snake_case)]
6108 #[cfg(kazan_include_unused_vulkan_api)]
6109 pub unsafe extern "system" fn vkCmdDebugMarkerInsertEXT(
6110 _commandBuffer: api::VkCommandBuffer,
6111 _pMarkerInfo: *const api::VkDebugMarkerMarkerInfoEXT,
6116 #[allow(non_snake_case)]
6117 #[cfg(kazan_include_unused_vulkan_api)]
6118 pub unsafe extern "system" fn vkCmdDrawIndirectCountAMD(
6119 _commandBuffer: api::VkCommandBuffer,
6120 _buffer: api::VkBuffer,
6121 _offset: api::VkDeviceSize,
6122 _countBuffer: api::VkBuffer,
6123 _countBufferOffset: api::VkDeviceSize,
6130 #[allow(non_snake_case)]
6131 #[cfg(kazan_include_unused_vulkan_api)]
6132 pub unsafe extern "system" fn vkCmdDrawIndexedIndirectCountAMD(
6133 _commandBuffer: api::VkCommandBuffer,
6134 _buffer: api::VkBuffer,
6135 _offset: api::VkDeviceSize,
6136 _countBuffer: api::VkBuffer,
6137 _countBufferOffset: api::VkDeviceSize,
6144 #[allow(non_snake_case)]
6145 #[cfg(kazan_include_unused_vulkan_api)]
6146 pub unsafe extern "system" fn vkGetShaderInfoAMD(
6147 _device: api::VkDevice,
6148 _pipeline: api::VkPipeline,
6149 _shaderStage: api::VkShaderStageFlagBits,
6150 _infoType: api::VkShaderInfoTypeAMD,
6151 _pInfoSize: *mut usize,
6152 _pInfo: *mut c_void,
6153 ) -> api::VkResult {
6157 #[allow(non_snake_case)]
6158 #[cfg(kazan_include_unused_vulkan_api)]
6159 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6160 _physicalDevice: api::VkPhysicalDevice,
6161 _format: api::VkFormat,
6162 _type_: api::VkImageType,
6163 _tiling: api::VkImageTiling,
6164 _usage: api::VkImageUsageFlags,
6165 _flags: api::VkImageCreateFlags,
6166 _externalHandleType: api::VkExternalMemoryHandleTypeFlagsNV,
6167 _pExternalImageFormatProperties: *mut api::VkExternalImageFormatPropertiesNV,
6168 ) -> api::VkResult {
6172 #[allow(non_snake_case)]
6173 #[cfg(kazan_include_unused_vulkan_api)]
6174 pub unsafe extern "system" fn vkCmdBeginConditionalRenderingEXT(
6175 _commandBuffer: api::VkCommandBuffer,
6176 _pConditionalRenderingBegin: *const api::VkConditionalRenderingBeginInfoEXT,
6181 #[allow(non_snake_case)]
6182 #[cfg(kazan_include_unused_vulkan_api)]
6183 pub unsafe extern "system" fn vkCmdEndConditionalRenderingEXT(
6184 _commandBuffer: api::VkCommandBuffer,
6189 #[allow(non_snake_case)]
6190 #[cfg(kazan_include_unused_vulkan_api)]
6191 pub unsafe extern "system" fn vkCmdSetViewportWScalingNV(
6192 _commandBuffer: api::VkCommandBuffer,
6193 _firstViewport: u32,
6194 _viewportCount: u32,
6195 _pViewportWScalings: *const api::VkViewportWScalingNV,
6200 #[allow(non_snake_case)]
6201 #[cfg(kazan_include_unused_vulkan_api)]
6202 pub unsafe extern "system" fn vkReleaseDisplayEXT(
6203 _physicalDevice: api::VkPhysicalDevice,
6204 _display: api::VkDisplayKHR,
6205 ) -> api::VkResult {
6209 #[allow(non_snake_case)]
6210 #[cfg(kazan_include_unused_vulkan_api)]
6211 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilities2EXT(
6212 _physicalDevice: api::VkPhysicalDevice,
6213 _surface: api::VkSurfaceKHR,
6214 _pSurfaceCapabilities: *mut api::VkSurfaceCapabilities2EXT,
6215 ) -> api::VkResult {
6219 #[allow(non_snake_case)]
6220 #[cfg(kazan_include_unused_vulkan_api)]
6221 pub unsafe extern "system" fn vkDisplayPowerControlEXT(
6222 _device: api::VkDevice,
6223 _display: api::VkDisplayKHR,
6224 _pDisplayPowerInfo: *const api::VkDisplayPowerInfoEXT,
6225 ) -> api::VkResult {
6229 #[allow(non_snake_case)]
6230 #[cfg(kazan_include_unused_vulkan_api)]
6231 pub unsafe extern "system" fn vkRegisterDeviceEventEXT(
6232 _device: api::VkDevice,
6233 _pDeviceEventInfo: *const api::VkDeviceEventInfoEXT,
6234 _pAllocator: *const api::VkAllocationCallbacks,
6235 _pFence: *mut api::VkFence,
6236 ) -> api::VkResult {
6240 #[allow(non_snake_case)]
6241 #[cfg(kazan_include_unused_vulkan_api)]
6242 pub unsafe extern "system" fn vkRegisterDisplayEventEXT(
6243 _device: api::VkDevice,
6244 _display: api::VkDisplayKHR,
6245 _pDisplayEventInfo: *const api::VkDisplayEventInfoEXT,
6246 _pAllocator: *const api::VkAllocationCallbacks,
6247 _pFence: *mut api::VkFence,
6248 ) -> api::VkResult {
6252 #[allow(non_snake_case)]
6253 #[cfg(kazan_include_unused_vulkan_api)]
6254 pub unsafe extern "system" fn vkGetSwapchainCounterEXT(
6255 _device: api::VkDevice,
6256 _swapchain: api::VkSwapchainKHR,
6257 _counter: api::VkSurfaceCounterFlagBitsEXT,
6258 _pCounterValue: *mut u64,
6259 ) -> api::VkResult {
6263 #[allow(non_snake_case)]
6264 #[cfg(kazan_include_unused_vulkan_api)]
6265 pub unsafe extern "system" fn vkGetRefreshCycleDurationGOOGLE(
6266 _device: api::VkDevice,
6267 _swapchain: api::VkSwapchainKHR,
6268 _pDisplayTimingProperties: *mut api::VkRefreshCycleDurationGOOGLE,
6269 ) -> api::VkResult {
6273 #[allow(non_snake_case)]
6274 #[cfg(kazan_include_unused_vulkan_api)]
6275 pub unsafe extern "system" fn vkGetPastPresentationTimingGOOGLE(
6276 _device: api::VkDevice,
6277 _swapchain: api::VkSwapchainKHR,
6278 _pPresentationTimingCount: *mut u32,
6279 _pPresentationTimings: *mut api::VkPastPresentationTimingGOOGLE,
6280 ) -> api::VkResult {
6284 #[allow(non_snake_case)]
6285 #[cfg(kazan_include_unused_vulkan_api)]
6286 pub unsafe extern "system" fn vkCmdSetDiscardRectangleEXT(
6287 _commandBuffer: api::VkCommandBuffer,
6288 _firstDiscardRectangle: u32,
6289 _discardRectangleCount: u32,
6290 _pDiscardRectangles: *const api::VkRect2D,
6295 #[allow(non_snake_case)]
6296 #[cfg(kazan_include_unused_vulkan_api)]
6297 pub unsafe extern "system" fn vkSetHdrMetadataEXT(
6298 _device: api::VkDevice,
6299 _swapchainCount: u32,
6300 _pSwapchains: *const api::VkSwapchainKHR,
6301 _pMetadata: *const api::VkHdrMetadataEXT,
6306 #[allow(non_snake_case)]
6307 #[cfg(kazan_include_unused_vulkan_api)]
6308 pub unsafe extern "system" fn vkSetDebugUtilsObjectNameEXT(
6309 _device: api::VkDevice,
6310 _pNameInfo: *const api::VkDebugUtilsObjectNameInfoEXT,
6311 ) -> api::VkResult {
6315 #[allow(non_snake_case)]
6316 #[cfg(kazan_include_unused_vulkan_api)]
6317 pub unsafe extern "system" fn vkSetDebugUtilsObjectTagEXT(
6318 _device: api::VkDevice,
6319 _pTagInfo: *const api::VkDebugUtilsObjectTagInfoEXT,
6320 ) -> api::VkResult {
6324 #[allow(non_snake_case)]
6325 #[cfg(kazan_include_unused_vulkan_api)]
6326 pub unsafe extern "system" fn vkQueueBeginDebugUtilsLabelEXT(
6327 _queue: api::VkQueue,
6328 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6333 #[allow(non_snake_case)]
6334 #[cfg(kazan_include_unused_vulkan_api)]
6335 pub unsafe extern "system" fn vkQueueEndDebugUtilsLabelEXT(_queue: api::VkQueue) {
6339 #[allow(non_snake_case)]
6340 #[cfg(kazan_include_unused_vulkan_api)]
6341 pub unsafe extern "system" fn vkQueueInsertDebugUtilsLabelEXT(
6342 _queue: api::VkQueue,
6343 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6348 #[allow(non_snake_case)]
6349 #[cfg(kazan_include_unused_vulkan_api)]
6350 pub unsafe extern "system" fn vkCmdBeginDebugUtilsLabelEXT(
6351 _commandBuffer: api::VkCommandBuffer,
6352 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6357 #[allow(non_snake_case)]
6358 #[cfg(kazan_include_unused_vulkan_api)]
6359 pub unsafe extern "system" fn vkCmdEndDebugUtilsLabelEXT(_commandBuffer: api::VkCommandBuffer) {
6363 #[allow(non_snake_case)]
6364 #[cfg(kazan_include_unused_vulkan_api)]
6365 pub unsafe extern "system" fn vkCmdInsertDebugUtilsLabelEXT(
6366 _commandBuffer: api::VkCommandBuffer,
6367 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6372 #[allow(non_snake_case)]
6373 #[cfg(kazan_include_unused_vulkan_api)]
6374 pub unsafe extern "system" fn vkCreateDebugUtilsMessengerEXT(
6375 _instance: api::VkInstance,
6376 _pCreateInfo: *const api::VkDebugUtilsMessengerCreateInfoEXT,
6377 _pAllocator: *const api::VkAllocationCallbacks,
6378 _pMessenger: *mut api::VkDebugUtilsMessengerEXT,
6379 ) -> api::VkResult {
6383 #[allow(non_snake_case)]
6384 #[cfg(kazan_include_unused_vulkan_api)]
6385 pub unsafe extern "system" fn vkDestroyDebugUtilsMessengerEXT(
6386 _instance: api::VkInstance,
6387 _messenger: api::VkDebugUtilsMessengerEXT,
6388 _pAllocator: *const api::VkAllocationCallbacks,
6393 #[allow(non_snake_case)]
6394 #[cfg(kazan_include_unused_vulkan_api)]
6395 pub unsafe extern "system" fn vkSubmitDebugUtilsMessageEXT(
6396 _instance: api::VkInstance,
6397 _messageSeverity: api::VkDebugUtilsMessageSeverityFlagBitsEXT,
6398 _messageTypes: api::VkDebugUtilsMessageTypeFlagsEXT,
6399 _pCallbackData: *const api::VkDebugUtilsMessengerCallbackDataEXT,
6404 #[allow(non_snake_case)]
6405 #[cfg(kazan_include_unused_vulkan_api)]
6406 pub unsafe extern "system" fn vkCmdSetSampleLocationsEXT(
6407 _commandBuffer: api::VkCommandBuffer,
6408 _pSampleLocationsInfo: *const api::VkSampleLocationsInfoEXT,
6413 #[allow(non_snake_case)]
6414 #[cfg(kazan_include_unused_vulkan_api)]
6415 pub unsafe extern "system" fn vkGetPhysicalDeviceMultisamplePropertiesEXT(
6416 _physicalDevice: api::VkPhysicalDevice,
6417 _samples: api::VkSampleCountFlagBits,
6418 _pMultisampleProperties: *mut api::VkMultisamplePropertiesEXT,
6423 #[allow(non_snake_case)]
6424 #[cfg(kazan_include_unused_vulkan_api)]
6425 pub unsafe extern "system" fn vkCreateValidationCacheEXT(
6426 _device: api::VkDevice,
6427 _pCreateInfo: *const api::VkValidationCacheCreateInfoEXT,
6428 _pAllocator: *const api::VkAllocationCallbacks,
6429 _pValidationCache: *mut api::VkValidationCacheEXT,
6430 ) -> api::VkResult {
6434 #[allow(non_snake_case)]
6435 #[cfg(kazan_include_unused_vulkan_api)]
6436 pub unsafe extern "system" fn vkDestroyValidationCacheEXT(
6437 _device: api::VkDevice,
6438 _validationCache: api::VkValidationCacheEXT,
6439 _pAllocator: *const api::VkAllocationCallbacks,
6444 #[allow(non_snake_case)]
6445 #[cfg(kazan_include_unused_vulkan_api)]
6446 pub unsafe extern "system" fn vkMergeValidationCachesEXT(
6447 _device: api::VkDevice,
6448 _dstCache: api::VkValidationCacheEXT,
6449 _srcCacheCount: u32,
6450 _pSrcCaches: *const api::VkValidationCacheEXT,
6451 ) -> api::VkResult {
6455 #[allow(non_snake_case)]
6456 #[cfg(kazan_include_unused_vulkan_api)]
6457 pub unsafe extern "system" fn vkGetValidationCacheDataEXT(
6458 _device: api::VkDevice,
6459 _validationCache: api::VkValidationCacheEXT,
6460 _pDataSize: *mut usize,
6461 _pData: *mut c_void,
6462 ) -> api::VkResult {
6466 #[allow(non_snake_case)]
6467 #[cfg(kazan_include_unused_vulkan_api)]
6468 pub unsafe extern "system" fn vkCmdBindShadingRateImageNV(
6469 _commandBuffer: api::VkCommandBuffer,
6470 _imageView: api::VkImageView,
6471 _imageLayout: api::VkImageLayout,
6476 #[allow(non_snake_case)]
6477 #[cfg(kazan_include_unused_vulkan_api)]
6478 pub unsafe extern "system" fn vkCmdSetViewportShadingRatePaletteNV(
6479 _commandBuffer: api::VkCommandBuffer,
6480 _firstViewport: u32,
6481 _viewportCount: u32,
6482 _pShadingRatePalettes: *const api::VkShadingRatePaletteNV,
6487 #[allow(non_snake_case)]
6488 #[cfg(kazan_include_unused_vulkan_api)]
6489 pub unsafe extern "system" fn vkCmdSetCoarseSampleOrderNV(
6490 _commandBuffer: api::VkCommandBuffer,
6491 _sampleOrderType: api::VkCoarseSampleOrderTypeNV,
6492 _customSampleOrderCount: u32,
6493 _pCustomSampleOrders: *const api::VkCoarseSampleOrderCustomNV,
6498 #[allow(non_snake_case)]
6499 #[cfg(kazan_include_unused_vulkan_api)]
6500 pub unsafe extern "system" fn vkGetMemoryHostPointerPropertiesEXT(
6501 _device: api::VkDevice,
6502 _handleType: api::VkExternalMemoryHandleTypeFlagBits,
6503 _pHostPointer: *const c_void,
6504 _pMemoryHostPointerProperties: *mut api::VkMemoryHostPointerPropertiesEXT,
6505 ) -> api::VkResult {
6509 #[allow(non_snake_case)]
6510 #[cfg(kazan_include_unused_vulkan_api)]
6511 pub unsafe extern "system" fn vkCmdWriteBufferMarkerAMD(
6512 _commandBuffer: api::VkCommandBuffer,
6513 _pipelineStage: api::VkPipelineStageFlagBits,
6514 _dstBuffer: api::VkBuffer,
6515 _dstOffset: api::VkDeviceSize,
6521 #[allow(non_snake_case)]
6522 #[cfg(kazan_include_unused_vulkan_api)]
6523 pub unsafe extern "system" fn vkCmdDrawMeshTasksNV(
6524 _commandBuffer: api::VkCommandBuffer,
6531 #[allow(non_snake_case)]
6532 #[cfg(kazan_include_unused_vulkan_api)]
6533 pub unsafe extern "system" fn vkCmdDrawMeshTasksIndirectNV(
6534 _commandBuffer: api::VkCommandBuffer,
6535 _buffer: api::VkBuffer,
6536 _offset: api::VkDeviceSize,
6543 #[allow(non_snake_case)]
6544 #[cfg(kazan_include_unused_vulkan_api)]
6545 pub unsafe extern "system" fn vkCmdDrawMeshTasksIndirectCountNV(
6546 _commandBuffer: api::VkCommandBuffer,
6547 _buffer: api::VkBuffer,
6548 _offset: api::VkDeviceSize,
6549 _countBuffer: api::VkBuffer,
6550 _countBufferOffset: api::VkDeviceSize,
6557 #[allow(non_snake_case)]
6558 #[cfg(kazan_include_unused_vulkan_api)]
6559 pub unsafe extern "system" fn vkCmdSetExclusiveScissorNV(
6560 _commandBuffer: api::VkCommandBuffer,
6561 _firstExclusiveScissor: u32,
6562 _exclusiveScissorCount: u32,
6563 _pExclusiveScissors: *const api::VkRect2D,
6568 #[allow(non_snake_case)]
6569 #[cfg(kazan_include_unused_vulkan_api)]
6570 pub unsafe extern "system" fn vkCmdSetCheckpointNV(
6571 _commandBuffer: api::VkCommandBuffer,
6572 _pCheckpointMarker: *const c_void,
6577 #[allow(non_snake_case)]
6578 #[cfg(kazan_include_unused_vulkan_api)]
6579 pub unsafe extern "system" fn vkGetQueueCheckpointDataNV(
6580 _queue: api::VkQueue,
6581 _pCheckpointDataCount: *mut u32,
6582 _pCheckpointData: *mut api::VkCheckpointDataNV,
6587 #[cfg(target_os = "linux")]
6588 #[allow(non_snake_case)]
6589 pub unsafe extern "system" fn vkCreateXcbSurfaceKHR(
6590 _instance: api::VkInstance,
6591 create_info: *const api::VkXcbSurfaceCreateInfoKHR,
6592 _allocator: *const api::VkAllocationCallbacks,
6593 surface: *mut api::VkSurfaceKHR,
6594 ) -> api::VkResult {
6595 parse_next_chain_const! {
6597 root = api::VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
6599 let create_info = &*create_info;
6600 let new_surface = Box::new(api::VkIcdSurfaceXcb {
6601 base: api::VkIcdSurfaceBase {
6602 platform: api::VK_ICD_WSI_PLATFORM_XCB,
6604 connection: create_info.connection,
6605 window: create_info.window,
6607 *surface = api::VkSurfaceKHR::new(NonNull::new(
6608 Box::into_raw(new_surface) as *mut api::VkIcdSurfaceBase
6613 #[cfg(target_os = "linux")]
6614 #[allow(non_snake_case)]
6615 pub unsafe extern "system" fn vkGetPhysicalDeviceXcbPresentationSupportKHR(
6616 _physicalDevice: api::VkPhysicalDevice,
6617 _queueFamilyIndex: u32,
6618 _connection: *mut xcb::ffi::xcb_connection_t,
6619 _visual_id: xcb::ffi::xcb_visualid_t,
6620 ) -> api::VkBool32 {