c7217dce1ff4dd59dc22069a192b82f4da8cb0b9
[kazan.git] / vulkan-driver / src / api_impl.rs
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 // Copyright 2018 Jacob Lifshay
3 #![allow(dead_code)]
4 use api;
5 use buffer::Buffer;
6 use constants::*;
7 use device_memory::{
8 DeviceMemory, DeviceMemoryAllocation, DeviceMemoryHeap, DeviceMemoryHeaps, DeviceMemoryLayout,
9 DeviceMemoryType, DeviceMemoryTypes,
10 };
11 use enum_map::EnumMap;
12 use handle::{Handle, OwnedHandle, SharedHandle};
13 use sampler;
14 use sampler::Sampler;
15 use shader_module::ShaderModule;
16 use std::ffi::CStr;
17 use std::iter;
18 use std::iter::FromIterator;
19 use std::mem;
20 use std::ops::*;
21 use std::os::raw::{c_char, c_int, c_void};
22 use std::ptr::null;
23 use std::ptr::null_mut;
24 use std::ptr::NonNull;
25 use std::slice;
26 use std::str::FromStr;
27 use swapchain::{SurfaceImplementation, SurfacePlatform, Swapchain};
28 use sys_info;
29 use uuid;
30 #[cfg(unix)]
31 use xcb;
32
33 /// structure types the driver should know about
34 fn is_supported_structure_type(v: api::VkStructureType) -> bool {
35 #[cfg(unix)]
36 {
37 match v {
38 api::VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR => return true,
39 _ => {}
40 }
41 }
42 match v {
43 api::VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR
44 | api::VK_STRUCTURE_TYPE_APPLICATION_INFO
45 | api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO
46 | api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO
47 | api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO
48 | api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO
49 | api::VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR
50 | api::VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO
51 | api::VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
52 | api::VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
53 | api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
54 | api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2
55 | api::VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
56 | api::VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
57 | api::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
58 | api::VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
59 | api::VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
60 | api::VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
61 | api::VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
62 | api::VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
63 | api::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
64 | api::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
65 | api::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT
66 | api::VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO
67 | api::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
68 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO
69 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO
70 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO
71 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR
72 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR
73 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO
74 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO
75 | api::VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR
76 | api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
77 | api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2
78 | api::VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
79 | api::VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO
80 | api::VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO
81 | api::VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO
82 | api::VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES
83 | api::VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES
84 | api::VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES
85 | api::VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO
86 | api::VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO
87 | api::VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES
88 | api::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
89 | api::VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2
90 | api::VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
91 | api::VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
92 | api::VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
93 | api::VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2
94 | api::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
95 | api::VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2
96 | api::VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO
97 | api::VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2
98 | api::VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR
99 | api::VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
100 | api::VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO
101 | api::VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
102 | api::VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
103 | api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO
104 | api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
105 | api::VK_STRUCTURE_TYPE_MEMORY_BARRIER
106 | api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO
107 | api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS
108 | api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2
109 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES
110 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO
111 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO
112 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO
113 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO
114 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2
115 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES
116 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES
117 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2
118 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES
119 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2
120 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES
121 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES
122 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES
123 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2
124 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES
125 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES
126 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES
127 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES
128 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2
129 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES
130 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR
131 | api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES
132 | api::VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
133 | api::VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
134 | api::VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
135 | api::VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
136 | api::VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
137 | api::VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
138 | api::VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
139 | api::VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
140 | api::VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
141 | api::VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO
142 | api::VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
143 | api::VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
144 | api::VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
145 | api::VK_STRUCTURE_TYPE_PRESENT_INFO_KHR
146 | api::VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO
147 | api::VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
148 | api::VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2
149 | api::VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
150 | api::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
151 | api::VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO
152 | api::VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO
153 | api::VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
154 | api::VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO
155 | api::VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES
156 | api::VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO
157 | api::VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
158 | api::VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
159 | api::VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2
160 | api::VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2
161 | api::VK_STRUCTURE_TYPE_SUBMIT_INFO
162 | api::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR
163 | api::VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR
164 | api::VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET => true,
165 _ => false,
166 }
167 }
168
169 fn verify_structure_type_is_supported(v: api::VkStructureType) {
170 assert!(
171 is_supported_structure_type(v),
172 "missing structure type in is_supported_structure_type: {:?}",
173 v
174 );
175 }
176
177 unsafe fn parse_next_chain_const(
178 root: *const api::VkBaseInStructure,
179 expected_root_struct_type: api::VkStructureType,
180 expected_child_structs: &[(api::VkStructureType, *mut *const api::VkBaseInStructure)],
181 ) {
182 verify_structure_type_is_supported(expected_root_struct_type);
183 let ref root = *root;
184 assert_eq!(root.sType, expected_root_struct_type);
185 for &(child_struct_type, child_struct) in expected_child_structs.iter() {
186 verify_structure_type_is_supported(child_struct_type);
187 *child_struct = null();
188 }
189 let mut child = root.pNext as *const api::VkBaseInStructure;
190 while !child.is_null() {
191 let ref child_ref = *child;
192 let search_for_type = child_ref.sType;
193 let mut found = false;
194 for &(child_struct_type, child_struct) in expected_child_structs.iter() {
195 if child_struct_type == search_for_type {
196 assert!(
197 (*child_struct).is_null(),
198 "duplicate struct type in pNext chain: {:?}",
199 search_for_type
200 );
201 *child_struct = child;
202 found = true;
203 break;
204 }
205 }
206 assert!(
207 found || !is_supported_structure_type(search_for_type),
208 "unexpected struct type in pNext chain: {:?}",
209 search_for_type
210 );
211 child = child_ref.pNext as *const _;
212 }
213 }
214
215 unsafe fn parse_next_chain_mut(
216 root: *mut api::VkBaseOutStructure,
217 expected_root_struct_type: api::VkStructureType,
218 expected_child_structs: &[(api::VkStructureType, *mut *mut api::VkBaseOutStructure)],
219 ) {
220 parse_next_chain_const(
221 root as *const api::VkBaseInStructure,
222 expected_root_struct_type,
223 mem::transmute(expected_child_structs),
224 )
225 }
226
227 macro_rules! parse_next_chain_const {
228 {
229 $root:expr,
230 root = $root_type:expr,
231 $($name:ident: $var_type:ty = $struct_type:expr,)*
232 } => {
233 $(let mut $name: *const $var_type = null();)*
234 parse_next_chain_const(
235 $root as *const api::VkBaseInStructure,
236 $root_type,
237 &[$(($struct_type, &mut $name as *mut *const $var_type as *mut *const api::VkBaseInStructure)),*]
238 );
239 };
240 }
241
242 macro_rules! parse_next_chain_mut {
243 {
244 $root:expr,
245 root = $root_type:expr,
246 $($name:ident: $var_type:ty = $struct_type:expr,)*
247 } => {
248 $(let mut $name: *mut $var_type = null_mut();)*
249 parse_next_chain_mut(
250 $root as *mut api::VkBaseOutStructure,
251 $root_type,
252 &[$(($struct_type, &mut $name as *mut *mut $var_type as *mut *mut api::VkBaseOutStructure)),*]
253 );
254 };
255 }
256
257 fn copy_str_to_char_array(dest: &mut [c_char], src: &str) {
258 assert!(dest.len() >= src.len() + 1);
259 let src = src.as_bytes();
260 for i in 0..src.len() {
261 dest[i] = src[i] as c_char;
262 }
263 for i in src.len()..dest.len() {
264 dest[i] = 0;
265 }
266 }
267
268 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Enum)]
269 #[repr(u32)]
270 #[allow(non_camel_case_types)]
271 pub enum Extension {
272 VK_KHR_surface,
273 VK_KHR_bind_memory2,
274 VK_KHR_device_group_creation,
275 VK_KHR_device_group,
276 VK_KHR_descriptor_update_template,
277 VK_KHR_maintenance1,
278 VK_KHR_get_memory_requirements2,
279 VK_KHR_get_physical_device_properties2,
280 VK_KHR_sampler_ycbcr_conversion,
281 VK_KHR_maintenance2,
282 VK_KHR_maintenance3,
283 VK_KHR_external_memory_capabilities,
284 VK_KHR_external_fence_capabilities,
285 VK_KHR_external_semaphore_capabilities,
286 VK_KHR_16bit_storage,
287 VK_KHR_storage_buffer_storage_class,
288 VK_KHR_dedicated_allocation,
289 VK_KHR_external_fence,
290 VK_KHR_external_memory,
291 VK_KHR_external_semaphore,
292 VK_KHR_multiview,
293 VK_KHR_relaxed_block_layout,
294 VK_KHR_shader_draw_parameters,
295 VK_KHR_variable_pointers,
296 VK_KHR_swapchain,
297 #[cfg(unix)]
298 VK_KHR_xcb_surface,
299 }
300
301 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
302 pub enum ExtensionScope {
303 Device,
304 Instance,
305 }
306
307 macro_rules! extensions {
308 [$($extension:expr),*] => {
309 {
310 let extensions: Extensions = [$($extension),*].iter().map(|v|*v).collect();
311 extensions
312 }
313 };
314 }
315
316 impl Extension {
317 pub fn get_required_extensions(self) -> Extensions {
318 match self {
319 Extension::VK_KHR_surface
320 | Extension::VK_KHR_bind_memory2
321 | Extension::VK_KHR_device_group_creation
322 | Extension::VK_KHR_descriptor_update_template
323 | Extension::VK_KHR_maintenance1
324 | Extension::VK_KHR_get_memory_requirements2
325 | Extension::VK_KHR_get_physical_device_properties2
326 | Extension::VK_KHR_maintenance2
327 | Extension::VK_KHR_storage_buffer_storage_class
328 | Extension::VK_KHR_relaxed_block_layout
329 | Extension::VK_KHR_shader_draw_parameters => extensions![],
330 Extension::VK_KHR_device_group => extensions![Extension::VK_KHR_device_group_creation],
331 Extension::VK_KHR_sampler_ycbcr_conversion => extensions![
332 Extension::VK_KHR_maintenance1,
333 Extension::VK_KHR_bind_memory2,
334 Extension::VK_KHR_get_memory_requirements2,
335 Extension::VK_KHR_get_physical_device_properties2
336 ],
337 Extension::VK_KHR_maintenance3
338 | Extension::VK_KHR_external_memory_capabilities
339 | Extension::VK_KHR_external_fence_capabilities
340 | Extension::VK_KHR_external_semaphore_capabilities
341 | Extension::VK_KHR_multiview => {
342 extensions![Extension::VK_KHR_get_physical_device_properties2]
343 }
344 Extension::VK_KHR_16bit_storage | Extension::VK_KHR_variable_pointers => extensions![
345 Extension::VK_KHR_get_physical_device_properties2,
346 Extension::VK_KHR_storage_buffer_storage_class
347 ],
348 Extension::VK_KHR_dedicated_allocation => {
349 extensions![Extension::VK_KHR_get_memory_requirements2]
350 }
351 Extension::VK_KHR_external_fence => {
352 extensions![Extension::VK_KHR_external_fence_capabilities]
353 }
354 Extension::VK_KHR_external_memory => {
355 extensions![Extension::VK_KHR_external_memory_capabilities]
356 }
357 Extension::VK_KHR_external_semaphore => {
358 extensions![Extension::VK_KHR_external_semaphore_capabilities]
359 }
360 Extension::VK_KHR_swapchain => extensions![Extension::VK_KHR_surface],
361 #[cfg(unix)]
362 Extension::VK_KHR_xcb_surface => extensions![Extension::VK_KHR_surface],
363 }
364 }
365 pub fn get_recursively_required_extensions(self) -> Extensions {
366 let mut retval = self.get_required_extensions();
367 let mut worklist: EnumMap<Extension, Extension> = enum_map!{_ => self};
368 let worklist = worklist.as_mut_slice();
369 let mut worklist_size = 1;
370 while worklist_size > 0 {
371 worklist_size -= 1;
372 let extension = worklist[worklist_size];
373 retval[extension] = true;
374 for (extension, &v) in extension.get_required_extensions().iter() {
375 if v && !retval[extension] {
376 worklist[worklist_size] = extension;
377 worklist_size += 1;
378 }
379 }
380 }
381 retval
382 }
383 pub fn get_name(self) -> &'static str {
384 macro_rules! name {
385 ($($(#[$attributes:meta])* $name:ident,)*) => {
386 match self {
387 $($(#[$attributes])* Extension::$name => stringify!($name),)*
388 }
389 }
390 }
391 name!(
392 VK_KHR_surface,
393 VK_KHR_bind_memory2,
394 VK_KHR_device_group,
395 VK_KHR_device_group_creation,
396 VK_KHR_descriptor_update_template,
397 VK_KHR_maintenance1,
398 VK_KHR_get_memory_requirements2,
399 VK_KHR_get_physical_device_properties2,
400 VK_KHR_sampler_ycbcr_conversion,
401 VK_KHR_maintenance2,
402 VK_KHR_maintenance3,
403 VK_KHR_external_memory_capabilities,
404 VK_KHR_external_fence_capabilities,
405 VK_KHR_external_semaphore_capabilities,
406 VK_KHR_16bit_storage,
407 VK_KHR_storage_buffer_storage_class,
408 VK_KHR_dedicated_allocation,
409 VK_KHR_external_fence,
410 VK_KHR_external_memory,
411 VK_KHR_external_semaphore,
412 VK_KHR_multiview,
413 VK_KHR_relaxed_block_layout,
414 VK_KHR_shader_draw_parameters,
415 VK_KHR_variable_pointers,
416 VK_KHR_swapchain,
417 #[cfg(unix)]
418 VK_KHR_xcb_surface,
419 )
420 }
421 pub fn get_spec_version(self) -> u32 {
422 match self {
423 Extension::VK_KHR_surface => api::VK_KHR_SURFACE_SPEC_VERSION,
424 Extension::VK_KHR_bind_memory2 => api::VK_KHR_BIND_MEMORY_2_SPEC_VERSION,
425 Extension::VK_KHR_device_group => api::VK_KHR_DEVICE_GROUP_SPEC_VERSION,
426 Extension::VK_KHR_device_group_creation => {
427 api::VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION
428 }
429 Extension::VK_KHR_descriptor_update_template => {
430 api::VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION
431 }
432 Extension::VK_KHR_maintenance1 => api::VK_KHR_MAINTENANCE1_SPEC_VERSION,
433 Extension::VK_KHR_get_memory_requirements2 => {
434 api::VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION
435 }
436 Extension::VK_KHR_get_physical_device_properties2 => {
437 api::VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION
438 }
439 Extension::VK_KHR_sampler_ycbcr_conversion => {
440 api::VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION
441 }
442 Extension::VK_KHR_maintenance2 => api::VK_KHR_MAINTENANCE2_SPEC_VERSION,
443 Extension::VK_KHR_maintenance3 => api::VK_KHR_MAINTENANCE3_SPEC_VERSION,
444 Extension::VK_KHR_external_memory_capabilities => {
445 api::VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION
446 }
447 Extension::VK_KHR_external_fence_capabilities => {
448 api::VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION
449 }
450 Extension::VK_KHR_external_semaphore_capabilities => {
451 api::VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION
452 }
453 Extension::VK_KHR_16bit_storage => api::VK_KHR_16BIT_STORAGE_SPEC_VERSION,
454 Extension::VK_KHR_storage_buffer_storage_class => {
455 api::VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION
456 }
457 Extension::VK_KHR_dedicated_allocation => api::VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION,
458 Extension::VK_KHR_external_fence => api::VK_KHR_EXTERNAL_FENCE_SPEC_VERSION,
459 Extension::VK_KHR_external_memory => api::VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION,
460 Extension::VK_KHR_external_semaphore => api::VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION,
461 Extension::VK_KHR_multiview => api::VK_KHR_MULTIVIEW_SPEC_VERSION,
462 Extension::VK_KHR_relaxed_block_layout => api::VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION,
463 Extension::VK_KHR_shader_draw_parameters => {
464 api::VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION
465 }
466 Extension::VK_KHR_variable_pointers => api::VK_KHR_VARIABLE_POINTERS_SPEC_VERSION,
467 Extension::VK_KHR_swapchain => api::VK_KHR_SWAPCHAIN_SPEC_VERSION,
468 #[cfg(unix)]
469 Extension::VK_KHR_xcb_surface => api::VK_KHR_XCB_SURFACE_SPEC_VERSION,
470 }
471 }
472 pub fn get_properties(self) -> api::VkExtensionProperties {
473 let mut retval = api::VkExtensionProperties {
474 extensionName: [0; api::VK_MAX_EXTENSION_NAME_SIZE as usize],
475 specVersion: self.get_spec_version(),
476 };
477 copy_str_to_char_array(&mut retval.extensionName, self.get_name());
478 retval
479 }
480 pub fn get_scope(self) -> ExtensionScope {
481 match self {
482 Extension::VK_KHR_surface
483 | Extension::VK_KHR_device_group_creation
484 | Extension::VK_KHR_get_physical_device_properties2
485 | Extension::VK_KHR_external_memory_capabilities
486 | Extension::VK_KHR_external_fence_capabilities
487 | Extension::VK_KHR_external_semaphore_capabilities => ExtensionScope::Instance,
488 Extension::VK_KHR_bind_memory2
489 | Extension::VK_KHR_device_group
490 | Extension::VK_KHR_descriptor_update_template
491 | Extension::VK_KHR_maintenance1
492 | Extension::VK_KHR_get_memory_requirements2
493 | Extension::VK_KHR_sampler_ycbcr_conversion
494 | Extension::VK_KHR_maintenance2
495 | Extension::VK_KHR_maintenance3
496 | Extension::VK_KHR_16bit_storage
497 | Extension::VK_KHR_storage_buffer_storage_class
498 | Extension::VK_KHR_dedicated_allocation
499 | Extension::VK_KHR_external_fence
500 | Extension::VK_KHR_external_memory
501 | Extension::VK_KHR_external_semaphore
502 | Extension::VK_KHR_multiview
503 | Extension::VK_KHR_relaxed_block_layout
504 | Extension::VK_KHR_shader_draw_parameters
505 | Extension::VK_KHR_variable_pointers
506 | Extension::VK_KHR_swapchain => ExtensionScope::Device,
507 #[cfg(unix)]
508 Extension::VK_KHR_xcb_surface => ExtensionScope::Instance,
509 }
510 }
511 }
512
513 impl FromStr for Extension {
514 type Err = ();
515 fn from_str(s: &str) -> Result<Self, Self::Err> {
516 for (i, _) in Extensions::default().iter() {
517 if s == i.get_name() {
518 return Ok(i);
519 }
520 }
521 Err(())
522 }
523 }
524
525 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
526 pub struct Extensions(EnumMap<Extension, bool>);
527
528 impl Extensions {
529 pub fn create_empty() -> Self {
530 Extensions(enum_map!{_ => false})
531 }
532 pub fn is_empty(&self) -> bool {
533 self.iter().all(|(_, &v)| !v)
534 }
535 pub fn is_full(&self) -> bool {
536 self.iter().all(|(_, &v)| v)
537 }
538 pub fn get_allowed_extensions_from_instance_scope(&self) -> Self {
539 let mut retval = Extensions::default();
540 let instance_extensions = Self::instance_extensions();
541 for (extension, value) in retval.iter_mut() {
542 if extension.get_scope() == ExtensionScope::Instance {
543 *value = self[extension];
544 continue;
545 }
546 let required_extensions =
547 instance_extensions & extension.get_recursively_required_extensions();
548 *value = (!*self & required_extensions).is_empty();
549 }
550 retval
551 }
552 pub fn instance_extensions() -> Self {
553 Extensions(
554 (|extension: Extension| extension.get_scope() == ExtensionScope::Instance).into(),
555 )
556 }
557 pub fn device_extensions() -> Self {
558 !Self::instance_extensions()
559 }
560 }
561
562 impl FromIterator<Extension> for Extensions {
563 fn from_iter<T: IntoIterator<Item = Extension>>(v: T) -> Extensions {
564 let mut retval = Extensions::create_empty();
565 for extension in v {
566 retval[extension] = true;
567 }
568 retval
569 }
570 }
571
572 impl Default for Extensions {
573 fn default() -> Self {
574 Self::create_empty()
575 }
576 }
577
578 impl Deref for Extensions {
579 type Target = EnumMap<Extension, bool>;
580 fn deref(&self) -> &Self::Target {
581 &self.0
582 }
583 }
584
585 impl DerefMut for Extensions {
586 fn deref_mut(&mut self) -> &mut Self::Target {
587 &mut self.0
588 }
589 }
590
591 impl BitAnd for Extensions {
592 type Output = Self;
593 fn bitand(self, rhs: Self) -> Self {
594 let mut retval = Self::default();
595 for (index, retval) in retval.iter_mut() {
596 *retval = self[index] & rhs[index];
597 }
598 retval
599 }
600 }
601
602 impl BitOr for Extensions {
603 type Output = Self;
604 fn bitor(self, rhs: Self) -> Self {
605 let mut retval = Self::default();
606 for (index, retval) in retval.iter_mut() {
607 *retval = self[index] | rhs[index];
608 }
609 retval
610 }
611 }
612
613 impl BitXor for Extensions {
614 type Output = Self;
615 fn bitxor(self, rhs: Self) -> Self {
616 let mut retval = Self::default();
617 for (index, retval) in retval.iter_mut() {
618 *retval = self[index] ^ rhs[index];
619 }
620 retval
621 }
622 }
623
624 impl Not for Extensions {
625 type Output = Self;
626 fn not(mut self) -> Self {
627 for v in self.values_mut() {
628 *v = !*v;
629 }
630 self
631 }
632 }
633
634 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
635 enum GetProcAddressScope {
636 Global,
637 Instance,
638 Device,
639 }
640
641 fn get_proc_address(
642 name: *const c_char,
643 scope: GetProcAddressScope,
644 extensions: &Extensions,
645 ) -> api::PFN_vkVoidFunction {
646 let mut name = unsafe { CStr::from_ptr(name) }.to_str().ok()?;
647 use api::*;
648 use std::mem::transmute;
649 struct Scope {
650 global: bool,
651 instance: bool,
652 device: bool,
653 }
654 let scope = Scope {
655 global: scope != GetProcAddressScope::Device,
656 instance: scope == GetProcAddressScope::Instance,
657 device: scope != GetProcAddressScope::Global,
658 };
659 macro_rules! proc_alias_khr {
660 ($base_name:ident, $required_extension:expr) => {
661 if name == concat!(stringify!($base_name), "KHR") {
662 if scope.instance && $required_extension {
663 name = stringify!($base_name);
664 } else {
665 return None;
666 }
667 }
668 };
669 }
670 proc_alias_khr!(
671 vkBindBufferMemory2,
672 extensions[Extension::VK_KHR_bind_memory2]
673 );
674 proc_alias_khr!(
675 vkBindImageMemory2,
676 extensions[Extension::VK_KHR_bind_memory2]
677 );
678 proc_alias_khr!(
679 vkCmdDispatchBase,
680 extensions[Extension::VK_KHR_device_group]
681 );
682 proc_alias_khr!(
683 vkCmdSetDeviceMask,
684 extensions[Extension::VK_KHR_device_group]
685 );
686 proc_alias_khr!(
687 vkCreateDescriptorUpdateTemplate,
688 extensions[Extension::VK_KHR_descriptor_update_template]
689 );
690 proc_alias_khr!(
691 vkCreateSamplerYcbcrConversion,
692 extensions[Extension::VK_KHR_sampler_ycbcr_conversion]
693 );
694 proc_alias_khr!(
695 vkDestroyDescriptorUpdateTemplate,
696 extensions[Extension::VK_KHR_descriptor_update_template]
697 );
698 proc_alias_khr!(
699 vkDestroySamplerYcbcrConversion,
700 extensions[Extension::VK_KHR_sampler_ycbcr_conversion]
701 );
702 proc_alias_khr!(
703 vkEnumeratePhysicalDeviceGroups,
704 extensions[Extension::VK_KHR_device_group_creation]
705 );
706 proc_alias_khr!(
707 vkGetBufferMemoryRequirements2,
708 extensions[Extension::VK_KHR_get_memory_requirements2]
709 );
710 proc_alias_khr!(
711 vkGetDescriptorSetLayoutSupport,
712 extensions[Extension::VK_KHR_maintenance3]
713 );
714 proc_alias_khr!(
715 vkGetDeviceGroupPeerMemoryFeatures,
716 extensions[Extension::VK_KHR_device_group]
717 );
718 proc_alias_khr!(
719 vkGetImageMemoryRequirements2,
720 extensions[Extension::VK_KHR_get_memory_requirements2]
721 );
722 proc_alias_khr!(
723 vkGetImageSparseMemoryRequirements2,
724 extensions[Extension::VK_KHR_get_memory_requirements2]
725 );
726 proc_alias_khr!(
727 vkGetPhysicalDeviceExternalBufferProperties,
728 extensions[Extension::VK_KHR_external_memory_capabilities]
729 );
730 proc_alias_khr!(
731 vkGetPhysicalDeviceExternalFenceProperties,
732 extensions[Extension::VK_KHR_external_fence_capabilities]
733 );
734 proc_alias_khr!(
735 vkGetPhysicalDeviceExternalSemaphoreProperties,
736 extensions[Extension::VK_KHR_external_semaphore_capabilities]
737 );
738 proc_alias_khr!(
739 vkGetPhysicalDeviceFeatures2,
740 extensions[Extension::VK_KHR_get_physical_device_properties2]
741 );
742 proc_alias_khr!(
743 vkGetPhysicalDeviceFormatProperties2,
744 extensions[Extension::VK_KHR_get_physical_device_properties2]
745 );
746 proc_alias_khr!(
747 vkGetPhysicalDeviceImageFormatProperties2,
748 extensions[Extension::VK_KHR_get_physical_device_properties2]
749 );
750 proc_alias_khr!(
751 vkGetPhysicalDeviceMemoryProperties2,
752 extensions[Extension::VK_KHR_get_physical_device_properties2]
753 );
754 proc_alias_khr!(
755 vkGetPhysicalDeviceProperties2,
756 extensions[Extension::VK_KHR_get_physical_device_properties2]
757 );
758 proc_alias_khr!(
759 vkGetPhysicalDeviceQueueFamilyProperties2,
760 extensions[Extension::VK_KHR_get_physical_device_properties2]
761 );
762 proc_alias_khr!(
763 vkGetPhysicalDeviceSparseImageFormatProperties2,
764 extensions[Extension::VK_KHR_get_physical_device_properties2]
765 );
766 proc_alias_khr!(
767 vkTrimCommandPool,
768 extensions[Extension::VK_KHR_maintenance1]
769 );
770 proc_alias_khr!(
771 vkUpdateDescriptorSetWithTemplate,
772 extensions[Extension::VK_KHR_descriptor_update_template]
773 );
774 macro_rules! proc_address {
775 ($name:ident, $pfn_name:ident, $required_scope:ident, $required_extension:expr) => {
776 if stringify!($name) == name {
777 if scope.$required_scope && $required_extension {
778 let f: $pfn_name = Some($name);
779 return unsafe { transmute(f) };
780 } else {
781 return None;
782 }
783 }
784 };
785 }
786 #[cfg_attr(rustfmt, rustfmt_skip)]
787 {
788 proc_address!(vkCreateInstance, PFN_vkCreateInstance, global, true);
789 proc_address!(vkEnumerateInstanceExtensionProperties, PFN_vkEnumerateInstanceExtensionProperties, global, true);
790 proc_address!(vkEnumerateInstanceLayerProperties, PFN_vkEnumerateInstanceLayerProperties, global, true);
791 proc_address!(vkEnumerateInstanceVersion, PFN_vkEnumerateInstanceVersion, global, true);
792
793 proc_address!(vkAllocateCommandBuffers, PFN_vkAllocateCommandBuffers, device, true);
794 proc_address!(vkAllocateDescriptorSets, PFN_vkAllocateDescriptorSets, device, true);
795 proc_address!(vkAllocateMemory, PFN_vkAllocateMemory, device, true);
796 proc_address!(vkBeginCommandBuffer, PFN_vkBeginCommandBuffer, device, true);
797 proc_address!(vkBindBufferMemory, PFN_vkBindBufferMemory, device, true);
798 proc_address!(vkBindBufferMemory2, PFN_vkBindBufferMemory2, device, true);
799 proc_address!(vkBindImageMemory, PFN_vkBindImageMemory, device, true);
800 proc_address!(vkBindImageMemory2, PFN_vkBindImageMemory2, device, true);
801 proc_address!(vkCmdBeginQuery, PFN_vkCmdBeginQuery, device, true);
802 proc_address!(vkCmdBeginRenderPass, PFN_vkCmdBeginRenderPass, device, true);
803 proc_address!(vkCmdBindDescriptorSets, PFN_vkCmdBindDescriptorSets, device, true);
804 proc_address!(vkCmdBindIndexBuffer, PFN_vkCmdBindIndexBuffer, device, true);
805 proc_address!(vkCmdBindPipeline, PFN_vkCmdBindPipeline, device, true);
806 proc_address!(vkCmdBindVertexBuffers, PFN_vkCmdBindVertexBuffers, device, true);
807 proc_address!(vkCmdBlitImage, PFN_vkCmdBlitImage, device, true);
808 proc_address!(vkCmdClearAttachments, PFN_vkCmdClearAttachments, device, true);
809 proc_address!(vkCmdClearColorImage, PFN_vkCmdClearColorImage, device, true);
810 proc_address!(vkCmdClearDepthStencilImage, PFN_vkCmdClearDepthStencilImage, device, true);
811 proc_address!(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer, device, true);
812 proc_address!(vkCmdCopyBufferToImage, PFN_vkCmdCopyBufferToImage, device, true);
813 proc_address!(vkCmdCopyImage, PFN_vkCmdCopyImage, device, true);
814 proc_address!(vkCmdCopyImageToBuffer, PFN_vkCmdCopyImageToBuffer, device, true);
815 proc_address!(vkCmdCopyQueryPoolResults, PFN_vkCmdCopyQueryPoolResults, device, true);
816 proc_address!(vkCmdDispatch, PFN_vkCmdDispatch, device, true);
817 proc_address!(vkCmdDispatchBase, PFN_vkCmdDispatchBase, device, true);
818 proc_address!(vkCmdDispatchIndirect, PFN_vkCmdDispatchIndirect, device, true);
819 proc_address!(vkCmdDraw, PFN_vkCmdDraw, device, true);
820 proc_address!(vkCmdDrawIndexed, PFN_vkCmdDrawIndexed, device, true);
821 proc_address!(vkCmdDrawIndexedIndirect, PFN_vkCmdDrawIndexedIndirect, device, true);
822 proc_address!(vkCmdDrawIndirect, PFN_vkCmdDrawIndirect, device, true);
823 proc_address!(vkCmdEndQuery, PFN_vkCmdEndQuery, device, true);
824 proc_address!(vkCmdEndRenderPass, PFN_vkCmdEndRenderPass, device, true);
825 proc_address!(vkCmdExecuteCommands, PFN_vkCmdExecuteCommands, device, true);
826 proc_address!(vkCmdFillBuffer, PFN_vkCmdFillBuffer, device, true);
827 proc_address!(vkCmdNextSubpass, PFN_vkCmdNextSubpass, device, true);
828 proc_address!(vkCmdPipelineBarrier, PFN_vkCmdPipelineBarrier, device, true);
829 proc_address!(vkCmdPushConstants, PFN_vkCmdPushConstants, device, true);
830 proc_address!(vkCmdResetEvent, PFN_vkCmdResetEvent, device, true);
831 proc_address!(vkCmdResetQueryPool, PFN_vkCmdResetQueryPool, device, true);
832 proc_address!(vkCmdResolveImage, PFN_vkCmdResolveImage, device, true);
833 proc_address!(vkCmdSetBlendConstants, PFN_vkCmdSetBlendConstants, device, true);
834 proc_address!(vkCmdSetDepthBias, PFN_vkCmdSetDepthBias, device, true);
835 proc_address!(vkCmdSetDepthBounds, PFN_vkCmdSetDepthBounds, device, true);
836 proc_address!(vkCmdSetDeviceMask, PFN_vkCmdSetDeviceMask, device, true);
837 proc_address!(vkCmdSetEvent, PFN_vkCmdSetEvent, device, true);
838 proc_address!(vkCmdSetLineWidth, PFN_vkCmdSetLineWidth, device, true);
839 proc_address!(vkCmdSetScissor, PFN_vkCmdSetScissor, device, true);
840 proc_address!(vkCmdSetStencilCompareMask, PFN_vkCmdSetStencilCompareMask, device, true);
841 proc_address!(vkCmdSetStencilReference, PFN_vkCmdSetStencilReference, device, true);
842 proc_address!(vkCmdSetStencilWriteMask, PFN_vkCmdSetStencilWriteMask, device, true);
843 proc_address!(vkCmdSetViewport, PFN_vkCmdSetViewport, device, true);
844 proc_address!(vkCmdUpdateBuffer, PFN_vkCmdUpdateBuffer, device, true);
845 proc_address!(vkCmdWaitEvents, PFN_vkCmdWaitEvents, device, true);
846 proc_address!(vkCmdWriteTimestamp, PFN_vkCmdWriteTimestamp, device, true);
847 proc_address!(vkCreateBuffer, PFN_vkCreateBuffer, device, true);
848 proc_address!(vkCreateBufferView, PFN_vkCreateBufferView, device, true);
849 proc_address!(vkCreateCommandPool, PFN_vkCreateCommandPool, device, true);
850 proc_address!(vkCreateComputePipelines, PFN_vkCreateComputePipelines, device, true);
851 proc_address!(vkCreateDescriptorPool, PFN_vkCreateDescriptorPool, device, true);
852 proc_address!(vkCreateDescriptorSetLayout, PFN_vkCreateDescriptorSetLayout, device, true);
853 proc_address!(vkCreateDescriptorUpdateTemplate, PFN_vkCreateDescriptorUpdateTemplate, device, true);
854 proc_address!(vkCreateDevice, PFN_vkCreateDevice, instance, true);
855 proc_address!(vkCreateEvent, PFN_vkCreateEvent, device, true);
856 proc_address!(vkCreateFence, PFN_vkCreateFence, device, true);
857 proc_address!(vkCreateFramebuffer, PFN_vkCreateFramebuffer, device, true);
858 proc_address!(vkCreateGraphicsPipelines, PFN_vkCreateGraphicsPipelines, device, true);
859 proc_address!(vkCreateImage, PFN_vkCreateImage, device, true);
860 proc_address!(vkCreateImageView, PFN_vkCreateImageView, device, true);
861 proc_address!(vkCreatePipelineCache, PFN_vkCreatePipelineCache, device, true);
862 proc_address!(vkCreatePipelineLayout, PFN_vkCreatePipelineLayout, device, true);
863 proc_address!(vkCreateQueryPool, PFN_vkCreateQueryPool, device, true);
864 proc_address!(vkCreateRenderPass, PFN_vkCreateRenderPass, device, true);
865 proc_address!(vkCreateSampler, PFN_vkCreateSampler, device, true);
866 proc_address!(vkCreateSamplerYcbcrConversion, PFN_vkCreateSamplerYcbcrConversion, device, true);
867 proc_address!(vkCreateSemaphore, PFN_vkCreateSemaphore, device, true);
868 proc_address!(vkCreateShaderModule, PFN_vkCreateShaderModule, device, true);
869 proc_address!(vkDestroyBuffer, PFN_vkDestroyBuffer, device, true);
870 proc_address!(vkDestroyBufferView, PFN_vkDestroyBufferView, device, true);
871 proc_address!(vkDestroyCommandPool, PFN_vkDestroyCommandPool, device, true);
872 proc_address!(vkDestroyDescriptorPool, PFN_vkDestroyDescriptorPool, device, true);
873 proc_address!(vkDestroyDescriptorSetLayout, PFN_vkDestroyDescriptorSetLayout, device, true);
874 proc_address!(vkDestroyDescriptorUpdateTemplate, PFN_vkDestroyDescriptorUpdateTemplate, device, true);
875 proc_address!(vkDestroyDevice, PFN_vkDestroyDevice, device, true);
876 proc_address!(vkDestroyEvent, PFN_vkDestroyEvent, device, true);
877 proc_address!(vkDestroyFence, PFN_vkDestroyFence, device, true);
878 proc_address!(vkDestroyFramebuffer, PFN_vkDestroyFramebuffer, device, true);
879 proc_address!(vkDestroyImage, PFN_vkDestroyImage, device, true);
880 proc_address!(vkDestroyImageView, PFN_vkDestroyImageView, device, true);
881 proc_address!(vkDestroyInstance, PFN_vkDestroyInstance, instance, true);
882 proc_address!(vkDestroyPipeline, PFN_vkDestroyPipeline, device, true);
883 proc_address!(vkDestroyPipelineCache, PFN_vkDestroyPipelineCache, device, true);
884 proc_address!(vkDestroyPipelineLayout, PFN_vkDestroyPipelineLayout, device, true);
885 proc_address!(vkDestroyQueryPool, PFN_vkDestroyQueryPool, device, true);
886 proc_address!(vkDestroyRenderPass, PFN_vkDestroyRenderPass, device, true);
887 proc_address!(vkDestroySampler, PFN_vkDestroySampler, device, true);
888 proc_address!(vkDestroySamplerYcbcrConversion, PFN_vkDestroySamplerYcbcrConversion, device, true);
889 proc_address!(vkDestroySemaphore, PFN_vkDestroySemaphore, device, true);
890 proc_address!(vkDestroyShaderModule, PFN_vkDestroyShaderModule, device, true);
891 proc_address!(vkDeviceWaitIdle, PFN_vkDeviceWaitIdle, device, true);
892 proc_address!(vkEndCommandBuffer, PFN_vkEndCommandBuffer, device, true);
893 proc_address!(vkEnumerateDeviceExtensionProperties, PFN_vkEnumerateDeviceExtensionProperties, instance, true);
894 proc_address!(vkEnumerateDeviceLayerProperties, PFN_vkEnumerateDeviceLayerProperties, instance, true);
895 proc_address!(vkEnumeratePhysicalDeviceGroups, PFN_vkEnumeratePhysicalDeviceGroups, instance, true);
896 proc_address!(vkEnumeratePhysicalDevices, PFN_vkEnumeratePhysicalDevices, instance, true);
897 proc_address!(vkFlushMappedMemoryRanges, PFN_vkFlushMappedMemoryRanges, device, true);
898 proc_address!(vkFreeCommandBuffers, PFN_vkFreeCommandBuffers, device, true);
899 proc_address!(vkFreeDescriptorSets, PFN_vkFreeDescriptorSets, device, true);
900 proc_address!(vkFreeMemory, PFN_vkFreeMemory, device, true);
901 proc_address!(vkGetBufferMemoryRequirements, PFN_vkGetBufferMemoryRequirements, device, true);
902 proc_address!(vkGetBufferMemoryRequirements2, PFN_vkGetBufferMemoryRequirements2, device, true);
903 proc_address!(vkGetDescriptorSetLayoutSupport, PFN_vkGetDescriptorSetLayoutSupport, device, true);
904 proc_address!(vkGetDeviceGroupPeerMemoryFeatures, PFN_vkGetDeviceGroupPeerMemoryFeatures, device, true);
905 proc_address!(vkGetDeviceMemoryCommitment, PFN_vkGetDeviceMemoryCommitment, device, true);
906 proc_address!(vkGetDeviceProcAddr, PFN_vkGetDeviceProcAddr, device, true);
907 proc_address!(vkGetDeviceQueue, PFN_vkGetDeviceQueue, device, true);
908 proc_address!(vkGetDeviceQueue2, PFN_vkGetDeviceQueue2, device, true);
909 proc_address!(vkGetEventStatus, PFN_vkGetEventStatus, device, true);
910 proc_address!(vkGetFenceStatus, PFN_vkGetFenceStatus, device, true);
911 proc_address!(vkGetImageMemoryRequirements, PFN_vkGetImageMemoryRequirements, device, true);
912 proc_address!(vkGetImageMemoryRequirements2, PFN_vkGetImageMemoryRequirements2, device, true);
913 proc_address!(vkGetImageSparseMemoryRequirements, PFN_vkGetImageSparseMemoryRequirements, device, true);
914 proc_address!(vkGetImageSparseMemoryRequirements2, PFN_vkGetImageSparseMemoryRequirements2, device, true);
915 proc_address!(vkGetImageSubresourceLayout, PFN_vkGetImageSubresourceLayout, device, true);
916 proc_address!(vkGetInstanceProcAddr, PFN_vkGetInstanceProcAddr, device, true);
917 proc_address!(vkGetPhysicalDeviceExternalBufferProperties, PFN_vkGetPhysicalDeviceExternalBufferProperties, instance, true);
918 proc_address!(vkGetPhysicalDeviceExternalFenceProperties, PFN_vkGetPhysicalDeviceExternalFenceProperties, instance, true);
919 proc_address!(vkGetPhysicalDeviceExternalSemaphoreProperties, PFN_vkGetPhysicalDeviceExternalSemaphoreProperties, instance, true);
920 proc_address!(vkGetPhysicalDeviceFeatures, PFN_vkGetPhysicalDeviceFeatures, instance, true);
921 proc_address!(vkGetPhysicalDeviceFeatures2, PFN_vkGetPhysicalDeviceFeatures2, instance, true);
922 proc_address!(vkGetPhysicalDeviceFormatProperties, PFN_vkGetPhysicalDeviceFormatProperties, instance, true);
923 proc_address!(vkGetPhysicalDeviceFormatProperties2, PFN_vkGetPhysicalDeviceFormatProperties2, instance, true);
924 proc_address!(vkGetPhysicalDeviceImageFormatProperties, PFN_vkGetPhysicalDeviceImageFormatProperties, instance, true);
925 proc_address!(vkGetPhysicalDeviceImageFormatProperties2, PFN_vkGetPhysicalDeviceImageFormatProperties2, instance, true);
926 proc_address!(vkGetPhysicalDeviceMemoryProperties, PFN_vkGetPhysicalDeviceMemoryProperties, instance, true);
927 proc_address!(vkGetPhysicalDeviceMemoryProperties2, PFN_vkGetPhysicalDeviceMemoryProperties2, instance, true);
928 proc_address!(vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties, instance, true);
929 proc_address!(vkGetPhysicalDeviceProperties2, PFN_vkGetPhysicalDeviceProperties2, instance, true);
930 proc_address!(vkGetPhysicalDeviceQueueFamilyProperties, PFN_vkGetPhysicalDeviceQueueFamilyProperties, instance, true);
931 proc_address!(vkGetPhysicalDeviceQueueFamilyProperties2, PFN_vkGetPhysicalDeviceQueueFamilyProperties2, instance, true);
932 proc_address!(vkGetPhysicalDeviceSparseImageFormatProperties, PFN_vkGetPhysicalDeviceSparseImageFormatProperties, instance, true);
933 proc_address!(vkGetPhysicalDeviceSparseImageFormatProperties2, PFN_vkGetPhysicalDeviceSparseImageFormatProperties2, instance, true);
934 proc_address!(vkGetPipelineCacheData, PFN_vkGetPipelineCacheData, device, true);
935 proc_address!(vkGetQueryPoolResults, PFN_vkGetQueryPoolResults, device, true);
936 proc_address!(vkGetRenderAreaGranularity, PFN_vkGetRenderAreaGranularity, device, true);
937 proc_address!(vkInvalidateMappedMemoryRanges, PFN_vkInvalidateMappedMemoryRanges, device, true);
938 proc_address!(vkMapMemory, PFN_vkMapMemory, device, true);
939 proc_address!(vkMergePipelineCaches, PFN_vkMergePipelineCaches, device, true);
940 proc_address!(vkQueueBindSparse, PFN_vkQueueBindSparse, device, true);
941 proc_address!(vkQueueSubmit, PFN_vkQueueSubmit, device, true);
942 proc_address!(vkQueueWaitIdle, PFN_vkQueueWaitIdle, device, true);
943 proc_address!(vkResetCommandBuffer, PFN_vkResetCommandBuffer, device, true);
944 proc_address!(vkResetCommandPool, PFN_vkResetCommandPool, device, true);
945 proc_address!(vkResetDescriptorPool, PFN_vkResetDescriptorPool, device, true);
946 proc_address!(vkResetEvent, PFN_vkResetEvent, device, true);
947 proc_address!(vkResetFences, PFN_vkResetFences, device, true);
948 proc_address!(vkSetEvent, PFN_vkSetEvent, device, true);
949 proc_address!(vkTrimCommandPool, PFN_vkTrimCommandPool, device, true);
950 proc_address!(vkUnmapMemory, PFN_vkUnmapMemory, device, true);
951 proc_address!(vkUpdateDescriptorSets, PFN_vkUpdateDescriptorSets, device, true);
952 proc_address!(vkUpdateDescriptorSetWithTemplate, PFN_vkUpdateDescriptorSetWithTemplate, device, true);
953 proc_address!(vkWaitForFences, PFN_vkWaitForFences, device, true);
954
955 proc_address!(vkDestroySurfaceKHR, PFN_vkDestroySurfaceKHR, device, extensions[Extension::VK_KHR_surface]);
956 proc_address!(vkGetPhysicalDeviceSurfaceSupportKHR, PFN_vkGetPhysicalDeviceSurfaceSupportKHR, device, extensions[Extension::VK_KHR_surface]);
957 proc_address!(vkGetPhysicalDeviceSurfaceCapabilitiesKHR, PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, device, extensions[Extension::VK_KHR_surface]);
958 proc_address!(vkGetPhysicalDeviceSurfaceFormatsKHR, PFN_vkGetPhysicalDeviceSurfaceFormatsKHR, device, extensions[Extension::VK_KHR_surface]);
959 proc_address!(vkGetPhysicalDeviceSurfacePresentModesKHR, PFN_vkGetPhysicalDeviceSurfacePresentModesKHR, device, extensions[Extension::VK_KHR_surface]);
960
961 proc_address!(vkCreateSwapchainKHR, PFN_vkCreateSwapchainKHR, device, extensions[Extension::VK_KHR_swapchain]);
962 proc_address!(vkDestroySwapchainKHR, PFN_vkDestroySwapchainKHR, device, extensions[Extension::VK_KHR_swapchain]);
963 proc_address!(vkGetSwapchainImagesKHR, PFN_vkGetSwapchainImagesKHR, device, extensions[Extension::VK_KHR_swapchain]);
964 proc_address!(vkAcquireNextImageKHR, PFN_vkAcquireNextImageKHR, device, extensions[Extension::VK_KHR_swapchain]);
965 proc_address!(vkQueuePresentKHR, PFN_vkQueuePresentKHR, device, extensions[Extension::VK_KHR_swapchain]);
966 proc_address!(vkGetDeviceGroupPresentCapabilitiesKHR, PFN_vkGetDeviceGroupPresentCapabilitiesKHR, device, extensions[Extension::VK_KHR_swapchain]);
967 proc_address!(vkGetDeviceGroupSurfacePresentModesKHR, PFN_vkGetDeviceGroupSurfacePresentModesKHR, device, extensions[Extension::VK_KHR_swapchain]);
968 proc_address!(vkGetPhysicalDevicePresentRectanglesKHR, PFN_vkGetPhysicalDevicePresentRectanglesKHR, device, extensions[Extension::VK_KHR_swapchain]);
969 proc_address!(vkAcquireNextImage2KHR, PFN_vkAcquireNextImage2KHR, device, extensions[Extension::VK_KHR_swapchain]);
970
971 #[cfg(unix)]
972 proc_address!(vkCreateXcbSurfaceKHR, PFN_vkCreateXcbSurfaceKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
973 #[cfg(unix)]
974 proc_address!(vkGetPhysicalDeviceXcbPresentationSupportKHR, PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR, device, extensions[Extension::VK_KHR_xcb_surface]);
975 /*
976 proc_address!(vkCmdBeginConditionalRenderingEXT, PFN_vkCmdBeginConditionalRenderingEXT, device, unknown);
977 proc_address!(vkCmdBeginDebugUtilsLabelEXT, PFN_vkCmdBeginDebugUtilsLabelEXT, device, unknown);
978 proc_address!(vkCmdBeginRenderPass2KHR, PFN_vkCmdBeginRenderPass2KHR, device, unknown);
979 proc_address!(vkCmdBindShadingRateImageNV, PFN_vkCmdBindShadingRateImageNV, device, unknown);
980 proc_address!(vkCmdDebugMarkerBeginEXT, PFN_vkCmdDebugMarkerBeginEXT, device, unknown);
981 proc_address!(vkCmdDebugMarkerEndEXT, PFN_vkCmdDebugMarkerEndEXT, device, unknown);
982 proc_address!(vkCmdDebugMarkerInsertEXT, PFN_vkCmdDebugMarkerInsertEXT, device, unknown);
983 proc_address!(vkCmdDrawIndexedIndirectCountAMD, PFN_vkCmdDrawIndexedIndirectCountAMD, device, unknown);
984 proc_address!(vkCmdDrawIndexedIndirectCountKHR, PFN_vkCmdDrawIndexedIndirectCountKHR, device, unknown);
985 proc_address!(vkCmdDrawIndirectCountAMD, PFN_vkCmdDrawIndirectCountAMD, device, unknown);
986 proc_address!(vkCmdDrawIndirectCountKHR, PFN_vkCmdDrawIndirectCountKHR, device, unknown);
987 proc_address!(vkCmdDrawMeshTasksIndirectCountNV, PFN_vkCmdDrawMeshTasksIndirectCountNV, device, unknown);
988 proc_address!(vkCmdDrawMeshTasksIndirectNV, PFN_vkCmdDrawMeshTasksIndirectNV, device, unknown);
989 proc_address!(vkCmdDrawMeshTasksNV, PFN_vkCmdDrawMeshTasksNV, device, unknown);
990 proc_address!(vkCmdEndConditionalRenderingEXT, PFN_vkCmdEndConditionalRenderingEXT, device, unknown);
991 proc_address!(vkCmdEndDebugUtilsLabelEXT, PFN_vkCmdEndDebugUtilsLabelEXT, device, unknown);
992 proc_address!(vkCmdEndRenderPass2KHR, PFN_vkCmdEndRenderPass2KHR, device, unknown);
993 proc_address!(vkCmdInsertDebugUtilsLabelEXT, PFN_vkCmdInsertDebugUtilsLabelEXT, device, unknown);
994 proc_address!(vkCmdNextSubpass2KHR, PFN_vkCmdNextSubpass2KHR, device, unknown);
995 proc_address!(vkCmdPushDescriptorSetKHR, PFN_vkCmdPushDescriptorSetKHR, device, unknown);
996 proc_address!(vkCmdPushDescriptorSetWithTemplateKHR, PFN_vkCmdPushDescriptorSetWithTemplateKHR, device, unknown);
997 proc_address!(vkCmdSetCheckpointNV, PFN_vkCmdSetCheckpointNV, device, unknown);
998 proc_address!(vkCmdSetCoarseSampleOrderNV, PFN_vkCmdSetCoarseSampleOrderNV, device, unknown);
999 proc_address!(vkCmdSetDiscardRectangleEXT, PFN_vkCmdSetDiscardRectangleEXT, device, unknown);
1000 proc_address!(vkCmdSetExclusiveScissorNV, PFN_vkCmdSetExclusiveScissorNV, device, unknown);
1001 proc_address!(vkCmdSetSampleLocationsEXT, PFN_vkCmdSetSampleLocationsEXT, device, unknown);
1002 proc_address!(vkCmdSetViewportShadingRatePaletteNV, PFN_vkCmdSetViewportShadingRatePaletteNV, device, unknown);
1003 proc_address!(vkCmdSetViewportWScalingNV, PFN_vkCmdSetViewportWScalingNV, device, unknown);
1004 proc_address!(vkCmdWriteBufferMarkerAMD, PFN_vkCmdWriteBufferMarkerAMD, device, unknown);
1005 proc_address!(vkCreateDebugReportCallbackEXT, PFN_vkCreateDebugReportCallbackEXT, device, unknown);
1006 proc_address!(vkCreateDebugUtilsMessengerEXT, PFN_vkCreateDebugUtilsMessengerEXT, device, unknown);
1007 proc_address!(vkCreateDisplayModeKHR, PFN_vkCreateDisplayModeKHR, device, unknown);
1008 proc_address!(vkCreateDisplayPlaneSurfaceKHR, PFN_vkCreateDisplayPlaneSurfaceKHR, device, unknown);
1009 proc_address!(vkCreateRenderPass2KHR, PFN_vkCreateRenderPass2KHR, device, unknown);
1010 proc_address!(vkCreateSharedSwapchainsKHR, PFN_vkCreateSharedSwapchainsKHR, device, unknown);
1011 proc_address!(vkCreateValidationCacheEXT, PFN_vkCreateValidationCacheEXT, device, unknown);
1012 proc_address!(vkDebugMarkerSetObjectNameEXT, PFN_vkDebugMarkerSetObjectNameEXT, device, unknown);
1013 proc_address!(vkDebugMarkerSetObjectTagEXT, PFN_vkDebugMarkerSetObjectTagEXT, device, unknown);
1014 proc_address!(vkDebugReportCallbackEXT, PFN_vkDebugReportCallbackEXT, device, unknown);
1015 proc_address!(vkDebugReportMessageEXT, PFN_vkDebugReportMessageEXT, device, unknown);
1016 proc_address!(vkDebugUtilsMessengerCallbackEXT, PFN_vkDebugUtilsMessengerCallbackEXT, device, unknown);
1017 proc_address!(vkDestroyDebugReportCallbackEXT, PFN_vkDestroyDebugReportCallbackEXT, device, unknown);
1018 proc_address!(vkDestroyDebugUtilsMessengerEXT, PFN_vkDestroyDebugUtilsMessengerEXT, device, unknown);
1019 proc_address!(vkDestroyValidationCacheEXT, PFN_vkDestroyValidationCacheEXT, device, unknown);
1020 proc_address!(vkDisplayPowerControlEXT, PFN_vkDisplayPowerControlEXT, device, unknown);
1021 proc_address!(vkGetDisplayModeProperties2KHR, PFN_vkGetDisplayModeProperties2KHR, device, unknown);
1022 proc_address!(vkGetDisplayModePropertiesKHR, PFN_vkGetDisplayModePropertiesKHR, device, unknown);
1023 proc_address!(vkGetDisplayPlaneCapabilities2KHR, PFN_vkGetDisplayPlaneCapabilities2KHR, device, unknown);
1024 proc_address!(vkGetDisplayPlaneCapabilitiesKHR, PFN_vkGetDisplayPlaneCapabilitiesKHR, device, unknown);
1025 proc_address!(vkGetDisplayPlaneSupportedDisplaysKHR, PFN_vkGetDisplayPlaneSupportedDisplaysKHR, device, unknown);
1026 proc_address!(vkGetFenceFdKHR, PFN_vkGetFenceFdKHR, device, unknown);
1027 proc_address!(vkGetMemoryFdKHR, PFN_vkGetMemoryFdKHR, device, unknown);
1028 proc_address!(vkGetMemoryFdPropertiesKHR, PFN_vkGetMemoryFdPropertiesKHR, device, unknown);
1029 proc_address!(vkGetMemoryHostPointerPropertiesEXT, PFN_vkGetMemoryHostPointerPropertiesEXT, device, unknown);
1030 proc_address!(vkGetPastPresentationTimingGOOGLE, PFN_vkGetPastPresentationTimingGOOGLE, device, unknown);
1031 proc_address!(vkGetPhysicalDeviceDisplayPlaneProperties2KHR, PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, device, unknown);
1032 proc_address!(vkGetPhysicalDeviceDisplayPlanePropertiesKHR, PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, device, unknown);
1033 proc_address!(vkGetPhysicalDeviceDisplayProperties2KHR, PFN_vkGetPhysicalDeviceDisplayProperties2KHR, device, unknown);
1034 proc_address!(vkGetPhysicalDeviceDisplayPropertiesKHR, PFN_vkGetPhysicalDeviceDisplayPropertiesKHR, device, unknown);
1035 proc_address!(vkGetPhysicalDeviceExternalImageFormatPropertiesNV, PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, device, unknown);
1036 proc_address!(vkGetPhysicalDeviceMultisamplePropertiesEXT, PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT, device, unknown);
1037 proc_address!(vkGetPhysicalDeviceSurfaceCapabilities2EXT, PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT, device, unknown);
1038 proc_address!(vkGetPhysicalDeviceSurfaceCapabilities2KHR, PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR, device, unknown);
1039 proc_address!(vkGetPhysicalDeviceSurfaceFormats2KHR, PFN_vkGetPhysicalDeviceSurfaceFormats2KHR, device, unknown);
1040 proc_address!(vkGetQueueCheckpointDataNV, PFN_vkGetQueueCheckpointDataNV, device, unknown);
1041 proc_address!(vkGetRefreshCycleDurationGOOGLE, PFN_vkGetRefreshCycleDurationGOOGLE, device, unknown);
1042 proc_address!(vkGetSemaphoreFdKHR, PFN_vkGetSemaphoreFdKHR, device, unknown);
1043 proc_address!(vkGetShaderInfoAMD, PFN_vkGetShaderInfoAMD, device, unknown);
1044 proc_address!(vkGetSwapchainCounterEXT, PFN_vkGetSwapchainCounterEXT, device, unknown);
1045 proc_address!(vkGetSwapchainStatusKHR, PFN_vkGetSwapchainStatusKHR, device, unknown);
1046 proc_address!(vkGetValidationCacheDataEXT, PFN_vkGetValidationCacheDataEXT, device, unknown);
1047 proc_address!(vkImportFenceFdKHR, PFN_vkImportFenceFdKHR, device, unknown);
1048 proc_address!(vkImportSemaphoreFdKHR, PFN_vkImportSemaphoreFdKHR, device, unknown);
1049 proc_address!(vkMergeValidationCachesEXT, PFN_vkMergeValidationCachesEXT, device, unknown);
1050 proc_address!(vkQueueBeginDebugUtilsLabelEXT, PFN_vkQueueBeginDebugUtilsLabelEXT, device, unknown);
1051 proc_address!(vkQueueEndDebugUtilsLabelEXT, PFN_vkQueueEndDebugUtilsLabelEXT, device, unknown);
1052 proc_address!(vkQueueInsertDebugUtilsLabelEXT, PFN_vkQueueInsertDebugUtilsLabelEXT, device, unknown);
1053 proc_address!(vkRegisterDeviceEventEXT, PFN_vkRegisterDeviceEventEXT, device, unknown);
1054 proc_address!(vkRegisterDisplayEventEXT, PFN_vkRegisterDisplayEventEXT, device, unknown);
1055 proc_address!(vkReleaseDisplayEXT, PFN_vkReleaseDisplayEXT, device, unknown);
1056 proc_address!(vkSetDebugUtilsObjectNameEXT, PFN_vkSetDebugUtilsObjectNameEXT, device, unknown);
1057 proc_address!(vkSetDebugUtilsObjectTagEXT, PFN_vkSetDebugUtilsObjectTagEXT, device, unknown);
1058 proc_address!(vkSetHdrMetadataEXT, PFN_vkSetHdrMetadataEXT, device, unknown);
1059 proc_address!(vkSubmitDebugUtilsMessageEXT, PFN_vkSubmitDebugUtilsMessageEXT, device, unknown);
1060 */
1061 }
1062 //eprintln!("unknown function: {:?}", name);
1063 None
1064 }
1065
1066 #[derive(Debug, Copy, Clone)]
1067 pub struct Features {
1068 features: api::VkPhysicalDeviceFeatures,
1069 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures,
1070 sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures,
1071 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures,
1072 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures,
1073 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures,
1074 multiview_features: api::VkPhysicalDeviceMultiviewFeatures,
1075 }
1076
1077 impl Features {
1078 fn new() -> Self {
1079 Self {
1080 features: api::VkPhysicalDeviceFeatures {
1081 robustBufferAccess: api::VK_TRUE,
1082 fullDrawIndexUint32: api::VK_TRUE,
1083 imageCubeArray: api::VK_TRUE,
1084 independentBlend: api::VK_FALSE,
1085 geometryShader: api::VK_FALSE,
1086 tessellationShader: api::VK_FALSE,
1087 sampleRateShading: api::VK_FALSE,
1088 dualSrcBlend: api::VK_FALSE,
1089 logicOp: api::VK_TRUE,
1090 multiDrawIndirect: api::VK_TRUE,
1091 drawIndirectFirstInstance: api::VK_TRUE,
1092 depthClamp: api::VK_FALSE,
1093 depthBiasClamp: api::VK_FALSE,
1094 fillModeNonSolid: api::VK_TRUE,
1095 depthBounds: api::VK_FALSE,
1096 wideLines: api::VK_FALSE,
1097 largePoints: api::VK_FALSE,
1098 alphaToOne: api::VK_TRUE,
1099 multiViewport: api::VK_TRUE,
1100 samplerAnisotropy: api::VK_FALSE,
1101 textureCompressionETC2: api::VK_FALSE, // FIXME: enable texture compression
1102 textureCompressionASTC_LDR: api::VK_FALSE, // FIXME: enable texture compression
1103 textureCompressionBC: api::VK_FALSE, // FIXME: enable texture compression
1104 occlusionQueryPrecise: api::VK_FALSE,
1105 pipelineStatisticsQuery: api::VK_FALSE,
1106 vertexPipelineStoresAndAtomics: api::VK_TRUE,
1107 fragmentStoresAndAtomics: api::VK_TRUE,
1108 shaderTessellationAndGeometryPointSize: api::VK_FALSE,
1109 shaderImageGatherExtended: api::VK_FALSE,
1110 shaderStorageImageExtendedFormats: api::VK_FALSE,
1111 shaderStorageImageMultisample: api::VK_FALSE,
1112 shaderStorageImageReadWithoutFormat: api::VK_FALSE,
1113 shaderStorageImageWriteWithoutFormat: api::VK_FALSE,
1114 shaderUniformBufferArrayDynamicIndexing: api::VK_TRUE,
1115 shaderSampledImageArrayDynamicIndexing: api::VK_TRUE,
1116 shaderStorageBufferArrayDynamicIndexing: api::VK_TRUE,
1117 shaderStorageImageArrayDynamicIndexing: api::VK_TRUE,
1118 shaderClipDistance: api::VK_FALSE,
1119 shaderCullDistance: api::VK_FALSE,
1120 shaderFloat64: api::VK_TRUE,
1121 shaderInt64: api::VK_TRUE,
1122 shaderInt16: api::VK_TRUE,
1123 shaderResourceResidency: api::VK_FALSE,
1124 shaderResourceMinLod: api::VK_FALSE,
1125 sparseBinding: api::VK_FALSE,
1126 sparseResidencyBuffer: api::VK_FALSE,
1127 sparseResidencyImage2D: api::VK_FALSE,
1128 sparseResidencyImage3D: api::VK_FALSE,
1129 sparseResidency2Samples: api::VK_FALSE,
1130 sparseResidency4Samples: api::VK_FALSE,
1131 sparseResidency8Samples: api::VK_FALSE,
1132 sparseResidency16Samples: api::VK_FALSE,
1133 sparseResidencyAliased: api::VK_FALSE,
1134 variableMultisampleRate: api::VK_FALSE,
1135 inheritedQueries: api::VK_FALSE,
1136 },
1137 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures {
1138 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
1139 pNext: null_mut(),
1140 storageBuffer16BitAccess: api::VK_TRUE,
1141 uniformAndStorageBuffer16BitAccess: api::VK_TRUE,
1142 storagePushConstant16: api::VK_TRUE,
1143 storageInputOutput16: api::VK_TRUE,
1144 },
1145 sampler_ycbcr_conversion_features:
1146 api::VkPhysicalDeviceSamplerYcbcrConversionFeatures {
1147 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
1148 pNext: null_mut(),
1149 samplerYcbcrConversion: api::VK_FALSE,
1150 },
1151 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures {
1152 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
1153 pNext: null_mut(),
1154 variablePointersStorageBuffer: api::VK_TRUE,
1155 variablePointers: api::VK_TRUE,
1156 },
1157 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures {
1158 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
1159 pNext: null_mut(),
1160 shaderDrawParameters: api::VK_TRUE,
1161 },
1162 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures {
1163 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
1164 pNext: null_mut(),
1165 protectedMemory: api::VK_FALSE,
1166 },
1167 multiview_features: api::VkPhysicalDeviceMultiviewFeatures {
1168 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
1169 pNext: null_mut(),
1170 multiview: api::VK_FALSE,
1171 multiviewGeometryShader: api::VK_FALSE,
1172 multiviewTessellationShader: api::VK_FALSE,
1173 },
1174 }
1175 }
1176 fn splat(value: bool) -> Self {
1177 let value32 = if value { api::VK_TRUE } else { api::VK_FALSE };
1178 Self {
1179 features: api::VkPhysicalDeviceFeatures {
1180 robustBufferAccess: value32,
1181 fullDrawIndexUint32: value32,
1182 imageCubeArray: value32,
1183 independentBlend: value32,
1184 geometryShader: value32,
1185 tessellationShader: value32,
1186 sampleRateShading: value32,
1187 dualSrcBlend: value32,
1188 logicOp: value32,
1189 multiDrawIndirect: value32,
1190 drawIndirectFirstInstance: value32,
1191 depthClamp: value32,
1192 depthBiasClamp: value32,
1193 fillModeNonSolid: value32,
1194 depthBounds: value32,
1195 wideLines: value32,
1196 largePoints: value32,
1197 alphaToOne: value32,
1198 multiViewport: value32,
1199 samplerAnisotropy: value32,
1200 textureCompressionETC2: value32,
1201 textureCompressionASTC_LDR: value32,
1202 textureCompressionBC: value32,
1203 occlusionQueryPrecise: value32,
1204 pipelineStatisticsQuery: value32,
1205 vertexPipelineStoresAndAtomics: value32,
1206 fragmentStoresAndAtomics: value32,
1207 shaderTessellationAndGeometryPointSize: value32,
1208 shaderImageGatherExtended: value32,
1209 shaderStorageImageExtendedFormats: value32,
1210 shaderStorageImageMultisample: value32,
1211 shaderStorageImageReadWithoutFormat: value32,
1212 shaderStorageImageWriteWithoutFormat: value32,
1213 shaderUniformBufferArrayDynamicIndexing: value32,
1214 shaderSampledImageArrayDynamicIndexing: value32,
1215 shaderStorageBufferArrayDynamicIndexing: value32,
1216 shaderStorageImageArrayDynamicIndexing: value32,
1217 shaderClipDistance: value32,
1218 shaderCullDistance: value32,
1219 shaderFloat64: value32,
1220 shaderInt64: value32,
1221 shaderInt16: value32,
1222 shaderResourceResidency: value32,
1223 shaderResourceMinLod: value32,
1224 sparseBinding: value32,
1225 sparseResidencyBuffer: value32,
1226 sparseResidencyImage2D: value32,
1227 sparseResidencyImage3D: value32,
1228 sparseResidency2Samples: value32,
1229 sparseResidency4Samples: value32,
1230 sparseResidency8Samples: value32,
1231 sparseResidency16Samples: value32,
1232 sparseResidencyAliased: value32,
1233 variableMultisampleRate: value32,
1234 inheritedQueries: value32,
1235 },
1236 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures {
1237 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
1238 pNext: null_mut(),
1239 storageBuffer16BitAccess: value32,
1240 uniformAndStorageBuffer16BitAccess: value32,
1241 storagePushConstant16: value32,
1242 storageInputOutput16: value32,
1243 },
1244 sampler_ycbcr_conversion_features:
1245 api::VkPhysicalDeviceSamplerYcbcrConversionFeatures {
1246 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
1247 pNext: null_mut(),
1248 samplerYcbcrConversion: value32,
1249 },
1250 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures {
1251 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
1252 pNext: null_mut(),
1253 variablePointersStorageBuffer: value32,
1254 variablePointers: value32,
1255 },
1256 shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures {
1257 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
1258 pNext: null_mut(),
1259 shaderDrawParameters: value32,
1260 },
1261 protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures {
1262 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
1263 pNext: null_mut(),
1264 protectedMemory: value32,
1265 },
1266 multiview_features: api::VkPhysicalDeviceMultiviewFeatures {
1267 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
1268 pNext: null_mut(),
1269 multiview: value32,
1270 multiviewGeometryShader: value32,
1271 multiviewTessellationShader: value32,
1272 },
1273 }
1274 }
1275 fn visit2_mut<F: FnMut(&mut bool, &mut bool)>(&mut self, rhs: &mut Self, f: F) {
1276 struct VisitorStruct<F: FnMut(&mut bool, &mut bool)>(F);
1277 trait Visitor<T> {
1278 fn visit(&mut self, v1: &mut T, v2: &mut T);
1279 }
1280 impl<F: FnMut(&mut bool, &mut bool)> Visitor<bool> for VisitorStruct<F> {
1281 fn visit(&mut self, v1: &mut bool, v2: &mut bool) {
1282 (self.0)(v1, v2);
1283 }
1284 }
1285 impl<F: FnMut(&mut bool, &mut bool)> Visitor<api::VkBool32> for VisitorStruct<F> {
1286 fn visit(&mut self, value1: &mut api::VkBool32, value2: &mut api::VkBool32) {
1287 let mut temp1 = *value1 != api::VK_FALSE;
1288 let mut temp2 = *value2 != api::VK_FALSE;
1289 (self.0)(&mut temp1, &mut temp2);
1290 *value1 = if temp1 { api::VK_TRUE } else { api::VK_FALSE };
1291 *value2 = if temp2 { api::VK_TRUE } else { api::VK_FALSE };
1292 }
1293 }
1294 let mut visitor = VisitorStruct(f);
1295 macro_rules! visit {
1296 ($member1:ident.$member2:ident) => {
1297 visitor.visit(&mut self.$member1.$member2, &mut rhs.$member1.$member2)
1298 };
1299 ($member:ident) => {
1300 visitor.visit(&mut self.$member1, &mut rhs.$member1)
1301 };
1302 }
1303 visit!(features.robustBufferAccess);
1304 visit!(features.fullDrawIndexUint32);
1305 visit!(features.imageCubeArray);
1306 visit!(features.independentBlend);
1307 visit!(features.geometryShader);
1308 visit!(features.tessellationShader);
1309 visit!(features.sampleRateShading);
1310 visit!(features.dualSrcBlend);
1311 visit!(features.logicOp);
1312 visit!(features.multiDrawIndirect);
1313 visit!(features.drawIndirectFirstInstance);
1314 visit!(features.depthClamp);
1315 visit!(features.depthBiasClamp);
1316 visit!(features.fillModeNonSolid);
1317 visit!(features.depthBounds);
1318 visit!(features.wideLines);
1319 visit!(features.largePoints);
1320 visit!(features.alphaToOne);
1321 visit!(features.multiViewport);
1322 visit!(features.samplerAnisotropy);
1323 visit!(features.textureCompressionETC2);
1324 visit!(features.textureCompressionASTC_LDR);
1325 visit!(features.textureCompressionBC);
1326 visit!(features.occlusionQueryPrecise);
1327 visit!(features.pipelineStatisticsQuery);
1328 visit!(features.vertexPipelineStoresAndAtomics);
1329 visit!(features.fragmentStoresAndAtomics);
1330 visit!(features.shaderTessellationAndGeometryPointSize);
1331 visit!(features.shaderImageGatherExtended);
1332 visit!(features.shaderStorageImageExtendedFormats);
1333 visit!(features.shaderStorageImageMultisample);
1334 visit!(features.shaderStorageImageReadWithoutFormat);
1335 visit!(features.shaderStorageImageWriteWithoutFormat);
1336 visit!(features.shaderUniformBufferArrayDynamicIndexing);
1337 visit!(features.shaderSampledImageArrayDynamicIndexing);
1338 visit!(features.shaderStorageBufferArrayDynamicIndexing);
1339 visit!(features.shaderStorageImageArrayDynamicIndexing);
1340 visit!(features.shaderClipDistance);
1341 visit!(features.shaderCullDistance);
1342 visit!(features.shaderFloat64);
1343 visit!(features.shaderInt64);
1344 visit!(features.shaderInt16);
1345 visit!(features.shaderResourceResidency);
1346 visit!(features.shaderResourceMinLod);
1347 visit!(features.sparseBinding);
1348 visit!(features.sparseResidencyBuffer);
1349 visit!(features.sparseResidencyImage2D);
1350 visit!(features.sparseResidencyImage3D);
1351 visit!(features.sparseResidency2Samples);
1352 visit!(features.sparseResidency4Samples);
1353 visit!(features.sparseResidency8Samples);
1354 visit!(features.sparseResidency16Samples);
1355 visit!(features.sparseResidencyAliased);
1356 visit!(features.variableMultisampleRate);
1357 visit!(features.inheritedQueries);
1358 visit!(physical_device_16bit_storage_features.storageBuffer16BitAccess);
1359 visit!(physical_device_16bit_storage_features.uniformAndStorageBuffer16BitAccess);
1360 visit!(physical_device_16bit_storage_features.storagePushConstant16);
1361 visit!(physical_device_16bit_storage_features.storageInputOutput16);
1362 visit!(sampler_ycbcr_conversion_features.samplerYcbcrConversion);
1363 visit!(variable_pointer_features.variablePointersStorageBuffer);
1364 visit!(variable_pointer_features.variablePointers);
1365 visit!(shader_draw_parameter_features.shaderDrawParameters);
1366 visit!(protected_memory_features.protectedMemory);
1367 visit!(multiview_features.multiview);
1368 visit!(multiview_features.multiviewGeometryShader);
1369 visit!(multiview_features.multiviewTessellationShader);
1370 }
1371 fn visit2<F: FnMut(bool, bool)>(mut self, mut rhs: Self, mut f: F) {
1372 self.visit2_mut(&mut rhs, |v1, v2| f(*v1, *v2));
1373 }
1374 fn visit_mut<F: FnMut(&mut bool)>(&mut self, mut f: F) {
1375 let mut rhs = *self;
1376 self.visit2_mut(&mut rhs, |v, _| f(v));
1377 }
1378 fn visit<F: FnMut(bool)>(mut self, mut f: F) {
1379 self.visit_mut(|v| f(*v));
1380 }
1381 }
1382
1383 trait ImportExportFeatureSet<T> {
1384 fn import_feature_set(&mut self, features: &T);
1385 fn export_feature_set(&self, features: &mut T);
1386 }
1387
1388 impl ImportExportFeatureSet<api::VkPhysicalDeviceFeatures> for Features {
1389 fn import_feature_set(&mut self, features: &api::VkPhysicalDeviceFeatures) {
1390 self.features = *features;
1391 }
1392 fn export_feature_set(&self, features: &mut api::VkPhysicalDeviceFeatures) {
1393 *features = self.features;
1394 }
1395 }
1396
1397 impl ImportExportFeatureSet<api::VkPhysicalDeviceFeatures2> for Features {
1398 fn import_feature_set(&mut self, features: &api::VkPhysicalDeviceFeatures2) {
1399 self.features = features.features;
1400 }
1401 fn export_feature_set(&self, features: &mut api::VkPhysicalDeviceFeatures2) {
1402 features.features = self.features;
1403 }
1404 }
1405
1406 macro_rules! impl_import_export_feature_set {
1407 ($type:ident, $member:ident) => {
1408 impl ImportExportFeatureSet<api::$type> for Features {
1409 fn import_feature_set(&mut self, features: &api::$type) {
1410 self.$member = api::$type {
1411 sType: self.$member.sType,
1412 pNext: self.$member.pNext,
1413 ..*features
1414 };
1415 }
1416 fn export_feature_set(&self, features: &mut api::$type) {
1417 *features = api::$type {
1418 sType: features.sType,
1419 pNext: features.pNext,
1420 ..self.$member
1421 };
1422 }
1423 }
1424 };
1425 }
1426
1427 impl_import_export_feature_set!(
1428 VkPhysicalDevice16BitStorageFeatures,
1429 physical_device_16bit_storage_features
1430 );
1431
1432 impl_import_export_feature_set!(
1433 VkPhysicalDeviceSamplerYcbcrConversionFeatures,
1434 sampler_ycbcr_conversion_features
1435 );
1436
1437 impl_import_export_feature_set!(
1438 VkPhysicalDeviceVariablePointerFeatures,
1439 variable_pointer_features
1440 );
1441
1442 impl_import_export_feature_set!(
1443 VkPhysicalDeviceShaderDrawParameterFeatures,
1444 shader_draw_parameter_features
1445 );
1446
1447 impl_import_export_feature_set!(
1448 VkPhysicalDeviceProtectedMemoryFeatures,
1449 protected_memory_features
1450 );
1451
1452 impl_import_export_feature_set!(VkPhysicalDeviceMultiviewFeatures, multiview_features);
1453
1454 impl Eq for Features {}
1455
1456 impl PartialEq for Features {
1457 fn eq(&self, rhs: &Self) -> bool {
1458 let mut equal = true;
1459 self.visit2(*rhs, |a, b| equal &= a == b);
1460 equal
1461 }
1462 }
1463
1464 impl BitAndAssign for Features {
1465 fn bitand_assign(&mut self, mut rhs: Self) {
1466 self.visit2_mut(&mut rhs, |l, r| *l &= *r);
1467 }
1468 }
1469
1470 impl BitOrAssign for Features {
1471 fn bitor_assign(&mut self, mut rhs: Self) {
1472 self.visit2_mut(&mut rhs, |l, r| *l |= *r);
1473 }
1474 }
1475
1476 impl BitXorAssign for Features {
1477 fn bitxor_assign(&mut self, mut rhs: Self) {
1478 self.visit2_mut(&mut rhs, |l, r| *l ^= *r);
1479 }
1480 }
1481
1482 impl BitAnd for Features {
1483 type Output = Self;
1484 fn bitand(mut self, rhs: Self) -> Self {
1485 self &= rhs;
1486 self
1487 }
1488 }
1489
1490 impl BitOr for Features {
1491 type Output = Self;
1492 fn bitor(mut self, rhs: Self) -> Self {
1493 self |= rhs;
1494 self
1495 }
1496 }
1497
1498 impl BitXor for Features {
1499 type Output = Self;
1500 fn bitxor(mut self, rhs: Self) -> Self {
1501 self ^= rhs;
1502 self
1503 }
1504 }
1505
1506 impl Not for Features {
1507 type Output = Self;
1508 fn not(mut self) -> Self {
1509 self.visit_mut(|v| *v = !*v);
1510 self
1511 }
1512 }
1513
1514 pub struct Queue {}
1515
1516 pub struct Device {
1517 physical_device: SharedHandle<api::VkPhysicalDevice>,
1518 extensions: Extensions,
1519 features: Features,
1520 queues: Vec<Vec<OwnedHandle<api::VkQueue>>>,
1521 }
1522
1523 impl Device {
1524 unsafe fn new(
1525 physical_device: SharedHandle<api::VkPhysicalDevice>,
1526 create_info: *const api::VkDeviceCreateInfo,
1527 ) -> Result<OwnedHandle<api::VkDevice>, api::VkResult> {
1528 parse_next_chain_const!{
1529 create_info,
1530 root = api::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
1531 device_group_device_create_info: api::VkDeviceGroupDeviceCreateInfo = api::VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO,
1532 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
1533 physical_device_features_2: api::VkPhysicalDeviceFeatures2 = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
1534 physical_device_multiview_features: api::VkPhysicalDeviceMultiviewFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
1535 physical_device_protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
1536 physical_device_sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
1537 physical_device_shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
1538 physical_device_variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
1539 }
1540 let ref create_info = *create_info;
1541 if create_info.enabledLayerCount != 0 {
1542 return Err(api::VK_ERROR_LAYER_NOT_PRESENT);
1543 }
1544 let mut enabled_extensions = physical_device.enabled_extensions;
1545 if create_info.enabledExtensionCount != 0 {
1546 for &extension_name in slice::from_raw_parts(
1547 create_info.ppEnabledExtensionNames,
1548 create_info.enabledExtensionCount as usize,
1549 ) {
1550 let extension: Extension = CStr::from_ptr(extension_name)
1551 .to_str()
1552 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?
1553 .parse()
1554 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?;
1555 assert_eq!(extension.get_scope(), ExtensionScope::Device);
1556 enabled_extensions[extension] = true;
1557 }
1558 }
1559 for extension in enabled_extensions
1560 .iter()
1561 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
1562 {
1563 let missing_extensions = extension.get_required_extensions() & !enabled_extensions;
1564 for missing_extension in missing_extensions
1565 .iter()
1566 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
1567 {
1568 panic!(
1569 "extension {} enabled but required extension {} is not enabled",
1570 extension.get_name(),
1571 missing_extension.get_name()
1572 );
1573 }
1574 }
1575 let mut selected_features = Features::splat(false);
1576 if !device_group_device_create_info.is_null() {
1577 let api::VkDeviceGroupDeviceCreateInfo {
1578 sType: _,
1579 pNext: _,
1580 physicalDeviceCount: physical_device_count,
1581 pPhysicalDevices: physical_devices,
1582 } = *device_group_device_create_info;
1583 assert_eq!(
1584 physical_device_count, 1,
1585 "multiple devices in a group are not implemented"
1586 );
1587 assert_eq!(
1588 *physical_devices,
1589 physical_device.get_handle(),
1590 "unknown physical_device"
1591 );
1592 }
1593 if !physical_device_16bit_storage_features.is_null() {
1594 selected_features.import_feature_set(&*physical_device_16bit_storage_features);
1595 }
1596 if !physical_device_features_2.is_null() {
1597 selected_features.import_feature_set(&*physical_device_features_2);
1598 } else if !create_info.pEnabledFeatures.is_null() {
1599 selected_features.import_feature_set(&*create_info.pEnabledFeatures);
1600 }
1601 if !physical_device_multiview_features.is_null() {
1602 selected_features.import_feature_set(&*physical_device_multiview_features);
1603 }
1604 if !physical_device_protected_memory_features.is_null() {
1605 selected_features.import_feature_set(&*physical_device_protected_memory_features);
1606 }
1607 if !physical_device_sampler_ycbcr_conversion_features.is_null() {
1608 selected_features
1609 .import_feature_set(&*physical_device_sampler_ycbcr_conversion_features);
1610 }
1611 if !physical_device_shader_draw_parameter_features.is_null() {
1612 selected_features.import_feature_set(&*physical_device_shader_draw_parameter_features);
1613 } else if enabled_extensions[Extension::VK_KHR_shader_draw_parameters] {
1614 selected_features
1615 .shader_draw_parameter_features
1616 .shaderDrawParameters = api::VK_TRUE;
1617 }
1618 if !physical_device_variable_pointer_features.is_null() {
1619 selected_features.import_feature_set(&*physical_device_variable_pointer_features);
1620 }
1621 if (selected_features & !physical_device.features) != Features::splat(false) {
1622 return Err(api::VK_ERROR_FEATURE_NOT_PRESENT);
1623 }
1624 assert_ne!(create_info.queueCreateInfoCount, 0);
1625 let queue_create_infos = slice::from_raw_parts(
1626 create_info.pQueueCreateInfos,
1627 create_info.queueCreateInfoCount as usize,
1628 );
1629 assert!(queue_create_infos.len() <= QUEUE_FAMILY_COUNT as usize);
1630 let mut total_queue_count = 0;
1631 let mut queue_counts: Vec<_> = Vec::new();
1632 for queue_create_info in queue_create_infos {
1633 parse_next_chain_const!{
1634 queue_create_info as *const api::VkDeviceQueueCreateInfo,
1635 root = api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
1636 }
1637 let api::VkDeviceQueueCreateInfo {
1638 sType: _,
1639 pNext: _,
1640 flags,
1641 queueFamilyIndex: queue_family_index,
1642 queueCount: queue_count,
1643 pQueuePriorities: queue_priorities,
1644 } = *queue_create_info;
1645 assert_eq!(flags & api::VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT, 0);
1646 assert!(queue_family_index < QUEUE_FAMILY_COUNT);
1647 assert!(queue_count <= QUEUE_COUNTS[queue_family_index as usize]);
1648 let queue_priorities = slice::from_raw_parts(queue_priorities, queue_count as usize);
1649 for &queue_priority in queue_priorities {
1650 assert!(queue_priority >= 0.0 && queue_priority <= 1.0);
1651 }
1652 assert_eq!(QUEUE_FAMILY_COUNT, 1, "multiple queues are not implemented");
1653 assert_eq!(
1654 QUEUE_COUNTS, [1; QUEUE_FAMILY_COUNT as usize],
1655 "multiple queues are not implemented"
1656 );
1657 queue_counts.push(queue_count as usize);
1658 total_queue_count += queue_count as usize;
1659 }
1660 assert!(total_queue_count <= TOTAL_QUEUE_COUNT);
1661 let mut queues = Vec::new();
1662 for queue_count in queue_counts {
1663 let mut queue_family_queues = Vec::new();
1664 for _queue_index in 0..queue_count {
1665 queue_family_queues.push(OwnedHandle::<api::VkQueue>::new(Queue {}));
1666 }
1667 queues.push(queue_family_queues);
1668 }
1669 Ok(OwnedHandle::<api::VkDevice>::new(Device {
1670 physical_device,
1671 extensions: enabled_extensions,
1672 features: selected_features,
1673 queues,
1674 }))
1675 }
1676 }
1677
1678 pub struct PhysicalDevice {
1679 enabled_extensions: Extensions,
1680 allowed_extensions: Extensions,
1681 properties: api::VkPhysicalDeviceProperties,
1682 features: Features,
1683 system_memory_size: u64,
1684 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties,
1685 multiview_properties: api::VkPhysicalDeviceMultiviewProperties,
1686 id_properties: api::VkPhysicalDeviceIDProperties,
1687 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties,
1688 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties,
1689 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties,
1690 }
1691
1692 impl PhysicalDevice {
1693 pub fn get_pipeline_cache_uuid() -> uuid::Uuid {
1694 // FIXME: return real uuid
1695 uuid::Uuid::nil()
1696 }
1697 pub fn get_device_uuid() -> uuid::Uuid {
1698 // FIXME: return real uuid
1699 uuid::Uuid::nil()
1700 }
1701 pub fn get_driver_uuid() -> uuid::Uuid {
1702 // FIXME: return real uuid
1703 uuid::Uuid::nil()
1704 }
1705 pub fn get_limits() -> api::VkPhysicalDeviceLimits {
1706 api::VkPhysicalDeviceLimits {
1707 maxImageDimension1D: !0,
1708 maxImageDimension2D: !0,
1709 maxImageDimension3D: !0,
1710 maxImageDimensionCube: !0,
1711 maxImageArrayLayers: !0,
1712 maxTexelBufferElements: !0,
1713 maxUniformBufferRange: !0,
1714 maxStorageBufferRange: !0,
1715 maxPushConstantsSize: !0,
1716 maxMemoryAllocationCount: !0,
1717 maxSamplerAllocationCount: !0,
1718 bufferImageGranularity: 1,
1719 sparseAddressSpaceSize: 0,
1720 maxBoundDescriptorSets: !0,
1721 maxPerStageDescriptorSamplers: !0,
1722 maxPerStageDescriptorUniformBuffers: !0,
1723 maxPerStageDescriptorStorageBuffers: !0,
1724 maxPerStageDescriptorSampledImages: !0,
1725 maxPerStageDescriptorStorageImages: !0,
1726 maxPerStageDescriptorInputAttachments: !0,
1727 maxPerStageResources: !0,
1728 maxDescriptorSetSamplers: !0,
1729 maxDescriptorSetUniformBuffers: !0,
1730 maxDescriptorSetUniformBuffersDynamic: !0,
1731 maxDescriptorSetStorageBuffers: !0,
1732 maxDescriptorSetStorageBuffersDynamic: !0,
1733 maxDescriptorSetSampledImages: !0,
1734 maxDescriptorSetStorageImages: !0,
1735 maxDescriptorSetInputAttachments: !0,
1736 maxVertexInputAttributes: !0,
1737 maxVertexInputBindings: !0,
1738 maxVertexInputAttributeOffset: !0,
1739 maxVertexInputBindingStride: !0,
1740 maxVertexOutputComponents: !0,
1741 maxTessellationGenerationLevel: 0,
1742 maxTessellationPatchSize: 0,
1743 maxTessellationControlPerVertexInputComponents: 0,
1744 maxTessellationControlPerVertexOutputComponents: 0,
1745 maxTessellationControlPerPatchOutputComponents: 0,
1746 maxTessellationControlTotalOutputComponents: 0,
1747 maxTessellationEvaluationInputComponents: 0,
1748 maxTessellationEvaluationOutputComponents: 0,
1749 maxGeometryShaderInvocations: 0,
1750 maxGeometryInputComponents: 0,
1751 maxGeometryOutputComponents: 0,
1752 maxGeometryOutputVertices: 0,
1753 maxGeometryTotalOutputComponents: 0,
1754 maxFragmentInputComponents: !0,
1755 maxFragmentOutputAttachments: !0,
1756 maxFragmentDualSrcAttachments: 0,
1757 maxFragmentCombinedOutputResources: !0,
1758 maxComputeSharedMemorySize: !0,
1759 maxComputeWorkGroupCount: [!0; 3],
1760 maxComputeWorkGroupInvocations: !0,
1761 maxComputeWorkGroupSize: [!0; 3],
1762 subPixelPrecisionBits: 4, // FIXME: update to correct value
1763 subTexelPrecisionBits: 4, // FIXME: update to correct value
1764 mipmapPrecisionBits: 4, // FIXME: update to correct value
1765 maxDrawIndexedIndexValue: !0,
1766 maxDrawIndirectCount: !0,
1767 maxSamplerLodBias: 2.0, // FIXME: update to correct value
1768 maxSamplerAnisotropy: 1.0,
1769 maxViewports: 1,
1770 maxViewportDimensions: [4096; 2], // FIXME: update to correct value
1771 viewportBoundsRange: [-8192.0, 8191.0], // FIXME: update to correct value
1772 viewportSubPixelBits: 0,
1773 minMemoryMapAlignment: MIN_MEMORY_MAP_ALIGNMENT,
1774 minTexelBufferOffsetAlignment: 64, // FIXME: update to correct value
1775 minUniformBufferOffsetAlignment: 64, // FIXME: update to correct value
1776 minStorageBufferOffsetAlignment: 64, // FIXME: update to correct value
1777 minTexelOffset: -8, // FIXME: update to correct value
1778 maxTexelOffset: 7, // FIXME: update to correct value
1779 minTexelGatherOffset: 0,
1780 maxTexelGatherOffset: 0,
1781 minInterpolationOffset: 0.0,
1782 maxInterpolationOffset: 0.0,
1783 subPixelInterpolationOffsetBits: 0,
1784 maxFramebufferWidth: 4096, // FIXME: update to correct value
1785 maxFramebufferHeight: 4096, // FIXME: update to correct value
1786 maxFramebufferLayers: 256, // FIXME: update to correct value
1787 framebufferColorSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1788 framebufferDepthSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1789 framebufferStencilSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1790 framebufferNoAttachmentsSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1791 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1792 maxColorAttachments: 4,
1793 sampledImageColorSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1794 sampledImageIntegerSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1795 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1796 sampledImageDepthSampleCounts: api::VK_SAMPLE_COUNT_1_BIT | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1797 sampledImageStencilSampleCounts: api::VK_SAMPLE_COUNT_1_BIT
1798 | api::VK_SAMPLE_COUNT_4_BIT, // FIXME: update to correct value
1799 storageImageSampleCounts: api::VK_SAMPLE_COUNT_1_BIT, // FIXME: update to correct value
1800 maxSampleMaskWords: 1,
1801 timestampComputeAndGraphics: api::VK_FALSE,
1802 timestampPeriod: 0.0,
1803 maxClipDistances: 0,
1804 maxCullDistances: 0,
1805 maxCombinedClipAndCullDistances: 0,
1806 discreteQueuePriorities: 2,
1807 pointSizeRange: [1.0; 2],
1808 lineWidthRange: [1.0; 2],
1809 pointSizeGranularity: 0.0,
1810 lineWidthGranularity: 0.0,
1811 strictLines: api::VK_FALSE,
1812 standardSampleLocations: api::VK_TRUE,
1813 optimalBufferCopyOffsetAlignment: 16,
1814 optimalBufferCopyRowPitchAlignment: 16,
1815 nonCoherentAtomSize: 1, //TODO: check if this is correct
1816 }
1817 }
1818 pub fn get_format_properties(format: api::VkFormat) -> api::VkFormatProperties {
1819 match format {
1820 api::VK_FORMAT_UNDEFINED => api::VkFormatProperties {
1821 linearTilingFeatures: 0,
1822 optimalTilingFeatures: 0,
1823 bufferFeatures: 0,
1824 },
1825 api::VK_FORMAT_R4G4_UNORM_PACK8 => api::VkFormatProperties {
1826 // FIXME: finish
1827 linearTilingFeatures: 0,
1828 optimalTilingFeatures: 0,
1829 bufferFeatures: 0,
1830 },
1831 api::VK_FORMAT_R4G4B4A4_UNORM_PACK16 => api::VkFormatProperties {
1832 // FIXME: finish
1833 linearTilingFeatures: 0,
1834 optimalTilingFeatures: 0,
1835 bufferFeatures: 0,
1836 },
1837 api::VK_FORMAT_B4G4R4A4_UNORM_PACK16 => api::VkFormatProperties {
1838 // FIXME: finish
1839 linearTilingFeatures: 0,
1840 optimalTilingFeatures: 0,
1841 bufferFeatures: 0,
1842 },
1843 api::VK_FORMAT_R5G6B5_UNORM_PACK16 => api::VkFormatProperties {
1844 // FIXME: finish
1845 linearTilingFeatures: 0,
1846 optimalTilingFeatures: 0,
1847 bufferFeatures: 0,
1848 },
1849 api::VK_FORMAT_B5G6R5_UNORM_PACK16 => api::VkFormatProperties {
1850 // FIXME: finish
1851 linearTilingFeatures: 0,
1852 optimalTilingFeatures: 0,
1853 bufferFeatures: 0,
1854 },
1855 api::VK_FORMAT_R5G5B5A1_UNORM_PACK16 => api::VkFormatProperties {
1856 // FIXME: finish
1857 linearTilingFeatures: 0,
1858 optimalTilingFeatures: 0,
1859 bufferFeatures: 0,
1860 },
1861 api::VK_FORMAT_B5G5R5A1_UNORM_PACK16 => api::VkFormatProperties {
1862 // FIXME: finish
1863 linearTilingFeatures: 0,
1864 optimalTilingFeatures: 0,
1865 bufferFeatures: 0,
1866 },
1867 api::VK_FORMAT_A1R5G5B5_UNORM_PACK16 => api::VkFormatProperties {
1868 // FIXME: finish
1869 linearTilingFeatures: 0,
1870 optimalTilingFeatures: 0,
1871 bufferFeatures: 0,
1872 },
1873 api::VK_FORMAT_R8_UNORM => api::VkFormatProperties {
1874 // FIXME: finish
1875 linearTilingFeatures: 0,
1876 optimalTilingFeatures: 0,
1877 bufferFeatures: 0,
1878 },
1879 api::VK_FORMAT_R8_SNORM => api::VkFormatProperties {
1880 // FIXME: finish
1881 linearTilingFeatures: 0,
1882 optimalTilingFeatures: 0,
1883 bufferFeatures: 0,
1884 },
1885 api::VK_FORMAT_R8_USCALED => api::VkFormatProperties {
1886 // FIXME: finish
1887 linearTilingFeatures: 0,
1888 optimalTilingFeatures: 0,
1889 bufferFeatures: 0,
1890 },
1891 api::VK_FORMAT_R8_SSCALED => api::VkFormatProperties {
1892 // FIXME: finish
1893 linearTilingFeatures: 0,
1894 optimalTilingFeatures: 0,
1895 bufferFeatures: 0,
1896 },
1897 api::VK_FORMAT_R8_UINT => api::VkFormatProperties {
1898 // FIXME: finish
1899 linearTilingFeatures: 0,
1900 optimalTilingFeatures: 0,
1901 bufferFeatures: 0,
1902 },
1903 api::VK_FORMAT_R8_SINT => api::VkFormatProperties {
1904 // FIXME: finish
1905 linearTilingFeatures: 0,
1906 optimalTilingFeatures: 0,
1907 bufferFeatures: 0,
1908 },
1909 api::VK_FORMAT_R8_SRGB => api::VkFormatProperties {
1910 // FIXME: finish
1911 linearTilingFeatures: 0,
1912 optimalTilingFeatures: 0,
1913 bufferFeatures: 0,
1914 },
1915 api::VK_FORMAT_R8G8_UNORM => api::VkFormatProperties {
1916 // FIXME: finish
1917 linearTilingFeatures: 0,
1918 optimalTilingFeatures: 0,
1919 bufferFeatures: 0,
1920 },
1921 api::VK_FORMAT_R8G8_SNORM => api::VkFormatProperties {
1922 // FIXME: finish
1923 linearTilingFeatures: 0,
1924 optimalTilingFeatures: 0,
1925 bufferFeatures: 0,
1926 },
1927 api::VK_FORMAT_R8G8_USCALED => api::VkFormatProperties {
1928 // FIXME: finish
1929 linearTilingFeatures: 0,
1930 optimalTilingFeatures: 0,
1931 bufferFeatures: 0,
1932 },
1933 api::VK_FORMAT_R8G8_SSCALED => api::VkFormatProperties {
1934 // FIXME: finish
1935 linearTilingFeatures: 0,
1936 optimalTilingFeatures: 0,
1937 bufferFeatures: 0,
1938 },
1939 api::VK_FORMAT_R8G8_UINT => api::VkFormatProperties {
1940 // FIXME: finish
1941 linearTilingFeatures: 0,
1942 optimalTilingFeatures: 0,
1943 bufferFeatures: 0,
1944 },
1945 api::VK_FORMAT_R8G8_SINT => api::VkFormatProperties {
1946 // FIXME: finish
1947 linearTilingFeatures: 0,
1948 optimalTilingFeatures: 0,
1949 bufferFeatures: 0,
1950 },
1951 api::VK_FORMAT_R8G8_SRGB => api::VkFormatProperties {
1952 // FIXME: finish
1953 linearTilingFeatures: 0,
1954 optimalTilingFeatures: 0,
1955 bufferFeatures: 0,
1956 },
1957 api::VK_FORMAT_R8G8B8_UNORM => api::VkFormatProperties {
1958 // FIXME: finish
1959 linearTilingFeatures: 0,
1960 optimalTilingFeatures: 0,
1961 bufferFeatures: 0,
1962 },
1963 api::VK_FORMAT_R8G8B8_SNORM => api::VkFormatProperties {
1964 // FIXME: finish
1965 linearTilingFeatures: 0,
1966 optimalTilingFeatures: 0,
1967 bufferFeatures: 0,
1968 },
1969 api::VK_FORMAT_R8G8B8_USCALED => api::VkFormatProperties {
1970 // FIXME: finish
1971 linearTilingFeatures: 0,
1972 optimalTilingFeatures: 0,
1973 bufferFeatures: 0,
1974 },
1975 api::VK_FORMAT_R8G8B8_SSCALED => api::VkFormatProperties {
1976 // FIXME: finish
1977 linearTilingFeatures: 0,
1978 optimalTilingFeatures: 0,
1979 bufferFeatures: 0,
1980 },
1981 api::VK_FORMAT_R8G8B8_UINT => api::VkFormatProperties {
1982 // FIXME: finish
1983 linearTilingFeatures: 0,
1984 optimalTilingFeatures: 0,
1985 bufferFeatures: 0,
1986 },
1987 api::VK_FORMAT_R8G8B8_SINT => api::VkFormatProperties {
1988 // FIXME: finish
1989 linearTilingFeatures: 0,
1990 optimalTilingFeatures: 0,
1991 bufferFeatures: 0,
1992 },
1993 api::VK_FORMAT_R8G8B8_SRGB => api::VkFormatProperties {
1994 // FIXME: finish
1995 linearTilingFeatures: 0,
1996 optimalTilingFeatures: 0,
1997 bufferFeatures: 0,
1998 },
1999 api::VK_FORMAT_B8G8R8_UNORM => api::VkFormatProperties {
2000 // FIXME: finish
2001 linearTilingFeatures: 0,
2002 optimalTilingFeatures: 0,
2003 bufferFeatures: 0,
2004 },
2005 api::VK_FORMAT_B8G8R8_SNORM => api::VkFormatProperties {
2006 // FIXME: finish
2007 linearTilingFeatures: 0,
2008 optimalTilingFeatures: 0,
2009 bufferFeatures: 0,
2010 },
2011 api::VK_FORMAT_B8G8R8_USCALED => api::VkFormatProperties {
2012 // FIXME: finish
2013 linearTilingFeatures: 0,
2014 optimalTilingFeatures: 0,
2015 bufferFeatures: 0,
2016 },
2017 api::VK_FORMAT_B8G8R8_SSCALED => api::VkFormatProperties {
2018 // FIXME: finish
2019 linearTilingFeatures: 0,
2020 optimalTilingFeatures: 0,
2021 bufferFeatures: 0,
2022 },
2023 api::VK_FORMAT_B8G8R8_UINT => api::VkFormatProperties {
2024 // FIXME: finish
2025 linearTilingFeatures: 0,
2026 optimalTilingFeatures: 0,
2027 bufferFeatures: 0,
2028 },
2029 api::VK_FORMAT_B8G8R8_SINT => api::VkFormatProperties {
2030 // FIXME: finish
2031 linearTilingFeatures: 0,
2032 optimalTilingFeatures: 0,
2033 bufferFeatures: 0,
2034 },
2035 api::VK_FORMAT_B8G8R8_SRGB => api::VkFormatProperties {
2036 // FIXME: finish
2037 linearTilingFeatures: 0,
2038 optimalTilingFeatures: 0,
2039 bufferFeatures: 0,
2040 },
2041 api::VK_FORMAT_R8G8B8A8_UNORM => api::VkFormatProperties {
2042 // FIXME: finish
2043 linearTilingFeatures: 0,
2044 optimalTilingFeatures: 0,
2045 bufferFeatures: 0,
2046 },
2047 api::VK_FORMAT_R8G8B8A8_SNORM => api::VkFormatProperties {
2048 // FIXME: finish
2049 linearTilingFeatures: 0,
2050 optimalTilingFeatures: 0,
2051 bufferFeatures: 0,
2052 },
2053 api::VK_FORMAT_R8G8B8A8_USCALED => api::VkFormatProperties {
2054 // FIXME: finish
2055 linearTilingFeatures: 0,
2056 optimalTilingFeatures: 0,
2057 bufferFeatures: 0,
2058 },
2059 api::VK_FORMAT_R8G8B8A8_SSCALED => api::VkFormatProperties {
2060 // FIXME: finish
2061 linearTilingFeatures: 0,
2062 optimalTilingFeatures: 0,
2063 bufferFeatures: 0,
2064 },
2065 api::VK_FORMAT_R8G8B8A8_UINT => api::VkFormatProperties {
2066 // FIXME: finish
2067 linearTilingFeatures: 0,
2068 optimalTilingFeatures: 0,
2069 bufferFeatures: 0,
2070 },
2071 api::VK_FORMAT_R8G8B8A8_SINT => api::VkFormatProperties {
2072 // FIXME: finish
2073 linearTilingFeatures: 0,
2074 optimalTilingFeatures: 0,
2075 bufferFeatures: 0,
2076 },
2077 api::VK_FORMAT_R8G8B8A8_SRGB => api::VkFormatProperties {
2078 // FIXME: finish
2079 linearTilingFeatures: 0,
2080 optimalTilingFeatures: 0,
2081 bufferFeatures: 0,
2082 },
2083 api::VK_FORMAT_B8G8R8A8_UNORM => api::VkFormatProperties {
2084 // FIXME: finish
2085 linearTilingFeatures: 0,
2086 optimalTilingFeatures: 0,
2087 bufferFeatures: 0,
2088 },
2089 api::VK_FORMAT_B8G8R8A8_SNORM => api::VkFormatProperties {
2090 // FIXME: finish
2091 linearTilingFeatures: 0,
2092 optimalTilingFeatures: 0,
2093 bufferFeatures: 0,
2094 },
2095 api::VK_FORMAT_B8G8R8A8_USCALED => api::VkFormatProperties {
2096 // FIXME: finish
2097 linearTilingFeatures: 0,
2098 optimalTilingFeatures: 0,
2099 bufferFeatures: 0,
2100 },
2101 api::VK_FORMAT_B8G8R8A8_SSCALED => api::VkFormatProperties {
2102 // FIXME: finish
2103 linearTilingFeatures: 0,
2104 optimalTilingFeatures: 0,
2105 bufferFeatures: 0,
2106 },
2107 api::VK_FORMAT_B8G8R8A8_UINT => api::VkFormatProperties {
2108 // FIXME: finish
2109 linearTilingFeatures: 0,
2110 optimalTilingFeatures: 0,
2111 bufferFeatures: 0,
2112 },
2113 api::VK_FORMAT_B8G8R8A8_SINT => api::VkFormatProperties {
2114 // FIXME: finish
2115 linearTilingFeatures: 0,
2116 optimalTilingFeatures: 0,
2117 bufferFeatures: 0,
2118 },
2119 api::VK_FORMAT_B8G8R8A8_SRGB => api::VkFormatProperties {
2120 // FIXME: finish
2121 linearTilingFeatures: 0,
2122 optimalTilingFeatures: 0,
2123 bufferFeatures: 0,
2124 },
2125 api::VK_FORMAT_A8B8G8R8_UNORM_PACK32 => api::VkFormatProperties {
2126 // FIXME: finish
2127 linearTilingFeatures: 0,
2128 optimalTilingFeatures: 0,
2129 bufferFeatures: 0,
2130 },
2131 api::VK_FORMAT_A8B8G8R8_SNORM_PACK32 => api::VkFormatProperties {
2132 // FIXME: finish
2133 linearTilingFeatures: 0,
2134 optimalTilingFeatures: 0,
2135 bufferFeatures: 0,
2136 },
2137 api::VK_FORMAT_A8B8G8R8_USCALED_PACK32 => api::VkFormatProperties {
2138 // FIXME: finish
2139 linearTilingFeatures: 0,
2140 optimalTilingFeatures: 0,
2141 bufferFeatures: 0,
2142 },
2143 api::VK_FORMAT_A8B8G8R8_SSCALED_PACK32 => api::VkFormatProperties {
2144 // FIXME: finish
2145 linearTilingFeatures: 0,
2146 optimalTilingFeatures: 0,
2147 bufferFeatures: 0,
2148 },
2149 api::VK_FORMAT_A8B8G8R8_UINT_PACK32 => api::VkFormatProperties {
2150 // FIXME: finish
2151 linearTilingFeatures: 0,
2152 optimalTilingFeatures: 0,
2153 bufferFeatures: 0,
2154 },
2155 api::VK_FORMAT_A8B8G8R8_SINT_PACK32 => api::VkFormatProperties {
2156 // FIXME: finish
2157 linearTilingFeatures: 0,
2158 optimalTilingFeatures: 0,
2159 bufferFeatures: 0,
2160 },
2161 api::VK_FORMAT_A8B8G8R8_SRGB_PACK32 => api::VkFormatProperties {
2162 // FIXME: finish
2163 linearTilingFeatures: 0,
2164 optimalTilingFeatures: 0,
2165 bufferFeatures: 0,
2166 },
2167 api::VK_FORMAT_A2R10G10B10_UNORM_PACK32 => api::VkFormatProperties {
2168 // FIXME: finish
2169 linearTilingFeatures: 0,
2170 optimalTilingFeatures: 0,
2171 bufferFeatures: 0,
2172 },
2173 api::VK_FORMAT_A2R10G10B10_SNORM_PACK32 => api::VkFormatProperties {
2174 // FIXME: finish
2175 linearTilingFeatures: 0,
2176 optimalTilingFeatures: 0,
2177 bufferFeatures: 0,
2178 },
2179 api::VK_FORMAT_A2R10G10B10_USCALED_PACK32 => api::VkFormatProperties {
2180 // FIXME: finish
2181 linearTilingFeatures: 0,
2182 optimalTilingFeatures: 0,
2183 bufferFeatures: 0,
2184 },
2185 api::VK_FORMAT_A2R10G10B10_SSCALED_PACK32 => api::VkFormatProperties {
2186 // FIXME: finish
2187 linearTilingFeatures: 0,
2188 optimalTilingFeatures: 0,
2189 bufferFeatures: 0,
2190 },
2191 api::VK_FORMAT_A2R10G10B10_UINT_PACK32 => api::VkFormatProperties {
2192 // FIXME: finish
2193 linearTilingFeatures: 0,
2194 optimalTilingFeatures: 0,
2195 bufferFeatures: 0,
2196 },
2197 api::VK_FORMAT_A2R10G10B10_SINT_PACK32 => api::VkFormatProperties {
2198 // FIXME: finish
2199 linearTilingFeatures: 0,
2200 optimalTilingFeatures: 0,
2201 bufferFeatures: 0,
2202 },
2203 api::VK_FORMAT_A2B10G10R10_UNORM_PACK32 => api::VkFormatProperties {
2204 // FIXME: finish
2205 linearTilingFeatures: 0,
2206 optimalTilingFeatures: 0,
2207 bufferFeatures: 0,
2208 },
2209 api::VK_FORMAT_A2B10G10R10_SNORM_PACK32 => api::VkFormatProperties {
2210 // FIXME: finish
2211 linearTilingFeatures: 0,
2212 optimalTilingFeatures: 0,
2213 bufferFeatures: 0,
2214 },
2215 api::VK_FORMAT_A2B10G10R10_USCALED_PACK32 => api::VkFormatProperties {
2216 // FIXME: finish
2217 linearTilingFeatures: 0,
2218 optimalTilingFeatures: 0,
2219 bufferFeatures: 0,
2220 },
2221 api::VK_FORMAT_A2B10G10R10_SSCALED_PACK32 => api::VkFormatProperties {
2222 // FIXME: finish
2223 linearTilingFeatures: 0,
2224 optimalTilingFeatures: 0,
2225 bufferFeatures: 0,
2226 },
2227 api::VK_FORMAT_A2B10G10R10_UINT_PACK32 => api::VkFormatProperties {
2228 // FIXME: finish
2229 linearTilingFeatures: 0,
2230 optimalTilingFeatures: 0,
2231 bufferFeatures: 0,
2232 },
2233 api::VK_FORMAT_A2B10G10R10_SINT_PACK32 => api::VkFormatProperties {
2234 // FIXME: finish
2235 linearTilingFeatures: 0,
2236 optimalTilingFeatures: 0,
2237 bufferFeatures: 0,
2238 },
2239 api::VK_FORMAT_R16_UNORM => api::VkFormatProperties {
2240 // FIXME: finish
2241 linearTilingFeatures: 0,
2242 optimalTilingFeatures: 0,
2243 bufferFeatures: 0,
2244 },
2245 api::VK_FORMAT_R16_SNORM => api::VkFormatProperties {
2246 // FIXME: finish
2247 linearTilingFeatures: 0,
2248 optimalTilingFeatures: 0,
2249 bufferFeatures: 0,
2250 },
2251 api::VK_FORMAT_R16_USCALED => api::VkFormatProperties {
2252 // FIXME: finish
2253 linearTilingFeatures: 0,
2254 optimalTilingFeatures: 0,
2255 bufferFeatures: 0,
2256 },
2257 api::VK_FORMAT_R16_SSCALED => api::VkFormatProperties {
2258 // FIXME: finish
2259 linearTilingFeatures: 0,
2260 optimalTilingFeatures: 0,
2261 bufferFeatures: 0,
2262 },
2263 api::VK_FORMAT_R16_UINT => api::VkFormatProperties {
2264 // FIXME: finish
2265 linearTilingFeatures: 0,
2266 optimalTilingFeatures: 0,
2267 bufferFeatures: 0,
2268 },
2269 api::VK_FORMAT_R16_SINT => api::VkFormatProperties {
2270 // FIXME: finish
2271 linearTilingFeatures: 0,
2272 optimalTilingFeatures: 0,
2273 bufferFeatures: 0,
2274 },
2275 api::VK_FORMAT_R16_SFLOAT => api::VkFormatProperties {
2276 // FIXME: finish
2277 linearTilingFeatures: 0,
2278 optimalTilingFeatures: 0,
2279 bufferFeatures: 0,
2280 },
2281 api::VK_FORMAT_R16G16_UNORM => api::VkFormatProperties {
2282 // FIXME: finish
2283 linearTilingFeatures: 0,
2284 optimalTilingFeatures: 0,
2285 bufferFeatures: 0,
2286 },
2287 api::VK_FORMAT_R16G16_SNORM => api::VkFormatProperties {
2288 // FIXME: finish
2289 linearTilingFeatures: 0,
2290 optimalTilingFeatures: 0,
2291 bufferFeatures: 0,
2292 },
2293 api::VK_FORMAT_R16G16_USCALED => api::VkFormatProperties {
2294 // FIXME: finish
2295 linearTilingFeatures: 0,
2296 optimalTilingFeatures: 0,
2297 bufferFeatures: 0,
2298 },
2299 api::VK_FORMAT_R16G16_SSCALED => api::VkFormatProperties {
2300 // FIXME: finish
2301 linearTilingFeatures: 0,
2302 optimalTilingFeatures: 0,
2303 bufferFeatures: 0,
2304 },
2305 api::VK_FORMAT_R16G16_UINT => api::VkFormatProperties {
2306 // FIXME: finish
2307 linearTilingFeatures: 0,
2308 optimalTilingFeatures: 0,
2309 bufferFeatures: 0,
2310 },
2311 api::VK_FORMAT_R16G16_SINT => api::VkFormatProperties {
2312 // FIXME: finish
2313 linearTilingFeatures: 0,
2314 optimalTilingFeatures: 0,
2315 bufferFeatures: 0,
2316 },
2317 api::VK_FORMAT_R16G16_SFLOAT => api::VkFormatProperties {
2318 // FIXME: finish
2319 linearTilingFeatures: 0,
2320 optimalTilingFeatures: 0,
2321 bufferFeatures: 0,
2322 },
2323 api::VK_FORMAT_R16G16B16_UNORM => api::VkFormatProperties {
2324 // FIXME: finish
2325 linearTilingFeatures: 0,
2326 optimalTilingFeatures: 0,
2327 bufferFeatures: 0,
2328 },
2329 api::VK_FORMAT_R16G16B16_SNORM => api::VkFormatProperties {
2330 // FIXME: finish
2331 linearTilingFeatures: 0,
2332 optimalTilingFeatures: 0,
2333 bufferFeatures: 0,
2334 },
2335 api::VK_FORMAT_R16G16B16_USCALED => api::VkFormatProperties {
2336 // FIXME: finish
2337 linearTilingFeatures: 0,
2338 optimalTilingFeatures: 0,
2339 bufferFeatures: 0,
2340 },
2341 api::VK_FORMAT_R16G16B16_SSCALED => api::VkFormatProperties {
2342 // FIXME: finish
2343 linearTilingFeatures: 0,
2344 optimalTilingFeatures: 0,
2345 bufferFeatures: 0,
2346 },
2347 api::VK_FORMAT_R16G16B16_UINT => api::VkFormatProperties {
2348 // FIXME: finish
2349 linearTilingFeatures: 0,
2350 optimalTilingFeatures: 0,
2351 bufferFeatures: 0,
2352 },
2353 api::VK_FORMAT_R16G16B16_SINT => api::VkFormatProperties {
2354 // FIXME: finish
2355 linearTilingFeatures: 0,
2356 optimalTilingFeatures: 0,
2357 bufferFeatures: 0,
2358 },
2359 api::VK_FORMAT_R16G16B16_SFLOAT => api::VkFormatProperties {
2360 // FIXME: finish
2361 linearTilingFeatures: 0,
2362 optimalTilingFeatures: 0,
2363 bufferFeatures: 0,
2364 },
2365 api::VK_FORMAT_R16G16B16A16_UNORM => api::VkFormatProperties {
2366 // FIXME: finish
2367 linearTilingFeatures: 0,
2368 optimalTilingFeatures: 0,
2369 bufferFeatures: 0,
2370 },
2371 api::VK_FORMAT_R16G16B16A16_SNORM => api::VkFormatProperties {
2372 // FIXME: finish
2373 linearTilingFeatures: 0,
2374 optimalTilingFeatures: 0,
2375 bufferFeatures: 0,
2376 },
2377 api::VK_FORMAT_R16G16B16A16_USCALED => api::VkFormatProperties {
2378 // FIXME: finish
2379 linearTilingFeatures: 0,
2380 optimalTilingFeatures: 0,
2381 bufferFeatures: 0,
2382 },
2383 api::VK_FORMAT_R16G16B16A16_SSCALED => api::VkFormatProperties {
2384 // FIXME: finish
2385 linearTilingFeatures: 0,
2386 optimalTilingFeatures: 0,
2387 bufferFeatures: 0,
2388 },
2389 api::VK_FORMAT_R16G16B16A16_UINT => api::VkFormatProperties {
2390 // FIXME: finish
2391 linearTilingFeatures: 0,
2392 optimalTilingFeatures: 0,
2393 bufferFeatures: 0,
2394 },
2395 api::VK_FORMAT_R16G16B16A16_SINT => api::VkFormatProperties {
2396 // FIXME: finish
2397 linearTilingFeatures: 0,
2398 optimalTilingFeatures: 0,
2399 bufferFeatures: 0,
2400 },
2401 api::VK_FORMAT_R16G16B16A16_SFLOAT => api::VkFormatProperties {
2402 // FIXME: finish
2403 linearTilingFeatures: 0,
2404 optimalTilingFeatures: 0,
2405 bufferFeatures: 0,
2406 },
2407 api::VK_FORMAT_R32_UINT => api::VkFormatProperties {
2408 // FIXME: finish
2409 linearTilingFeatures: 0,
2410 optimalTilingFeatures: 0,
2411 bufferFeatures: 0,
2412 },
2413 api::VK_FORMAT_R32_SINT => api::VkFormatProperties {
2414 // FIXME: finish
2415 linearTilingFeatures: 0,
2416 optimalTilingFeatures: 0,
2417 bufferFeatures: 0,
2418 },
2419 api::VK_FORMAT_R32_SFLOAT => api::VkFormatProperties {
2420 // FIXME: finish
2421 linearTilingFeatures: 0,
2422 optimalTilingFeatures: 0,
2423 bufferFeatures: 0,
2424 },
2425 api::VK_FORMAT_R32G32_UINT => api::VkFormatProperties {
2426 // FIXME: finish
2427 linearTilingFeatures: 0,
2428 optimalTilingFeatures: 0,
2429 bufferFeatures: 0,
2430 },
2431 api::VK_FORMAT_R32G32_SINT => api::VkFormatProperties {
2432 // FIXME: finish
2433 linearTilingFeatures: 0,
2434 optimalTilingFeatures: 0,
2435 bufferFeatures: 0,
2436 },
2437 api::VK_FORMAT_R32G32_SFLOAT => api::VkFormatProperties {
2438 // FIXME: finish
2439 linearTilingFeatures: 0,
2440 optimalTilingFeatures: 0,
2441 bufferFeatures: 0,
2442 },
2443 api::VK_FORMAT_R32G32B32_UINT => api::VkFormatProperties {
2444 // FIXME: finish
2445 linearTilingFeatures: 0,
2446 optimalTilingFeatures: 0,
2447 bufferFeatures: 0,
2448 },
2449 api::VK_FORMAT_R32G32B32_SINT => api::VkFormatProperties {
2450 // FIXME: finish
2451 linearTilingFeatures: 0,
2452 optimalTilingFeatures: 0,
2453 bufferFeatures: 0,
2454 },
2455 api::VK_FORMAT_R32G32B32_SFLOAT => api::VkFormatProperties {
2456 // FIXME: finish
2457 linearTilingFeatures: 0,
2458 optimalTilingFeatures: 0,
2459 bufferFeatures: 0,
2460 },
2461 api::VK_FORMAT_R32G32B32A32_UINT => api::VkFormatProperties {
2462 // FIXME: finish
2463 linearTilingFeatures: 0,
2464 optimalTilingFeatures: 0,
2465 bufferFeatures: 0,
2466 },
2467 api::VK_FORMAT_R32G32B32A32_SINT => api::VkFormatProperties {
2468 // FIXME: finish
2469 linearTilingFeatures: 0,
2470 optimalTilingFeatures: 0,
2471 bufferFeatures: 0,
2472 },
2473 api::VK_FORMAT_R32G32B32A32_SFLOAT => api::VkFormatProperties {
2474 // FIXME: finish
2475 linearTilingFeatures: 0,
2476 optimalTilingFeatures: 0,
2477 bufferFeatures: 0,
2478 },
2479 api::VK_FORMAT_R64_UINT => api::VkFormatProperties {
2480 // FIXME: finish
2481 linearTilingFeatures: 0,
2482 optimalTilingFeatures: 0,
2483 bufferFeatures: 0,
2484 },
2485 api::VK_FORMAT_R64_SINT => api::VkFormatProperties {
2486 // FIXME: finish
2487 linearTilingFeatures: 0,
2488 optimalTilingFeatures: 0,
2489 bufferFeatures: 0,
2490 },
2491 api::VK_FORMAT_R64_SFLOAT => api::VkFormatProperties {
2492 // FIXME: finish
2493 linearTilingFeatures: 0,
2494 optimalTilingFeatures: 0,
2495 bufferFeatures: 0,
2496 },
2497 api::VK_FORMAT_R64G64_UINT => api::VkFormatProperties {
2498 // FIXME: finish
2499 linearTilingFeatures: 0,
2500 optimalTilingFeatures: 0,
2501 bufferFeatures: 0,
2502 },
2503 api::VK_FORMAT_R64G64_SINT => api::VkFormatProperties {
2504 // FIXME: finish
2505 linearTilingFeatures: 0,
2506 optimalTilingFeatures: 0,
2507 bufferFeatures: 0,
2508 },
2509 api::VK_FORMAT_R64G64_SFLOAT => api::VkFormatProperties {
2510 // FIXME: finish
2511 linearTilingFeatures: 0,
2512 optimalTilingFeatures: 0,
2513 bufferFeatures: 0,
2514 },
2515 api::VK_FORMAT_R64G64B64_UINT => api::VkFormatProperties {
2516 // FIXME: finish
2517 linearTilingFeatures: 0,
2518 optimalTilingFeatures: 0,
2519 bufferFeatures: 0,
2520 },
2521 api::VK_FORMAT_R64G64B64_SINT => api::VkFormatProperties {
2522 // FIXME: finish
2523 linearTilingFeatures: 0,
2524 optimalTilingFeatures: 0,
2525 bufferFeatures: 0,
2526 },
2527 api::VK_FORMAT_R64G64B64_SFLOAT => api::VkFormatProperties {
2528 // FIXME: finish
2529 linearTilingFeatures: 0,
2530 optimalTilingFeatures: 0,
2531 bufferFeatures: 0,
2532 },
2533 api::VK_FORMAT_R64G64B64A64_UINT => api::VkFormatProperties {
2534 // FIXME: finish
2535 linearTilingFeatures: 0,
2536 optimalTilingFeatures: 0,
2537 bufferFeatures: 0,
2538 },
2539 api::VK_FORMAT_R64G64B64A64_SINT => api::VkFormatProperties {
2540 // FIXME: finish
2541 linearTilingFeatures: 0,
2542 optimalTilingFeatures: 0,
2543 bufferFeatures: 0,
2544 },
2545 api::VK_FORMAT_R64G64B64A64_SFLOAT => api::VkFormatProperties {
2546 // FIXME: finish
2547 linearTilingFeatures: 0,
2548 optimalTilingFeatures: 0,
2549 bufferFeatures: 0,
2550 },
2551 api::VK_FORMAT_B10G11R11_UFLOAT_PACK32 => api::VkFormatProperties {
2552 // FIXME: finish
2553 linearTilingFeatures: 0,
2554 optimalTilingFeatures: 0,
2555 bufferFeatures: 0,
2556 },
2557 api::VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 => api::VkFormatProperties {
2558 // FIXME: finish
2559 linearTilingFeatures: 0,
2560 optimalTilingFeatures: 0,
2561 bufferFeatures: 0,
2562 },
2563 api::VK_FORMAT_D16_UNORM => api::VkFormatProperties {
2564 // FIXME: finish
2565 linearTilingFeatures: 0,
2566 optimalTilingFeatures: 0,
2567 bufferFeatures: 0,
2568 },
2569 api::VK_FORMAT_X8_D24_UNORM_PACK32 => api::VkFormatProperties {
2570 // FIXME: finish
2571 linearTilingFeatures: 0,
2572 optimalTilingFeatures: 0,
2573 bufferFeatures: 0,
2574 },
2575 api::VK_FORMAT_D32_SFLOAT => api::VkFormatProperties {
2576 // FIXME: finish
2577 linearTilingFeatures: 0,
2578 optimalTilingFeatures: 0,
2579 bufferFeatures: 0,
2580 },
2581 api::VK_FORMAT_S8_UINT => api::VkFormatProperties {
2582 // FIXME: finish
2583 linearTilingFeatures: 0,
2584 optimalTilingFeatures: 0,
2585 bufferFeatures: 0,
2586 },
2587 api::VK_FORMAT_D16_UNORM_S8_UINT => api::VkFormatProperties {
2588 // FIXME: finish
2589 linearTilingFeatures: 0,
2590 optimalTilingFeatures: 0,
2591 bufferFeatures: 0,
2592 },
2593 api::VK_FORMAT_D24_UNORM_S8_UINT => api::VkFormatProperties {
2594 // FIXME: finish
2595 linearTilingFeatures: 0,
2596 optimalTilingFeatures: 0,
2597 bufferFeatures: 0,
2598 },
2599 api::VK_FORMAT_D32_SFLOAT_S8_UINT => api::VkFormatProperties {
2600 // FIXME: finish
2601 linearTilingFeatures: 0,
2602 optimalTilingFeatures: 0,
2603 bufferFeatures: 0,
2604 },
2605 api::VK_FORMAT_BC1_RGB_UNORM_BLOCK => api::VkFormatProperties {
2606 // FIXME: finish
2607 linearTilingFeatures: 0,
2608 optimalTilingFeatures: 0,
2609 bufferFeatures: 0,
2610 },
2611 api::VK_FORMAT_BC1_RGB_SRGB_BLOCK => api::VkFormatProperties {
2612 // FIXME: finish
2613 linearTilingFeatures: 0,
2614 optimalTilingFeatures: 0,
2615 bufferFeatures: 0,
2616 },
2617 api::VK_FORMAT_BC1_RGBA_UNORM_BLOCK => api::VkFormatProperties {
2618 // FIXME: finish
2619 linearTilingFeatures: 0,
2620 optimalTilingFeatures: 0,
2621 bufferFeatures: 0,
2622 },
2623 api::VK_FORMAT_BC1_RGBA_SRGB_BLOCK => api::VkFormatProperties {
2624 // FIXME: finish
2625 linearTilingFeatures: 0,
2626 optimalTilingFeatures: 0,
2627 bufferFeatures: 0,
2628 },
2629 api::VK_FORMAT_BC2_UNORM_BLOCK => api::VkFormatProperties {
2630 // FIXME: finish
2631 linearTilingFeatures: 0,
2632 optimalTilingFeatures: 0,
2633 bufferFeatures: 0,
2634 },
2635 api::VK_FORMAT_BC2_SRGB_BLOCK => api::VkFormatProperties {
2636 // FIXME: finish
2637 linearTilingFeatures: 0,
2638 optimalTilingFeatures: 0,
2639 bufferFeatures: 0,
2640 },
2641 api::VK_FORMAT_BC3_UNORM_BLOCK => api::VkFormatProperties {
2642 // FIXME: finish
2643 linearTilingFeatures: 0,
2644 optimalTilingFeatures: 0,
2645 bufferFeatures: 0,
2646 },
2647 api::VK_FORMAT_BC3_SRGB_BLOCK => api::VkFormatProperties {
2648 // FIXME: finish
2649 linearTilingFeatures: 0,
2650 optimalTilingFeatures: 0,
2651 bufferFeatures: 0,
2652 },
2653 api::VK_FORMAT_BC4_UNORM_BLOCK => api::VkFormatProperties {
2654 // FIXME: finish
2655 linearTilingFeatures: 0,
2656 optimalTilingFeatures: 0,
2657 bufferFeatures: 0,
2658 },
2659 api::VK_FORMAT_BC4_SNORM_BLOCK => api::VkFormatProperties {
2660 // FIXME: finish
2661 linearTilingFeatures: 0,
2662 optimalTilingFeatures: 0,
2663 bufferFeatures: 0,
2664 },
2665 api::VK_FORMAT_BC5_UNORM_BLOCK => api::VkFormatProperties {
2666 // FIXME: finish
2667 linearTilingFeatures: 0,
2668 optimalTilingFeatures: 0,
2669 bufferFeatures: 0,
2670 },
2671 api::VK_FORMAT_BC5_SNORM_BLOCK => api::VkFormatProperties {
2672 // FIXME: finish
2673 linearTilingFeatures: 0,
2674 optimalTilingFeatures: 0,
2675 bufferFeatures: 0,
2676 },
2677 api::VK_FORMAT_BC6H_UFLOAT_BLOCK => api::VkFormatProperties {
2678 // FIXME: finish
2679 linearTilingFeatures: 0,
2680 optimalTilingFeatures: 0,
2681 bufferFeatures: 0,
2682 },
2683 api::VK_FORMAT_BC6H_SFLOAT_BLOCK => api::VkFormatProperties {
2684 // FIXME: finish
2685 linearTilingFeatures: 0,
2686 optimalTilingFeatures: 0,
2687 bufferFeatures: 0,
2688 },
2689 api::VK_FORMAT_BC7_UNORM_BLOCK => api::VkFormatProperties {
2690 // FIXME: finish
2691 linearTilingFeatures: 0,
2692 optimalTilingFeatures: 0,
2693 bufferFeatures: 0,
2694 },
2695 api::VK_FORMAT_BC7_SRGB_BLOCK => api::VkFormatProperties {
2696 // FIXME: finish
2697 linearTilingFeatures: 0,
2698 optimalTilingFeatures: 0,
2699 bufferFeatures: 0,
2700 },
2701 api::VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK => api::VkFormatProperties {
2702 // FIXME: finish
2703 linearTilingFeatures: 0,
2704 optimalTilingFeatures: 0,
2705 bufferFeatures: 0,
2706 },
2707 api::VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK => api::VkFormatProperties {
2708 // FIXME: finish
2709 linearTilingFeatures: 0,
2710 optimalTilingFeatures: 0,
2711 bufferFeatures: 0,
2712 },
2713 api::VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK => api::VkFormatProperties {
2714 // FIXME: finish
2715 linearTilingFeatures: 0,
2716 optimalTilingFeatures: 0,
2717 bufferFeatures: 0,
2718 },
2719 api::VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK => api::VkFormatProperties {
2720 // FIXME: finish
2721 linearTilingFeatures: 0,
2722 optimalTilingFeatures: 0,
2723 bufferFeatures: 0,
2724 },
2725 api::VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK => api::VkFormatProperties {
2726 // FIXME: finish
2727 linearTilingFeatures: 0,
2728 optimalTilingFeatures: 0,
2729 bufferFeatures: 0,
2730 },
2731 api::VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK => api::VkFormatProperties {
2732 // FIXME: finish
2733 linearTilingFeatures: 0,
2734 optimalTilingFeatures: 0,
2735 bufferFeatures: 0,
2736 },
2737 api::VK_FORMAT_EAC_R11_UNORM_BLOCK => api::VkFormatProperties {
2738 // FIXME: finish
2739 linearTilingFeatures: 0,
2740 optimalTilingFeatures: 0,
2741 bufferFeatures: 0,
2742 },
2743 api::VK_FORMAT_EAC_R11_SNORM_BLOCK => api::VkFormatProperties {
2744 // FIXME: finish
2745 linearTilingFeatures: 0,
2746 optimalTilingFeatures: 0,
2747 bufferFeatures: 0,
2748 },
2749 api::VK_FORMAT_EAC_R11G11_UNORM_BLOCK => api::VkFormatProperties {
2750 // FIXME: finish
2751 linearTilingFeatures: 0,
2752 optimalTilingFeatures: 0,
2753 bufferFeatures: 0,
2754 },
2755 api::VK_FORMAT_EAC_R11G11_SNORM_BLOCK => api::VkFormatProperties {
2756 // FIXME: finish
2757 linearTilingFeatures: 0,
2758 optimalTilingFeatures: 0,
2759 bufferFeatures: 0,
2760 },
2761 api::VK_FORMAT_ASTC_4x4_UNORM_BLOCK => api::VkFormatProperties {
2762 // FIXME: finish
2763 linearTilingFeatures: 0,
2764 optimalTilingFeatures: 0,
2765 bufferFeatures: 0,
2766 },
2767 api::VK_FORMAT_ASTC_4x4_SRGB_BLOCK => api::VkFormatProperties {
2768 // FIXME: finish
2769 linearTilingFeatures: 0,
2770 optimalTilingFeatures: 0,
2771 bufferFeatures: 0,
2772 },
2773 api::VK_FORMAT_ASTC_5x4_UNORM_BLOCK => api::VkFormatProperties {
2774 // FIXME: finish
2775 linearTilingFeatures: 0,
2776 optimalTilingFeatures: 0,
2777 bufferFeatures: 0,
2778 },
2779 api::VK_FORMAT_ASTC_5x4_SRGB_BLOCK => api::VkFormatProperties {
2780 // FIXME: finish
2781 linearTilingFeatures: 0,
2782 optimalTilingFeatures: 0,
2783 bufferFeatures: 0,
2784 },
2785 api::VK_FORMAT_ASTC_5x5_UNORM_BLOCK => api::VkFormatProperties {
2786 // FIXME: finish
2787 linearTilingFeatures: 0,
2788 optimalTilingFeatures: 0,
2789 bufferFeatures: 0,
2790 },
2791 api::VK_FORMAT_ASTC_5x5_SRGB_BLOCK => api::VkFormatProperties {
2792 // FIXME: finish
2793 linearTilingFeatures: 0,
2794 optimalTilingFeatures: 0,
2795 bufferFeatures: 0,
2796 },
2797 api::VK_FORMAT_ASTC_6x5_UNORM_BLOCK => api::VkFormatProperties {
2798 // FIXME: finish
2799 linearTilingFeatures: 0,
2800 optimalTilingFeatures: 0,
2801 bufferFeatures: 0,
2802 },
2803 api::VK_FORMAT_ASTC_6x5_SRGB_BLOCK => api::VkFormatProperties {
2804 // FIXME: finish
2805 linearTilingFeatures: 0,
2806 optimalTilingFeatures: 0,
2807 bufferFeatures: 0,
2808 },
2809 api::VK_FORMAT_ASTC_6x6_UNORM_BLOCK => api::VkFormatProperties {
2810 // FIXME: finish
2811 linearTilingFeatures: 0,
2812 optimalTilingFeatures: 0,
2813 bufferFeatures: 0,
2814 },
2815 api::VK_FORMAT_ASTC_6x6_SRGB_BLOCK => api::VkFormatProperties {
2816 // FIXME: finish
2817 linearTilingFeatures: 0,
2818 optimalTilingFeatures: 0,
2819 bufferFeatures: 0,
2820 },
2821 api::VK_FORMAT_ASTC_8x5_UNORM_BLOCK => api::VkFormatProperties {
2822 // FIXME: finish
2823 linearTilingFeatures: 0,
2824 optimalTilingFeatures: 0,
2825 bufferFeatures: 0,
2826 },
2827 api::VK_FORMAT_ASTC_8x5_SRGB_BLOCK => api::VkFormatProperties {
2828 // FIXME: finish
2829 linearTilingFeatures: 0,
2830 optimalTilingFeatures: 0,
2831 bufferFeatures: 0,
2832 },
2833 api::VK_FORMAT_ASTC_8x6_UNORM_BLOCK => api::VkFormatProperties {
2834 // FIXME: finish
2835 linearTilingFeatures: 0,
2836 optimalTilingFeatures: 0,
2837 bufferFeatures: 0,
2838 },
2839 api::VK_FORMAT_ASTC_8x6_SRGB_BLOCK => api::VkFormatProperties {
2840 // FIXME: finish
2841 linearTilingFeatures: 0,
2842 optimalTilingFeatures: 0,
2843 bufferFeatures: 0,
2844 },
2845 api::VK_FORMAT_ASTC_8x8_UNORM_BLOCK => api::VkFormatProperties {
2846 // FIXME: finish
2847 linearTilingFeatures: 0,
2848 optimalTilingFeatures: 0,
2849 bufferFeatures: 0,
2850 },
2851 api::VK_FORMAT_ASTC_8x8_SRGB_BLOCK => api::VkFormatProperties {
2852 // FIXME: finish
2853 linearTilingFeatures: 0,
2854 optimalTilingFeatures: 0,
2855 bufferFeatures: 0,
2856 },
2857 api::VK_FORMAT_ASTC_10x5_UNORM_BLOCK => api::VkFormatProperties {
2858 // FIXME: finish
2859 linearTilingFeatures: 0,
2860 optimalTilingFeatures: 0,
2861 bufferFeatures: 0,
2862 },
2863 api::VK_FORMAT_ASTC_10x5_SRGB_BLOCK => api::VkFormatProperties {
2864 // FIXME: finish
2865 linearTilingFeatures: 0,
2866 optimalTilingFeatures: 0,
2867 bufferFeatures: 0,
2868 },
2869 api::VK_FORMAT_ASTC_10x6_UNORM_BLOCK => api::VkFormatProperties {
2870 // FIXME: finish
2871 linearTilingFeatures: 0,
2872 optimalTilingFeatures: 0,
2873 bufferFeatures: 0,
2874 },
2875 api::VK_FORMAT_ASTC_10x6_SRGB_BLOCK => api::VkFormatProperties {
2876 // FIXME: finish
2877 linearTilingFeatures: 0,
2878 optimalTilingFeatures: 0,
2879 bufferFeatures: 0,
2880 },
2881 api::VK_FORMAT_ASTC_10x8_UNORM_BLOCK => api::VkFormatProperties {
2882 // FIXME: finish
2883 linearTilingFeatures: 0,
2884 optimalTilingFeatures: 0,
2885 bufferFeatures: 0,
2886 },
2887 api::VK_FORMAT_ASTC_10x8_SRGB_BLOCK => api::VkFormatProperties {
2888 // FIXME: finish
2889 linearTilingFeatures: 0,
2890 optimalTilingFeatures: 0,
2891 bufferFeatures: 0,
2892 },
2893 api::VK_FORMAT_ASTC_10x10_UNORM_BLOCK => api::VkFormatProperties {
2894 // FIXME: finish
2895 linearTilingFeatures: 0,
2896 optimalTilingFeatures: 0,
2897 bufferFeatures: 0,
2898 },
2899 api::VK_FORMAT_ASTC_10x10_SRGB_BLOCK => api::VkFormatProperties {
2900 // FIXME: finish
2901 linearTilingFeatures: 0,
2902 optimalTilingFeatures: 0,
2903 bufferFeatures: 0,
2904 },
2905 api::VK_FORMAT_ASTC_12x10_UNORM_BLOCK => api::VkFormatProperties {
2906 // FIXME: finish
2907 linearTilingFeatures: 0,
2908 optimalTilingFeatures: 0,
2909 bufferFeatures: 0,
2910 },
2911 api::VK_FORMAT_ASTC_12x10_SRGB_BLOCK => api::VkFormatProperties {
2912 // FIXME: finish
2913 linearTilingFeatures: 0,
2914 optimalTilingFeatures: 0,
2915 bufferFeatures: 0,
2916 },
2917 api::VK_FORMAT_ASTC_12x12_UNORM_BLOCK => api::VkFormatProperties {
2918 // FIXME: finish
2919 linearTilingFeatures: 0,
2920 optimalTilingFeatures: 0,
2921 bufferFeatures: 0,
2922 },
2923 api::VK_FORMAT_ASTC_12x12_SRGB_BLOCK => api::VkFormatProperties {
2924 // FIXME: finish
2925 linearTilingFeatures: 0,
2926 optimalTilingFeatures: 0,
2927 bufferFeatures: 0,
2928 },
2929 api::VK_FORMAT_G8B8G8R8_422_UNORM => api::VkFormatProperties {
2930 // FIXME: finish
2931 linearTilingFeatures: 0,
2932 optimalTilingFeatures: 0,
2933 bufferFeatures: 0,
2934 },
2935 api::VK_FORMAT_B8G8R8G8_422_UNORM => api::VkFormatProperties {
2936 // FIXME: finish
2937 linearTilingFeatures: 0,
2938 optimalTilingFeatures: 0,
2939 bufferFeatures: 0,
2940 },
2941 api::VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM => api::VkFormatProperties {
2942 // FIXME: finish
2943 linearTilingFeatures: 0,
2944 optimalTilingFeatures: 0,
2945 bufferFeatures: 0,
2946 },
2947 api::VK_FORMAT_G8_B8R8_2PLANE_420_UNORM => api::VkFormatProperties {
2948 // FIXME: finish
2949 linearTilingFeatures: 0,
2950 optimalTilingFeatures: 0,
2951 bufferFeatures: 0,
2952 },
2953 api::VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM => api::VkFormatProperties {
2954 // FIXME: finish
2955 linearTilingFeatures: 0,
2956 optimalTilingFeatures: 0,
2957 bufferFeatures: 0,
2958 },
2959 api::VK_FORMAT_G8_B8R8_2PLANE_422_UNORM => api::VkFormatProperties {
2960 // FIXME: finish
2961 linearTilingFeatures: 0,
2962 optimalTilingFeatures: 0,
2963 bufferFeatures: 0,
2964 },
2965 api::VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM => api::VkFormatProperties {
2966 // FIXME: finish
2967 linearTilingFeatures: 0,
2968 optimalTilingFeatures: 0,
2969 bufferFeatures: 0,
2970 },
2971 api::VK_FORMAT_R10X6_UNORM_PACK16 => api::VkFormatProperties {
2972 // FIXME: finish
2973 linearTilingFeatures: 0,
2974 optimalTilingFeatures: 0,
2975 bufferFeatures: 0,
2976 },
2977 api::VK_FORMAT_R10X6G10X6_UNORM_2PACK16 => api::VkFormatProperties {
2978 // FIXME: finish
2979 linearTilingFeatures: 0,
2980 optimalTilingFeatures: 0,
2981 bufferFeatures: 0,
2982 },
2983 api::VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 => api::VkFormatProperties {
2984 // FIXME: finish
2985 linearTilingFeatures: 0,
2986 optimalTilingFeatures: 0,
2987 bufferFeatures: 0,
2988 },
2989 api::VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 => api::VkFormatProperties {
2990 // FIXME: finish
2991 linearTilingFeatures: 0,
2992 optimalTilingFeatures: 0,
2993 bufferFeatures: 0,
2994 },
2995 api::VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 => api::VkFormatProperties {
2996 // FIXME: finish
2997 linearTilingFeatures: 0,
2998 optimalTilingFeatures: 0,
2999 bufferFeatures: 0,
3000 },
3001 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
3002 // FIXME: finish
3003 linearTilingFeatures: 0,
3004 optimalTilingFeatures: 0,
3005 bufferFeatures: 0,
3006 },
3007 api::VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
3008 // FIXME: finish
3009 linearTilingFeatures: 0,
3010 optimalTilingFeatures: 0,
3011 bufferFeatures: 0,
3012 },
3013 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
3014 // FIXME: finish
3015 linearTilingFeatures: 0,
3016 optimalTilingFeatures: 0,
3017 bufferFeatures: 0,
3018 },
3019 api::VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
3020 // FIXME: finish
3021 linearTilingFeatures: 0,
3022 optimalTilingFeatures: 0,
3023 bufferFeatures: 0,
3024 },
3025 api::VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 => api::VkFormatProperties {
3026 // FIXME: finish
3027 linearTilingFeatures: 0,
3028 optimalTilingFeatures: 0,
3029 bufferFeatures: 0,
3030 },
3031 api::VK_FORMAT_R12X4_UNORM_PACK16 => api::VkFormatProperties {
3032 // FIXME: finish
3033 linearTilingFeatures: 0,
3034 optimalTilingFeatures: 0,
3035 bufferFeatures: 0,
3036 },
3037 api::VK_FORMAT_R12X4G12X4_UNORM_2PACK16 => api::VkFormatProperties {
3038 // FIXME: finish
3039 linearTilingFeatures: 0,
3040 optimalTilingFeatures: 0,
3041 bufferFeatures: 0,
3042 },
3043 api::VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 => api::VkFormatProperties {
3044 // FIXME: finish
3045 linearTilingFeatures: 0,
3046 optimalTilingFeatures: 0,
3047 bufferFeatures: 0,
3048 },
3049 api::VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 => api::VkFormatProperties {
3050 // FIXME: finish
3051 linearTilingFeatures: 0,
3052 optimalTilingFeatures: 0,
3053 bufferFeatures: 0,
3054 },
3055 api::VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 => api::VkFormatProperties {
3056 // FIXME: finish
3057 linearTilingFeatures: 0,
3058 optimalTilingFeatures: 0,
3059 bufferFeatures: 0,
3060 },
3061 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
3062 // FIXME: finish
3063 linearTilingFeatures: 0,
3064 optimalTilingFeatures: 0,
3065 bufferFeatures: 0,
3066 },
3067 api::VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 => api::VkFormatProperties {
3068 // FIXME: finish
3069 linearTilingFeatures: 0,
3070 optimalTilingFeatures: 0,
3071 bufferFeatures: 0,
3072 },
3073 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
3074 // FIXME: finish
3075 linearTilingFeatures: 0,
3076 optimalTilingFeatures: 0,
3077 bufferFeatures: 0,
3078 },
3079 api::VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 => api::VkFormatProperties {
3080 // FIXME: finish
3081 linearTilingFeatures: 0,
3082 optimalTilingFeatures: 0,
3083 bufferFeatures: 0,
3084 },
3085 api::VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 => api::VkFormatProperties {
3086 // FIXME: finish
3087 linearTilingFeatures: 0,
3088 optimalTilingFeatures: 0,
3089 bufferFeatures: 0,
3090 },
3091 api::VK_FORMAT_G16B16G16R16_422_UNORM => api::VkFormatProperties {
3092 // FIXME: finish
3093 linearTilingFeatures: 0,
3094 optimalTilingFeatures: 0,
3095 bufferFeatures: 0,
3096 },
3097 api::VK_FORMAT_B16G16R16G16_422_UNORM => api::VkFormatProperties {
3098 // FIXME: finish
3099 linearTilingFeatures: 0,
3100 optimalTilingFeatures: 0,
3101 bufferFeatures: 0,
3102 },
3103 api::VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM => api::VkFormatProperties {
3104 // FIXME: finish
3105 linearTilingFeatures: 0,
3106 optimalTilingFeatures: 0,
3107 bufferFeatures: 0,
3108 },
3109 api::VK_FORMAT_G16_B16R16_2PLANE_420_UNORM => api::VkFormatProperties {
3110 // FIXME: finish
3111 linearTilingFeatures: 0,
3112 optimalTilingFeatures: 0,
3113 bufferFeatures: 0,
3114 },
3115 api::VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM => api::VkFormatProperties {
3116 // FIXME: finish
3117 linearTilingFeatures: 0,
3118 optimalTilingFeatures: 0,
3119 bufferFeatures: 0,
3120 },
3121 api::VK_FORMAT_G16_B16R16_2PLANE_422_UNORM => api::VkFormatProperties {
3122 // FIXME: finish
3123 linearTilingFeatures: 0,
3124 optimalTilingFeatures: 0,
3125 bufferFeatures: 0,
3126 },
3127 api::VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM => api::VkFormatProperties {
3128 // FIXME: finish
3129 linearTilingFeatures: 0,
3130 optimalTilingFeatures: 0,
3131 bufferFeatures: 0,
3132 },
3133 _ => panic!("unknown format {}", format),
3134 }
3135 }
3136 }
3137
3138 pub struct Instance {
3139 physical_device: OwnedHandle<api::VkPhysicalDevice>,
3140 }
3141
3142 impl Instance {
3143 pub unsafe fn new(
3144 create_info: *const api::VkInstanceCreateInfo,
3145 ) -> Result<api::VkInstance, api::VkResult> {
3146 parse_next_chain_const!{
3147 create_info,
3148 root = api::VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
3149 }
3150 let ref create_info = *create_info;
3151 if create_info.enabledLayerCount != 0 {
3152 return Err(api::VK_ERROR_LAYER_NOT_PRESENT);
3153 }
3154 let mut enabled_extensions = Extensions::create_empty();
3155 if create_info.enabledExtensionCount != 0 {
3156 for &extension_name in slice::from_raw_parts(
3157 create_info.ppEnabledExtensionNames,
3158 create_info.enabledExtensionCount as usize,
3159 ) {
3160 let extension: Extension = CStr::from_ptr(extension_name)
3161 .to_str()
3162 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?
3163 .parse()
3164 .map_err(|_| api::VK_ERROR_EXTENSION_NOT_PRESENT)?;
3165 assert_eq!(extension.get_scope(), ExtensionScope::Instance);
3166 enabled_extensions[extension] = true;
3167 }
3168 }
3169 for extension in enabled_extensions
3170 .iter()
3171 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
3172 {
3173 let missing_extensions = extension.get_required_extensions() & !enabled_extensions;
3174 for missing_extension in missing_extensions
3175 .iter()
3176 .filter_map(|(extension, &enabled)| if enabled { Some(extension) } else { None })
3177 {
3178 panic!(
3179 "extension {} enabled but required extension {} is not enabled",
3180 extension.get_name(),
3181 missing_extension.get_name()
3182 );
3183 }
3184 }
3185 let system_memory_size;
3186 match sys_info::mem_info() {
3187 Err(error) => {
3188 eprintln!("mem_info error: {}", error);
3189 return Err(api::VK_ERROR_INITIALIZATION_FAILED);
3190 }
3191 Ok(info) => system_memory_size = info.total * 1024,
3192 }
3193 let mut device_name = [0; api::VK_MAX_PHYSICAL_DEVICE_NAME_SIZE as usize];
3194 copy_str_to_char_array(&mut device_name, KAZAN_DEVICE_NAME);
3195 let retval = OwnedHandle::<api::VkInstance>::new(Instance {
3196 physical_device: OwnedHandle::new(PhysicalDevice {
3197 enabled_extensions,
3198 allowed_extensions: enabled_extensions.get_allowed_extensions_from_instance_scope(),
3199 properties: api::VkPhysicalDeviceProperties {
3200 apiVersion: make_api_version(1, 1, api::VK_HEADER_VERSION),
3201 driverVersion: make_api_version(
3202 env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(),
3203 env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(),
3204 env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(),
3205 ),
3206 vendorID: api::VK_VENDOR_ID_KAZAN,
3207 deviceID: 1,
3208 deviceType: api::VK_PHYSICAL_DEVICE_TYPE_CPU,
3209 deviceName: device_name,
3210 pipelineCacheUUID: *PhysicalDevice::get_pipeline_cache_uuid().as_bytes(),
3211 limits: PhysicalDevice::get_limits(),
3212 sparseProperties: api::VkPhysicalDeviceSparseProperties {
3213 residencyStandard2DBlockShape: api::VK_FALSE,
3214 residencyStandard2DMultisampleBlockShape: api::VK_FALSE,
3215 residencyStandard3DBlockShape: api::VK_FALSE,
3216 residencyAlignedMipSize: api::VK_FALSE,
3217 residencyNonResidentStrict: api::VK_FALSE,
3218 },
3219 },
3220 features: Features::new(),
3221 system_memory_size,
3222 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties {
3223 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES,
3224 pNext: null_mut(),
3225 pointClippingBehavior: api::VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES,
3226 },
3227 multiview_properties: api::VkPhysicalDeviceMultiviewProperties {
3228 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
3229 pNext: null_mut(),
3230 maxMultiviewViewCount: 6,
3231 maxMultiviewInstanceIndex: !0,
3232 },
3233 id_properties: api::VkPhysicalDeviceIDProperties {
3234 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES,
3235 pNext: null_mut(),
3236 deviceUUID: *PhysicalDevice::get_device_uuid().as_bytes(),
3237 driverUUID: *PhysicalDevice::get_driver_uuid().as_bytes(),
3238 deviceLUID: [0; api::VK_LUID_SIZE as usize],
3239 deviceNodeMask: 1,
3240 deviceLUIDValid: api::VK_FALSE,
3241 },
3242 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties {
3243 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
3244 pNext: null_mut(),
3245 maxPerSetDescriptors: !0,
3246 maxMemoryAllocationSize: isize::max_value() as u64,
3247 },
3248 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties {
3249 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES,
3250 pNext: null_mut(),
3251 protectedNoFault: api::VK_FALSE,
3252 },
3253 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties {
3254 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES,
3255 pNext: null_mut(),
3256 subgroupSize: 1, // FIXME fill in correct value
3257 supportedStages: api::VK_SHADER_STAGE_COMPUTE_BIT,
3258 supportedOperations: api::VK_SUBGROUP_FEATURE_BASIC_BIT,
3259 quadOperationsInAllStages: api::VK_FALSE,
3260 },
3261 }),
3262 });
3263 Ok(retval.take())
3264 }
3265 }
3266
3267 #[allow(non_snake_case)]
3268 pub unsafe extern "system" fn vkGetInstanceProcAddr(
3269 instance: api::VkInstance,
3270 name: *const c_char,
3271 ) -> api::PFN_vkVoidFunction {
3272 match instance.get() {
3273 Some(_) => get_proc_address(
3274 name,
3275 GetProcAddressScope::Instance,
3276 &SharedHandle::from(instance)
3277 .unwrap()
3278 .physical_device
3279 .allowed_extensions,
3280 ),
3281 None => get_proc_address(
3282 name,
3283 GetProcAddressScope::Global,
3284 &Extensions::create_empty(),
3285 ),
3286 }
3287 }
3288
3289 pub fn make_api_version(major: u32, minor: u32, patch: u32) -> u32 {
3290 assert!(major < (1 << 10));
3291 assert!(minor < (1 << 10));
3292 assert!(patch < (1 << 12));
3293 (major << 22) | (minor << 12) | patch
3294 }
3295
3296 #[allow(non_snake_case)]
3297 pub unsafe extern "system" fn vkEnumerateInstanceVersion(api_version: *mut u32) -> api::VkResult {
3298 *api_version = make_api_version(1, 1, api::VK_HEADER_VERSION);
3299 api::VK_SUCCESS
3300 }
3301
3302 pub unsafe fn enumerate_helper<T, Item, I: IntoIterator<Item = Item>, AF: FnMut(&mut T, Item)>(
3303 api_value_count: *mut u32,
3304 api_values: *mut T,
3305 values: I,
3306 mut assign_function: AF,
3307 ) -> api::VkResult {
3308 let mut retval = api::VK_SUCCESS;
3309 let mut api_values = if api_values.is_null() {
3310 None
3311 } else {
3312 Some(slice::from_raw_parts_mut(
3313 api_values,
3314 *api_value_count as usize,
3315 ))
3316 };
3317 let mut final_count = 0;
3318 for value in values {
3319 if let Some(api_values) = &mut api_values {
3320 if final_count >= api_values.len() {
3321 retval = api::VK_INCOMPLETE;
3322 break;
3323 } else {
3324 assign_function(&mut api_values[final_count], value);
3325 final_count += 1;
3326 }
3327 } else {
3328 final_count += 1;
3329 }
3330 }
3331 assert_eq!(final_count as u32 as usize, final_count);
3332 *api_value_count = final_count as u32;
3333 retval
3334 }
3335
3336 #[allow(non_snake_case)]
3337 pub unsafe extern "system" fn vkEnumerateInstanceLayerProperties(
3338 property_count: *mut u32,
3339 properties: *mut api::VkLayerProperties,
3340 ) -> api::VkResult {
3341 enumerate_helper(property_count, properties, &[], |l, r| *l = *r)
3342 }
3343
3344 #[allow(non_snake_case)]
3345 pub unsafe extern "system" fn vkEnumerateInstanceExtensionProperties(
3346 layer_name: *const c_char,
3347 property_count: *mut u32,
3348 properties: *mut api::VkExtensionProperties,
3349 ) -> api::VkResult {
3350 enumerate_extension_properties(
3351 layer_name,
3352 property_count,
3353 properties,
3354 ExtensionScope::Instance,
3355 )
3356 }
3357
3358 #[allow(non_snake_case)]
3359 pub unsafe extern "system" fn vkCreateInstance(
3360 create_info: *const api::VkInstanceCreateInfo,
3361 _allocator: *const api::VkAllocationCallbacks,
3362 instance: *mut api::VkInstance,
3363 ) -> api::VkResult {
3364 *instance = Handle::null();
3365 match Instance::new(create_info) {
3366 Ok(v) => {
3367 *instance = v;
3368 api::VK_SUCCESS
3369 }
3370 Err(error) => error,
3371 }
3372 }
3373
3374 #[allow(non_snake_case)]
3375 pub unsafe extern "system" fn vkDestroyInstance(
3376 instance: api::VkInstance,
3377 _allocator: *const api::VkAllocationCallbacks,
3378 ) {
3379 if !instance.is_null() {
3380 OwnedHandle::from(instance);
3381 }
3382 }
3383
3384 #[allow(non_snake_case)]
3385 pub unsafe extern "system" fn vkEnumeratePhysicalDevices(
3386 instance: api::VkInstance,
3387 physical_device_count: *mut u32,
3388 physical_devices: *mut api::VkPhysicalDevice,
3389 ) -> api::VkResult {
3390 let instance = SharedHandle::from(instance).unwrap();
3391 enumerate_helper(
3392 physical_device_count,
3393 physical_devices,
3394 iter::once(instance.physical_device.get_handle()),
3395 |l, r| *l = r,
3396 )
3397 }
3398
3399 #[allow(non_snake_case)]
3400 pub unsafe extern "system" fn vkGetPhysicalDeviceFeatures(
3401 physical_device: api::VkPhysicalDevice,
3402 features: *mut api::VkPhysicalDeviceFeatures,
3403 ) {
3404 let mut v = api::VkPhysicalDeviceFeatures2 {
3405 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
3406 pNext: null_mut(),
3407 features: mem::zeroed(),
3408 };
3409 vkGetPhysicalDeviceFeatures2(physical_device, &mut v);
3410 *features = v.features;
3411 }
3412
3413 #[allow(non_snake_case)]
3414 pub unsafe extern "system" fn vkGetPhysicalDeviceFormatProperties(
3415 physical_device: api::VkPhysicalDevice,
3416 format: api::VkFormat,
3417 format_properties: *mut api::VkFormatProperties,
3418 ) {
3419 let mut format_properties2 = api::VkFormatProperties2 {
3420 sType: api::VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
3421 pNext: null_mut(),
3422 formatProperties: mem::zeroed(),
3423 };
3424 vkGetPhysicalDeviceFormatProperties2(physical_device, format, &mut format_properties2);
3425 *format_properties = format_properties2.formatProperties;
3426 }
3427
3428 #[allow(non_snake_case)]
3429 pub unsafe extern "system" fn vkGetPhysicalDeviceImageFormatProperties(
3430 _physicalDevice: api::VkPhysicalDevice,
3431 _format: api::VkFormat,
3432 _type_: api::VkImageType,
3433 _tiling: api::VkImageTiling,
3434 _usage: api::VkImageUsageFlags,
3435 _flags: api::VkImageCreateFlags,
3436 _pImageFormatProperties: *mut api::VkImageFormatProperties,
3437 ) -> api::VkResult {
3438 unimplemented!()
3439 }
3440
3441 #[allow(non_snake_case)]
3442 pub unsafe extern "system" fn vkGetPhysicalDeviceProperties(
3443 physical_device: api::VkPhysicalDevice,
3444 properties: *mut api::VkPhysicalDeviceProperties,
3445 ) {
3446 let physical_device = SharedHandle::from(physical_device).unwrap();
3447 *properties = physical_device.properties;
3448 }
3449
3450 unsafe fn get_physical_device_queue_family_properties(
3451 _physical_device: SharedHandle<api::VkPhysicalDevice>,
3452 queue_family_properties: &mut api::VkQueueFamilyProperties2,
3453 queue_count: u32,
3454 ) {
3455 parse_next_chain_mut!{
3456 queue_family_properties as *mut api::VkQueueFamilyProperties2,
3457 root = api::VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2,
3458 }
3459 queue_family_properties.queueFamilyProperties = api::VkQueueFamilyProperties {
3460 queueFlags: api::VK_QUEUE_GRAPHICS_BIT
3461 | api::VK_QUEUE_COMPUTE_BIT
3462 | api::VK_QUEUE_TRANSFER_BIT,
3463 queueCount: queue_count,
3464 timestampValidBits: 0,
3465 minImageTransferGranularity: api::VkExtent3D {
3466 width: 1,
3467 height: 1,
3468 depth: 1,
3469 },
3470 };
3471 }
3472
3473 #[allow(non_snake_case)]
3474 pub unsafe extern "system" fn vkGetPhysicalDeviceQueueFamilyProperties(
3475 physical_device: api::VkPhysicalDevice,
3476 queue_family_property_count: *mut u32,
3477 queue_family_properties: *mut api::VkQueueFamilyProperties,
3478 ) {
3479 enumerate_helper(
3480 queue_family_property_count,
3481 queue_family_properties,
3482 QUEUE_COUNTS.iter(),
3483 |queue_family_properties, &count| {
3484 let mut queue_family_properties2 = api::VkQueueFamilyProperties2 {
3485 sType: api::VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2,
3486 pNext: null_mut(),
3487 queueFamilyProperties: mem::zeroed(),
3488 };
3489 get_physical_device_queue_family_properties(
3490 SharedHandle::from(physical_device).unwrap(),
3491 &mut queue_family_properties2,
3492 count,
3493 );
3494 *queue_family_properties = queue_family_properties2.queueFamilyProperties;
3495 },
3496 );
3497 }
3498
3499 #[allow(non_snake_case)]
3500 pub unsafe extern "system" fn vkGetPhysicalDeviceMemoryProperties(
3501 physical_device: api::VkPhysicalDevice,
3502 memory_properties: *mut api::VkPhysicalDeviceMemoryProperties,
3503 ) {
3504 let mut memory_properties2 = api::VkPhysicalDeviceMemoryProperties2 {
3505 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
3506 pNext: null_mut(),
3507 memoryProperties: mem::zeroed(),
3508 };
3509 vkGetPhysicalDeviceMemoryProperties2(physical_device, &mut memory_properties2);
3510 *memory_properties = memory_properties2.memoryProperties;
3511 }
3512
3513 #[allow(non_snake_case)]
3514 pub unsafe extern "system" fn vkGetDeviceProcAddr(
3515 device: api::VkDevice,
3516 name: *const c_char,
3517 ) -> api::PFN_vkVoidFunction {
3518 get_proc_address(
3519 name,
3520 GetProcAddressScope::Device,
3521 &SharedHandle::from(device).unwrap().extensions,
3522 )
3523 }
3524
3525 #[allow(non_snake_case)]
3526 pub unsafe extern "system" fn vkCreateDevice(
3527 physical_device: api::VkPhysicalDevice,
3528 create_info: *const api::VkDeviceCreateInfo,
3529 _allocator: *const api::VkAllocationCallbacks,
3530 device: *mut api::VkDevice,
3531 ) -> api::VkResult {
3532 *device = Handle::null();
3533 match Device::new(SharedHandle::from(physical_device).unwrap(), create_info) {
3534 Ok(v) => {
3535 *device = v.take();
3536 api::VK_SUCCESS
3537 }
3538 Err(error) => error,
3539 }
3540 }
3541
3542 #[allow(non_snake_case)]
3543 pub unsafe extern "system" fn vkDestroyDevice(
3544 device: api::VkDevice,
3545 _allocator: *const api::VkAllocationCallbacks,
3546 ) {
3547 if !device.is_null() {
3548 OwnedHandle::from(device);
3549 }
3550 }
3551
3552 unsafe fn enumerate_extension_properties(
3553 layer_name: *const c_char,
3554 property_count: *mut u32,
3555 properties: *mut api::VkExtensionProperties,
3556 extension_scope: ExtensionScope,
3557 ) -> api::VkResult {
3558 if !layer_name.is_null() {
3559 return api::VK_ERROR_LAYER_NOT_PRESENT;
3560 }
3561 enumerate_helper(
3562 property_count,
3563 properties,
3564 Extensions::default().iter().filter_map(
3565 |(extension, _): (Extension, _)| -> Option<api::VkExtensionProperties> {
3566 if extension.get_scope() == extension_scope {
3567 Some(extension.get_properties())
3568 } else {
3569 None
3570 }
3571 },
3572 ),
3573 |l, r| *l = r,
3574 )
3575 }
3576
3577 #[allow(non_snake_case)]
3578 pub unsafe extern "system" fn vkEnumerateDeviceExtensionProperties(
3579 _physical_device: api::VkPhysicalDevice,
3580 layer_name: *const c_char,
3581 property_count: *mut u32,
3582 properties: *mut api::VkExtensionProperties,
3583 ) -> api::VkResult {
3584 enumerate_extension_properties(
3585 layer_name,
3586 property_count,
3587 properties,
3588 ExtensionScope::Device,
3589 )
3590 }
3591
3592 #[allow(non_snake_case)]
3593 pub unsafe extern "system" fn vkEnumerateDeviceLayerProperties(
3594 _physicalDevice: api::VkPhysicalDevice,
3595 _pPropertyCount: *mut u32,
3596 _pProperties: *mut api::VkLayerProperties,
3597 ) -> api::VkResult {
3598 unimplemented!()
3599 }
3600
3601 #[allow(non_snake_case)]
3602 pub unsafe extern "system" fn vkGetDeviceQueue(
3603 device: api::VkDevice,
3604 queue_family_index: u32,
3605 queue_index: u32,
3606 queue: *mut api::VkQueue,
3607 ) {
3608 vkGetDeviceQueue2(
3609 device,
3610 &api::VkDeviceQueueInfo2 {
3611 sType: api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
3612 pNext: null(),
3613 flags: 0,
3614 queueFamilyIndex: queue_family_index,
3615 queueIndex: queue_index,
3616 },
3617 queue,
3618 );
3619 }
3620
3621 #[allow(non_snake_case)]
3622 pub unsafe extern "system" fn vkQueueSubmit(
3623 _queue: api::VkQueue,
3624 _submitCount: u32,
3625 _pSubmits: *const api::VkSubmitInfo,
3626 _fence: api::VkFence,
3627 ) -> api::VkResult {
3628 unimplemented!()
3629 }
3630
3631 #[allow(non_snake_case)]
3632 pub unsafe extern "system" fn vkQueueWaitIdle(_queue: api::VkQueue) -> api::VkResult {
3633 unimplemented!()
3634 }
3635
3636 #[allow(non_snake_case)]
3637 pub unsafe extern "system" fn vkDeviceWaitIdle(_device: api::VkDevice) -> api::VkResult {
3638 unimplemented!()
3639 }
3640
3641 #[allow(non_snake_case)]
3642 pub unsafe extern "system" fn vkAllocateMemory(
3643 _device: api::VkDevice,
3644 allocate_info: *const api::VkMemoryAllocateInfo,
3645 _allocator: *const api::VkAllocationCallbacks,
3646 memory: *mut api::VkDeviceMemory,
3647 ) -> api::VkResult {
3648 parse_next_chain_const!{
3649 allocate_info,
3650 root = api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
3651 export_memory_allocate_info: api::VkExportMemoryAllocateInfo = api::VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
3652 memory_allocate_flags_info: api::VkMemoryAllocateFlagsInfo = api::VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO,
3653 memory_dedicated_allocate_info: api::VkMemoryDedicatedAllocateInfo = api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
3654 }
3655 let ref allocate_info = *allocate_info;
3656 if !export_memory_allocate_info.is_null() {
3657 unimplemented!()
3658 }
3659 if !memory_allocate_flags_info.is_null() {
3660 unimplemented!()
3661 }
3662 if !memory_dedicated_allocate_info.is_null() {
3663 unimplemented!()
3664 }
3665 match DeviceMemoryType::from_index(allocate_info.memoryTypeIndex).unwrap() {
3666 DeviceMemoryType::Main => {
3667 if allocate_info.allocationSize > isize::max_value() as u64 {
3668 return api::VK_ERROR_OUT_OF_DEVICE_MEMORY;
3669 }
3670 match DeviceMemory::allocate_from_default_heap(DeviceMemoryLayout::calculate(
3671 allocate_info.allocationSize as usize,
3672 MIN_MEMORY_MAP_ALIGNMENT,
3673 )) {
3674 Ok(new_memory) => {
3675 *memory = OwnedHandle::<api::VkDeviceMemory>::new(new_memory).take();
3676 api::VK_SUCCESS
3677 }
3678 Err(_) => api::VK_ERROR_OUT_OF_DEVICE_MEMORY,
3679 }
3680 }
3681 }
3682 }
3683
3684 #[allow(non_snake_case)]
3685 pub unsafe extern "system" fn vkFreeMemory(
3686 _device: api::VkDevice,
3687 memory: api::VkDeviceMemory,
3688 _allocator: *const api::VkAllocationCallbacks,
3689 ) {
3690 if !memory.is_null() {
3691 OwnedHandle::from(memory);
3692 }
3693 }
3694
3695 #[allow(non_snake_case)]
3696 pub unsafe extern "system" fn vkMapMemory(
3697 _device: api::VkDevice,
3698 memory: api::VkDeviceMemory,
3699 offset: api::VkDeviceSize,
3700 size: api::VkDeviceSize,
3701 flags: api::VkMemoryMapFlags,
3702 data: *mut *mut c_void,
3703 ) -> api::VkResult {
3704 let memory = SharedHandle::from(memory).unwrap();
3705 // remember to keep vkUnmapMemory up to date
3706 *data = memory.get().as_ptr().offset(offset as isize) as *mut c_void;
3707 api::VK_SUCCESS
3708 }
3709
3710 #[allow(non_snake_case)]
3711 pub unsafe extern "system" fn vkUnmapMemory(_device: api::VkDevice, _memory: api::VkDeviceMemory) {}
3712
3713 #[allow(non_snake_case)]
3714 pub unsafe extern "system" fn vkFlushMappedMemoryRanges(
3715 _device: api::VkDevice,
3716 _memoryRangeCount: u32,
3717 _pMemoryRanges: *const api::VkMappedMemoryRange,
3718 ) -> api::VkResult {
3719 unimplemented!()
3720 }
3721
3722 #[allow(non_snake_case)]
3723 pub unsafe extern "system" fn vkInvalidateMappedMemoryRanges(
3724 _device: api::VkDevice,
3725 _memoryRangeCount: u32,
3726 _pMemoryRanges: *const api::VkMappedMemoryRange,
3727 ) -> api::VkResult {
3728 unimplemented!()
3729 }
3730
3731 #[allow(non_snake_case)]
3732 pub unsafe extern "system" fn vkGetDeviceMemoryCommitment(
3733 _device: api::VkDevice,
3734 _memory: api::VkDeviceMemory,
3735 _pCommittedMemoryInBytes: *mut api::VkDeviceSize,
3736 ) {
3737 unimplemented!()
3738 }
3739
3740 #[allow(non_snake_case)]
3741 pub unsafe extern "system" fn vkBindBufferMemory(
3742 device: api::VkDevice,
3743 buffer: api::VkBuffer,
3744 memory: api::VkDeviceMemory,
3745 memory_offset: api::VkDeviceSize,
3746 ) -> api::VkResult {
3747 vkBindBufferMemory2(
3748 device,
3749 1,
3750 &api::VkBindBufferMemoryInfo {
3751 sType: api::VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
3752 pNext: null(),
3753 buffer,
3754 memory,
3755 memoryOffset: memory_offset,
3756 },
3757 )
3758 }
3759
3760 #[allow(non_snake_case)]
3761 pub unsafe extern "system" fn vkBindImageMemory(
3762 _device: api::VkDevice,
3763 _image: api::VkImage,
3764 _memory: api::VkDeviceMemory,
3765 _memoryOffset: api::VkDeviceSize,
3766 ) -> api::VkResult {
3767 unimplemented!()
3768 }
3769
3770 #[allow(non_snake_case)]
3771 pub unsafe extern "system" fn vkGetBufferMemoryRequirements(
3772 device: api::VkDevice,
3773 buffer: api::VkBuffer,
3774 memory_requirements: *mut api::VkMemoryRequirements,
3775 ) {
3776 let mut memory_requirements_2 = api::VkMemoryRequirements2 {
3777 sType: api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
3778 pNext: null_mut(),
3779 memoryRequirements: mem::zeroed(),
3780 };
3781 vkGetBufferMemoryRequirements2(
3782 device,
3783 &api::VkBufferMemoryRequirementsInfo2 {
3784 sType: api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
3785 pNext: null(),
3786 buffer,
3787 },
3788 &mut memory_requirements_2,
3789 );
3790 *memory_requirements = memory_requirements_2.memoryRequirements;
3791 }
3792
3793 #[allow(non_snake_case)]
3794 pub unsafe extern "system" fn vkGetImageMemoryRequirements(
3795 _device: api::VkDevice,
3796 _image: api::VkImage,
3797 _pMemoryRequirements: *mut api::VkMemoryRequirements,
3798 ) {
3799 unimplemented!()
3800 }
3801
3802 #[allow(non_snake_case)]
3803 pub unsafe extern "system" fn vkGetImageSparseMemoryRequirements(
3804 _device: api::VkDevice,
3805 _image: api::VkImage,
3806 _pSparseMemoryRequirementCount: *mut u32,
3807 _pSparseMemoryRequirements: *mut api::VkSparseImageMemoryRequirements,
3808 ) {
3809 unimplemented!()
3810 }
3811
3812 #[allow(non_snake_case)]
3813 pub unsafe extern "system" fn vkGetPhysicalDeviceSparseImageFormatProperties(
3814 _physicalDevice: api::VkPhysicalDevice,
3815 _format: api::VkFormat,
3816 _type_: api::VkImageType,
3817 _samples: api::VkSampleCountFlagBits,
3818 _usage: api::VkImageUsageFlags,
3819 _tiling: api::VkImageTiling,
3820 _pPropertyCount: *mut u32,
3821 _pProperties: *mut api::VkSparseImageFormatProperties,
3822 ) {
3823 unimplemented!()
3824 }
3825
3826 #[allow(non_snake_case)]
3827 pub unsafe extern "system" fn vkQueueBindSparse(
3828 _queue: api::VkQueue,
3829 _bindInfoCount: u32,
3830 _pBindInfo: *const api::VkBindSparseInfo,
3831 _fence: api::VkFence,
3832 ) -> api::VkResult {
3833 unimplemented!()
3834 }
3835
3836 #[allow(non_snake_case)]
3837 pub unsafe extern "system" fn vkCreateFence(
3838 _device: api::VkDevice,
3839 _pCreateInfo: *const api::VkFenceCreateInfo,
3840 _pAllocator: *const api::VkAllocationCallbacks,
3841 _pFence: *mut api::VkFence,
3842 ) -> api::VkResult {
3843 unimplemented!()
3844 }
3845
3846 #[allow(non_snake_case)]
3847 pub unsafe extern "system" fn vkDestroyFence(
3848 _device: api::VkDevice,
3849 _fence: api::VkFence,
3850 _pAllocator: *const api::VkAllocationCallbacks,
3851 ) {
3852 unimplemented!()
3853 }
3854
3855 #[allow(non_snake_case)]
3856 pub unsafe extern "system" fn vkResetFences(
3857 _device: api::VkDevice,
3858 _fenceCount: u32,
3859 _pFences: *const api::VkFence,
3860 ) -> api::VkResult {
3861 unimplemented!()
3862 }
3863
3864 #[allow(non_snake_case)]
3865 pub unsafe extern "system" fn vkGetFenceStatus(
3866 _device: api::VkDevice,
3867 _fence: api::VkFence,
3868 ) -> api::VkResult {
3869 unimplemented!()
3870 }
3871
3872 #[allow(non_snake_case)]
3873 pub unsafe extern "system" fn vkWaitForFences(
3874 _device: api::VkDevice,
3875 _fenceCount: u32,
3876 _pFences: *const api::VkFence,
3877 _waitAll: api::VkBool32,
3878 _timeout: u64,
3879 ) -> api::VkResult {
3880 unimplemented!()
3881 }
3882
3883 #[allow(non_snake_case)]
3884 pub unsafe extern "system" fn vkCreateSemaphore(
3885 _device: api::VkDevice,
3886 _pCreateInfo: *const api::VkSemaphoreCreateInfo,
3887 _pAllocator: *const api::VkAllocationCallbacks,
3888 _pSemaphore: *mut api::VkSemaphore,
3889 ) -> api::VkResult {
3890 unimplemented!()
3891 }
3892
3893 #[allow(non_snake_case)]
3894 pub unsafe extern "system" fn vkDestroySemaphore(
3895 _device: api::VkDevice,
3896 _semaphore: api::VkSemaphore,
3897 _pAllocator: *const api::VkAllocationCallbacks,
3898 ) {
3899 unimplemented!()
3900 }
3901
3902 #[allow(non_snake_case)]
3903 pub unsafe extern "system" fn vkCreateEvent(
3904 _device: api::VkDevice,
3905 _pCreateInfo: *const api::VkEventCreateInfo,
3906 _pAllocator: *const api::VkAllocationCallbacks,
3907 _pEvent: *mut api::VkEvent,
3908 ) -> api::VkResult {
3909 unimplemented!()
3910 }
3911
3912 #[allow(non_snake_case)]
3913 pub unsafe extern "system" fn vkDestroyEvent(
3914 _device: api::VkDevice,
3915 _event: api::VkEvent,
3916 _pAllocator: *const api::VkAllocationCallbacks,
3917 ) {
3918 unimplemented!()
3919 }
3920
3921 #[allow(non_snake_case)]
3922 pub unsafe extern "system" fn vkGetEventStatus(
3923 _device: api::VkDevice,
3924 _event: api::VkEvent,
3925 ) -> api::VkResult {
3926 unimplemented!()
3927 }
3928
3929 #[allow(non_snake_case)]
3930 pub unsafe extern "system" fn vkSetEvent(
3931 _device: api::VkDevice,
3932 _event: api::VkEvent,
3933 ) -> api::VkResult {
3934 unimplemented!()
3935 }
3936
3937 #[allow(non_snake_case)]
3938 pub unsafe extern "system" fn vkResetEvent(
3939 _device: api::VkDevice,
3940 _event: api::VkEvent,
3941 ) -> api::VkResult {
3942 unimplemented!()
3943 }
3944
3945 #[allow(non_snake_case)]
3946 pub unsafe extern "system" fn vkCreateQueryPool(
3947 _device: api::VkDevice,
3948 _pCreateInfo: *const api::VkQueryPoolCreateInfo,
3949 _pAllocator: *const api::VkAllocationCallbacks,
3950 _pQueryPool: *mut api::VkQueryPool,
3951 ) -> api::VkResult {
3952 unimplemented!()
3953 }
3954
3955 #[allow(non_snake_case)]
3956 pub unsafe extern "system" fn vkDestroyQueryPool(
3957 _device: api::VkDevice,
3958 _queryPool: api::VkQueryPool,
3959 _pAllocator: *const api::VkAllocationCallbacks,
3960 ) {
3961 unimplemented!()
3962 }
3963
3964 #[allow(non_snake_case)]
3965 pub unsafe extern "system" fn vkGetQueryPoolResults(
3966 _device: api::VkDevice,
3967 _queryPool: api::VkQueryPool,
3968 _firstQuery: u32,
3969 _queryCount: u32,
3970 _dataSize: usize,
3971 _pData: *mut c_void,
3972 _stride: api::VkDeviceSize,
3973 _flags: api::VkQueryResultFlags,
3974 ) -> api::VkResult {
3975 unimplemented!()
3976 }
3977
3978 #[allow(non_snake_case)]
3979 pub unsafe extern "system" fn vkCreateBuffer(
3980 _device: api::VkDevice,
3981 create_info: *const api::VkBufferCreateInfo,
3982 _allocator: *const api::VkAllocationCallbacks,
3983 buffer: *mut api::VkBuffer,
3984 ) -> api::VkResult {
3985 parse_next_chain_const!{
3986 create_info,
3987 root = api::VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
3988 external_memory_buffer: api::VkExternalMemoryBufferCreateInfo = api::VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO,
3989 }
3990 let ref create_info = *create_info;
3991 if !external_memory_buffer.is_null() {
3992 let ref external_memory_buffer = *external_memory_buffer;
3993 assert_eq!(external_memory_buffer.handleTypes, 0);
3994 }
3995 if create_info.size > isize::max_value() as u64 {
3996 return api::VK_ERROR_OUT_OF_DEVICE_MEMORY;
3997 }
3998 *buffer = OwnedHandle::<api::VkBuffer>::new(Buffer {
3999 size: create_info.size as usize,
4000 memory: None,
4001 })
4002 .take();
4003 api::VK_SUCCESS
4004 }
4005
4006 #[allow(non_snake_case)]
4007 pub unsafe extern "system" fn vkDestroyBuffer(
4008 _device: api::VkDevice,
4009 buffer: api::VkBuffer,
4010 _allocator: *const api::VkAllocationCallbacks,
4011 ) {
4012 if !buffer.is_null() {
4013 OwnedHandle::from(buffer);
4014 }
4015 }
4016
4017 #[allow(non_snake_case)]
4018 pub unsafe extern "system" fn vkCreateBufferView(
4019 _device: api::VkDevice,
4020 _pCreateInfo: *const api::VkBufferViewCreateInfo,
4021 _pAllocator: *const api::VkAllocationCallbacks,
4022 _pView: *mut api::VkBufferView,
4023 ) -> api::VkResult {
4024 unimplemented!()
4025 }
4026
4027 #[allow(non_snake_case)]
4028 pub unsafe extern "system" fn vkDestroyBufferView(
4029 _device: api::VkDevice,
4030 _bufferView: api::VkBufferView,
4031 _pAllocator: *const api::VkAllocationCallbacks,
4032 ) {
4033 unimplemented!()
4034 }
4035
4036 #[allow(non_snake_case)]
4037 pub unsafe extern "system" fn vkCreateImage(
4038 _device: api::VkDevice,
4039 _pCreateInfo: *const api::VkImageCreateInfo,
4040 _pAllocator: *const api::VkAllocationCallbacks,
4041 _pImage: *mut api::VkImage,
4042 ) -> api::VkResult {
4043 unimplemented!()
4044 }
4045
4046 #[allow(non_snake_case)]
4047 pub unsafe extern "system" fn vkDestroyImage(
4048 _device: api::VkDevice,
4049 _image: api::VkImage,
4050 _pAllocator: *const api::VkAllocationCallbacks,
4051 ) {
4052 unimplemented!()
4053 }
4054
4055 #[allow(non_snake_case)]
4056 pub unsafe extern "system" fn vkGetImageSubresourceLayout(
4057 _device: api::VkDevice,
4058 _image: api::VkImage,
4059 _pSubresource: *const api::VkImageSubresource,
4060 _pLayout: *mut api::VkSubresourceLayout,
4061 ) {
4062 unimplemented!()
4063 }
4064
4065 #[allow(non_snake_case)]
4066 pub unsafe extern "system" fn vkCreateImageView(
4067 _device: api::VkDevice,
4068 _pCreateInfo: *const api::VkImageViewCreateInfo,
4069 _pAllocator: *const api::VkAllocationCallbacks,
4070 _pView: *mut api::VkImageView,
4071 ) -> api::VkResult {
4072 unimplemented!()
4073 }
4074
4075 #[allow(non_snake_case)]
4076 pub unsafe extern "system" fn vkDestroyImageView(
4077 _device: api::VkDevice,
4078 _imageView: api::VkImageView,
4079 _pAllocator: *const api::VkAllocationCallbacks,
4080 ) {
4081 unimplemented!()
4082 }
4083
4084 #[allow(non_snake_case)]
4085 pub unsafe extern "system" fn vkCreateShaderModule(
4086 _device: api::VkDevice,
4087 create_info: *const api::VkShaderModuleCreateInfo,
4088 _allocator: *const api::VkAllocationCallbacks,
4089 shader_module: *mut api::VkShaderModule,
4090 ) -> api::VkResult {
4091 parse_next_chain_const!{
4092 create_info,
4093 root = api::VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
4094 }
4095 let ref create_info = *create_info;
4096 const U32_BYTE_COUNT: usize = 4;
4097 assert_eq!(U32_BYTE_COUNT, mem::size_of::<u32>());
4098 assert_eq!(create_info.codeSize % U32_BYTE_COUNT, 0);
4099 assert_ne!(create_info.codeSize, 0);
4100 let code = slice::from_raw_parts(create_info.pCode, create_info.codeSize / U32_BYTE_COUNT);
4101 *shader_module = OwnedHandle::<api::VkShaderModule>::new(ShaderModule {
4102 code: code.to_owned(),
4103 })
4104 .take();
4105 api::VK_SUCCESS
4106 }
4107
4108 #[allow(non_snake_case)]
4109 pub unsafe extern "system" fn vkDestroyShaderModule(
4110 _device: api::VkDevice,
4111 shader_module: api::VkShaderModule,
4112 _allocator: *const api::VkAllocationCallbacks,
4113 ) {
4114 if !shader_module.is_null() {
4115 OwnedHandle::from(shader_module);
4116 }
4117 }
4118
4119 #[allow(non_snake_case)]
4120 pub unsafe extern "system" fn vkCreatePipelineCache(
4121 _device: api::VkDevice,
4122 _pCreateInfo: *const api::VkPipelineCacheCreateInfo,
4123 _pAllocator: *const api::VkAllocationCallbacks,
4124 _pPipelineCache: *mut api::VkPipelineCache,
4125 ) -> api::VkResult {
4126 unimplemented!()
4127 }
4128
4129 #[allow(non_snake_case)]
4130 pub unsafe extern "system" fn vkDestroyPipelineCache(
4131 _device: api::VkDevice,
4132 _pipelineCache: api::VkPipelineCache,
4133 _pAllocator: *const api::VkAllocationCallbacks,
4134 ) {
4135 unimplemented!()
4136 }
4137
4138 #[allow(non_snake_case)]
4139 pub unsafe extern "system" fn vkGetPipelineCacheData(
4140 _device: api::VkDevice,
4141 _pipelineCache: api::VkPipelineCache,
4142 _pDataSize: *mut usize,
4143 _pData: *mut c_void,
4144 ) -> api::VkResult {
4145 unimplemented!()
4146 }
4147
4148 #[allow(non_snake_case)]
4149 pub unsafe extern "system" fn vkMergePipelineCaches(
4150 _device: api::VkDevice,
4151 _dstCache: api::VkPipelineCache,
4152 _srcCacheCount: u32,
4153 _pSrcCaches: *const api::VkPipelineCache,
4154 ) -> api::VkResult {
4155 unimplemented!()
4156 }
4157
4158 #[allow(non_snake_case)]
4159 pub unsafe extern "system" fn vkCreateGraphicsPipelines(
4160 _device: api::VkDevice,
4161 _pipelineCache: api::VkPipelineCache,
4162 _createInfoCount: u32,
4163 _pCreateInfos: *const api::VkGraphicsPipelineCreateInfo,
4164 _pAllocator: *const api::VkAllocationCallbacks,
4165 _pPipelines: *mut api::VkPipeline,
4166 ) -> api::VkResult {
4167 unimplemented!()
4168 }
4169
4170 #[allow(non_snake_case)]
4171 pub unsafe extern "system" fn vkCreateComputePipelines(
4172 _device: api::VkDevice,
4173 _pipelineCache: api::VkPipelineCache,
4174 _createInfoCount: u32,
4175 _pCreateInfos: *const api::VkComputePipelineCreateInfo,
4176 _pAllocator: *const api::VkAllocationCallbacks,
4177 _pPipelines: *mut api::VkPipeline,
4178 ) -> api::VkResult {
4179 unimplemented!()
4180 }
4181
4182 #[allow(non_snake_case)]
4183 pub unsafe extern "system" fn vkDestroyPipeline(
4184 _device: api::VkDevice,
4185 _pipeline: api::VkPipeline,
4186 _pAllocator: *const api::VkAllocationCallbacks,
4187 ) {
4188 unimplemented!()
4189 }
4190
4191 #[allow(non_snake_case)]
4192 pub unsafe extern "system" fn vkCreatePipelineLayout(
4193 _device: api::VkDevice,
4194 _pCreateInfo: *const api::VkPipelineLayoutCreateInfo,
4195 _pAllocator: *const api::VkAllocationCallbacks,
4196 _pPipelineLayout: *mut api::VkPipelineLayout,
4197 ) -> api::VkResult {
4198 unimplemented!()
4199 }
4200
4201 #[allow(non_snake_case)]
4202 pub unsafe extern "system" fn vkDestroyPipelineLayout(
4203 _device: api::VkDevice,
4204 _pipelineLayout: api::VkPipelineLayout,
4205 _pAllocator: *const api::VkAllocationCallbacks,
4206 ) {
4207 unimplemented!()
4208 }
4209
4210 #[allow(non_snake_case)]
4211 pub unsafe extern "system" fn vkCreateSampler(
4212 _device: api::VkDevice,
4213 create_info: *const api::VkSamplerCreateInfo,
4214 _allocator: *const api::VkAllocationCallbacks,
4215 sampler: *mut api::VkSampler,
4216 ) -> api::VkResult {
4217 parse_next_chain_const!{
4218 create_info,
4219 root = api::VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
4220 }
4221 let ref create_info = *create_info;
4222 *sampler = OwnedHandle::<api::VkSampler>::new(Sampler {
4223 mag_filter: create_info.magFilter,
4224 min_filter: create_info.minFilter,
4225 mipmap_mode: create_info.mipmapMode,
4226 address_modes: [
4227 create_info.addressModeU,
4228 create_info.addressModeV,
4229 create_info.addressModeW,
4230 ],
4231 mip_lod_bias: create_info.mipLodBias,
4232 anisotropy: if create_info.anisotropyEnable != api::VK_FALSE {
4233 Some(sampler::AnisotropySettings {
4234 max: create_info.maxAnisotropy,
4235 })
4236 } else {
4237 None
4238 },
4239 compare_op: if create_info.compareEnable != api::VK_FALSE {
4240 Some(create_info.compareOp)
4241 } else {
4242 None
4243 },
4244 min_lod: create_info.minLod,
4245 max_lod: create_info.maxLod,
4246 border_color: create_info.borderColor,
4247 unnormalized_coordinates: create_info.unnormalizedCoordinates != api::VK_FALSE,
4248 sampler_ycbcr_conversion: None,
4249 })
4250 .take();
4251 api::VK_SUCCESS
4252 }
4253
4254 #[allow(non_snake_case)]
4255 pub unsafe extern "system" fn vkDestroySampler(
4256 _device: api::VkDevice,
4257 sampler: api::VkSampler,
4258 _allocator: *const api::VkAllocationCallbacks,
4259 ) {
4260 if !sampler.is_null() {
4261 OwnedHandle::from(sampler);
4262 }
4263 }
4264
4265 #[allow(non_snake_case)]
4266 pub unsafe extern "system" fn vkCreateDescriptorSetLayout(
4267 _device: api::VkDevice,
4268 _pCreateInfo: *const api::VkDescriptorSetLayoutCreateInfo,
4269 _pAllocator: *const api::VkAllocationCallbacks,
4270 _pSetLayout: *mut api::VkDescriptorSetLayout,
4271 ) -> api::VkResult {
4272 unimplemented!()
4273 }
4274
4275 #[allow(non_snake_case)]
4276 pub unsafe extern "system" fn vkDestroyDescriptorSetLayout(
4277 _device: api::VkDevice,
4278 _descriptorSetLayout: api::VkDescriptorSetLayout,
4279 _pAllocator: *const api::VkAllocationCallbacks,
4280 ) {
4281 unimplemented!()
4282 }
4283
4284 #[allow(non_snake_case)]
4285 pub unsafe extern "system" fn vkCreateDescriptorPool(
4286 _device: api::VkDevice,
4287 _pCreateInfo: *const api::VkDescriptorPoolCreateInfo,
4288 _pAllocator: *const api::VkAllocationCallbacks,
4289 _pDescriptorPool: *mut api::VkDescriptorPool,
4290 ) -> api::VkResult {
4291 unimplemented!()
4292 }
4293
4294 #[allow(non_snake_case)]
4295 pub unsafe extern "system" fn vkDestroyDescriptorPool(
4296 _device: api::VkDevice,
4297 _descriptorPool: api::VkDescriptorPool,
4298 _pAllocator: *const api::VkAllocationCallbacks,
4299 ) {
4300 unimplemented!()
4301 }
4302
4303 #[allow(non_snake_case)]
4304 pub unsafe extern "system" fn vkResetDescriptorPool(
4305 _device: api::VkDevice,
4306 _descriptorPool: api::VkDescriptorPool,
4307 _flags: api::VkDescriptorPoolResetFlags,
4308 ) -> api::VkResult {
4309 unimplemented!()
4310 }
4311
4312 #[allow(non_snake_case)]
4313 pub unsafe extern "system" fn vkAllocateDescriptorSets(
4314 _device: api::VkDevice,
4315 _pAllocateInfo: *const api::VkDescriptorSetAllocateInfo,
4316 _pDescriptorSets: *mut api::VkDescriptorSet,
4317 ) -> api::VkResult {
4318 unimplemented!()
4319 }
4320
4321 #[allow(non_snake_case)]
4322 pub unsafe extern "system" fn vkFreeDescriptorSets(
4323 _device: api::VkDevice,
4324 _descriptorPool: api::VkDescriptorPool,
4325 _descriptorSetCount: u32,
4326 _pDescriptorSets: *const api::VkDescriptorSet,
4327 ) -> api::VkResult {
4328 unimplemented!()
4329 }
4330
4331 #[allow(non_snake_case)]
4332 pub unsafe extern "system" fn vkUpdateDescriptorSets(
4333 _device: api::VkDevice,
4334 _descriptorWriteCount: u32,
4335 _pDescriptorWrites: *const api::VkWriteDescriptorSet,
4336 _descriptorCopyCount: u32,
4337 _pDescriptorCopies: *const api::VkCopyDescriptorSet,
4338 ) {
4339 unimplemented!()
4340 }
4341
4342 #[allow(non_snake_case)]
4343 pub unsafe extern "system" fn vkCreateFramebuffer(
4344 _device: api::VkDevice,
4345 _pCreateInfo: *const api::VkFramebufferCreateInfo,
4346 _pAllocator: *const api::VkAllocationCallbacks,
4347 _pFramebuffer: *mut api::VkFramebuffer,
4348 ) -> api::VkResult {
4349 unimplemented!()
4350 }
4351
4352 #[allow(non_snake_case)]
4353 pub unsafe extern "system" fn vkDestroyFramebuffer(
4354 _device: api::VkDevice,
4355 _framebuffer: api::VkFramebuffer,
4356 _pAllocator: *const api::VkAllocationCallbacks,
4357 ) {
4358 unimplemented!()
4359 }
4360
4361 #[allow(non_snake_case)]
4362 pub unsafe extern "system" fn vkCreateRenderPass(
4363 _device: api::VkDevice,
4364 _pCreateInfo: *const api::VkRenderPassCreateInfo,
4365 _pAllocator: *const api::VkAllocationCallbacks,
4366 _pRenderPass: *mut api::VkRenderPass,
4367 ) -> api::VkResult {
4368 unimplemented!()
4369 }
4370
4371 #[allow(non_snake_case)]
4372 pub unsafe extern "system" fn vkDestroyRenderPass(
4373 _device: api::VkDevice,
4374 _renderPass: api::VkRenderPass,
4375 _pAllocator: *const api::VkAllocationCallbacks,
4376 ) {
4377 unimplemented!()
4378 }
4379
4380 #[allow(non_snake_case)]
4381 pub unsafe extern "system" fn vkGetRenderAreaGranularity(
4382 _device: api::VkDevice,
4383 _renderPass: api::VkRenderPass,
4384 _pGranularity: *mut api::VkExtent2D,
4385 ) {
4386 unimplemented!()
4387 }
4388
4389 #[allow(non_snake_case)]
4390 pub unsafe extern "system" fn vkCreateCommandPool(
4391 _device: api::VkDevice,
4392 _pCreateInfo: *const api::VkCommandPoolCreateInfo,
4393 _pAllocator: *const api::VkAllocationCallbacks,
4394 _pCommandPool: *mut api::VkCommandPool,
4395 ) -> api::VkResult {
4396 unimplemented!()
4397 }
4398
4399 #[allow(non_snake_case)]
4400 pub unsafe extern "system" fn vkDestroyCommandPool(
4401 _device: api::VkDevice,
4402 _commandPool: api::VkCommandPool,
4403 _pAllocator: *const api::VkAllocationCallbacks,
4404 ) {
4405 unimplemented!()
4406 }
4407
4408 #[allow(non_snake_case)]
4409 pub unsafe extern "system" fn vkResetCommandPool(
4410 _device: api::VkDevice,
4411 _commandPool: api::VkCommandPool,
4412 _flags: api::VkCommandPoolResetFlags,
4413 ) -> api::VkResult {
4414 unimplemented!()
4415 }
4416
4417 #[allow(non_snake_case)]
4418 pub unsafe extern "system" fn vkAllocateCommandBuffers(
4419 _device: api::VkDevice,
4420 _pAllocateInfo: *const api::VkCommandBufferAllocateInfo,
4421 _pCommandBuffers: *mut api::VkCommandBuffer,
4422 ) -> api::VkResult {
4423 unimplemented!()
4424 }
4425
4426 #[allow(non_snake_case)]
4427 pub unsafe extern "system" fn vkFreeCommandBuffers(
4428 _device: api::VkDevice,
4429 _commandPool: api::VkCommandPool,
4430 _commandBufferCount: u32,
4431 _pCommandBuffers: *const api::VkCommandBuffer,
4432 ) {
4433 unimplemented!()
4434 }
4435
4436 #[allow(non_snake_case)]
4437 pub unsafe extern "system" fn vkBeginCommandBuffer(
4438 _commandBuffer: api::VkCommandBuffer,
4439 _pBeginInfo: *const api::VkCommandBufferBeginInfo,
4440 ) -> api::VkResult {
4441 unimplemented!()
4442 }
4443
4444 #[allow(non_snake_case)]
4445 pub unsafe extern "system" fn vkEndCommandBuffer(
4446 _commandBuffer: api::VkCommandBuffer,
4447 ) -> api::VkResult {
4448 unimplemented!()
4449 }
4450
4451 #[allow(non_snake_case)]
4452 pub unsafe extern "system" fn vkResetCommandBuffer(
4453 _commandBuffer: api::VkCommandBuffer,
4454 _flags: api::VkCommandBufferResetFlags,
4455 ) -> api::VkResult {
4456 unimplemented!()
4457 }
4458
4459 #[allow(non_snake_case)]
4460 pub unsafe extern "system" fn vkCmdBindPipeline(
4461 _commandBuffer: api::VkCommandBuffer,
4462 _pipelineBindPoint: api::VkPipelineBindPoint,
4463 _pipeline: api::VkPipeline,
4464 ) {
4465 unimplemented!()
4466 }
4467
4468 #[allow(non_snake_case)]
4469 pub unsafe extern "system" fn vkCmdSetViewport(
4470 _commandBuffer: api::VkCommandBuffer,
4471 _firstViewport: u32,
4472 _viewportCount: u32,
4473 _pViewports: *const api::VkViewport,
4474 ) {
4475 unimplemented!()
4476 }
4477
4478 #[allow(non_snake_case)]
4479 pub unsafe extern "system" fn vkCmdSetScissor(
4480 _commandBuffer: api::VkCommandBuffer,
4481 _firstScissor: u32,
4482 _scissorCount: u32,
4483 _pScissors: *const api::VkRect2D,
4484 ) {
4485 unimplemented!()
4486 }
4487
4488 #[allow(non_snake_case)]
4489 pub unsafe extern "system" fn vkCmdSetLineWidth(
4490 _commandBuffer: api::VkCommandBuffer,
4491 _lineWidth: f32,
4492 ) {
4493 unimplemented!()
4494 }
4495
4496 #[allow(non_snake_case)]
4497 pub unsafe extern "system" fn vkCmdSetDepthBias(
4498 _commandBuffer: api::VkCommandBuffer,
4499 _depthBiasConstantFactor: f32,
4500 _depthBiasClamp: f32,
4501 _depthBiasSlopeFactor: f32,
4502 ) {
4503 unimplemented!()
4504 }
4505
4506 #[allow(non_snake_case)]
4507 pub unsafe extern "system" fn vkCmdSetBlendConstants(
4508 _commandBuffer: api::VkCommandBuffer,
4509 _blendConstants: *const f32,
4510 ) {
4511 unimplemented!()
4512 }
4513
4514 #[allow(non_snake_case)]
4515 pub unsafe extern "system" fn vkCmdSetDepthBounds(
4516 _commandBuffer: api::VkCommandBuffer,
4517 _minDepthBounds: f32,
4518 _maxDepthBounds: f32,
4519 ) {
4520 unimplemented!()
4521 }
4522
4523 #[allow(non_snake_case)]
4524 pub unsafe extern "system" fn vkCmdSetStencilCompareMask(
4525 _commandBuffer: api::VkCommandBuffer,
4526 _faceMask: api::VkStencilFaceFlags,
4527 _compareMask: u32,
4528 ) {
4529 unimplemented!()
4530 }
4531
4532 #[allow(non_snake_case)]
4533 pub unsafe extern "system" fn vkCmdSetStencilWriteMask(
4534 _commandBuffer: api::VkCommandBuffer,
4535 _faceMask: api::VkStencilFaceFlags,
4536 _writeMask: u32,
4537 ) {
4538 unimplemented!()
4539 }
4540
4541 #[allow(non_snake_case)]
4542 pub unsafe extern "system" fn vkCmdSetStencilReference(
4543 _commandBuffer: api::VkCommandBuffer,
4544 _faceMask: api::VkStencilFaceFlags,
4545 _reference: u32,
4546 ) {
4547 unimplemented!()
4548 }
4549
4550 #[allow(non_snake_case)]
4551 pub unsafe extern "system" fn vkCmdBindDescriptorSets(
4552 _commandBuffer: api::VkCommandBuffer,
4553 _pipelineBindPoint: api::VkPipelineBindPoint,
4554 _layout: api::VkPipelineLayout,
4555 _firstSet: u32,
4556 _descriptorSetCount: u32,
4557 _pDescriptorSets: *const api::VkDescriptorSet,
4558 _dynamicOffsetCount: u32,
4559 _pDynamicOffsets: *const u32,
4560 ) {
4561 unimplemented!()
4562 }
4563
4564 #[allow(non_snake_case)]
4565 pub unsafe extern "system" fn vkCmdBindIndexBuffer(
4566 _commandBuffer: api::VkCommandBuffer,
4567 _buffer: api::VkBuffer,
4568 _offset: api::VkDeviceSize,
4569 _indexType: api::VkIndexType,
4570 ) {
4571 unimplemented!()
4572 }
4573
4574 #[allow(non_snake_case)]
4575 pub unsafe extern "system" fn vkCmdBindVertexBuffers(
4576 _commandBuffer: api::VkCommandBuffer,
4577 _firstBinding: u32,
4578 _bindingCount: u32,
4579 _pBuffers: *const api::VkBuffer,
4580 _pOffsets: *const api::VkDeviceSize,
4581 ) {
4582 unimplemented!()
4583 }
4584
4585 #[allow(non_snake_case)]
4586 pub unsafe extern "system" fn vkCmdDraw(
4587 _commandBuffer: api::VkCommandBuffer,
4588 _vertexCount: u32,
4589 _instanceCount: u32,
4590 _firstVertex: u32,
4591 _firstInstance: u32,
4592 ) {
4593 unimplemented!()
4594 }
4595
4596 #[allow(non_snake_case)]
4597 pub unsafe extern "system" fn vkCmdDrawIndexed(
4598 _commandBuffer: api::VkCommandBuffer,
4599 _indexCount: u32,
4600 _instanceCount: u32,
4601 _firstIndex: u32,
4602 _vertexOffset: i32,
4603 _firstInstance: u32,
4604 ) {
4605 unimplemented!()
4606 }
4607
4608 #[allow(non_snake_case)]
4609 pub unsafe extern "system" fn vkCmdDrawIndirect(
4610 _commandBuffer: api::VkCommandBuffer,
4611 _buffer: api::VkBuffer,
4612 _offset: api::VkDeviceSize,
4613 _drawCount: u32,
4614 _stride: u32,
4615 ) {
4616 unimplemented!()
4617 }
4618
4619 #[allow(non_snake_case)]
4620 pub unsafe extern "system" fn vkCmdDrawIndexedIndirect(
4621 _commandBuffer: api::VkCommandBuffer,
4622 _buffer: api::VkBuffer,
4623 _offset: api::VkDeviceSize,
4624 _drawCount: u32,
4625 _stride: u32,
4626 ) {
4627 unimplemented!()
4628 }
4629
4630 #[allow(non_snake_case)]
4631 pub unsafe extern "system" fn vkCmdDispatch(
4632 _commandBuffer: api::VkCommandBuffer,
4633 _groupCountX: u32,
4634 _groupCountY: u32,
4635 _groupCountZ: u32,
4636 ) {
4637 unimplemented!()
4638 }
4639
4640 #[allow(non_snake_case)]
4641 pub unsafe extern "system" fn vkCmdDispatchIndirect(
4642 _commandBuffer: api::VkCommandBuffer,
4643 _buffer: api::VkBuffer,
4644 _offset: api::VkDeviceSize,
4645 ) {
4646 unimplemented!()
4647 }
4648
4649 #[allow(non_snake_case)]
4650 pub unsafe extern "system" fn vkCmdCopyBuffer(
4651 _commandBuffer: api::VkCommandBuffer,
4652 _srcBuffer: api::VkBuffer,
4653 _dstBuffer: api::VkBuffer,
4654 _regionCount: u32,
4655 _pRegions: *const api::VkBufferCopy,
4656 ) {
4657 unimplemented!()
4658 }
4659
4660 #[allow(non_snake_case)]
4661 pub unsafe extern "system" fn vkCmdCopyImage(
4662 _commandBuffer: api::VkCommandBuffer,
4663 _srcImage: api::VkImage,
4664 _srcImageLayout: api::VkImageLayout,
4665 _dstImage: api::VkImage,
4666 _dstImageLayout: api::VkImageLayout,
4667 _regionCount: u32,
4668 _pRegions: *const api::VkImageCopy,
4669 ) {
4670 unimplemented!()
4671 }
4672
4673 #[allow(non_snake_case)]
4674 pub unsafe extern "system" fn vkCmdBlitImage(
4675 _commandBuffer: api::VkCommandBuffer,
4676 _srcImage: api::VkImage,
4677 _srcImageLayout: api::VkImageLayout,
4678 _dstImage: api::VkImage,
4679 _dstImageLayout: api::VkImageLayout,
4680 _regionCount: u32,
4681 _pRegions: *const api::VkImageBlit,
4682 _filter: api::VkFilter,
4683 ) {
4684 unimplemented!()
4685 }
4686
4687 #[allow(non_snake_case)]
4688 pub unsafe extern "system" fn vkCmdCopyBufferToImage(
4689 _commandBuffer: api::VkCommandBuffer,
4690 _srcBuffer: api::VkBuffer,
4691 _dstImage: api::VkImage,
4692 _dstImageLayout: api::VkImageLayout,
4693 _regionCount: u32,
4694 _pRegions: *const api::VkBufferImageCopy,
4695 ) {
4696 unimplemented!()
4697 }
4698
4699 #[allow(non_snake_case)]
4700 pub unsafe extern "system" fn vkCmdCopyImageToBuffer(
4701 _commandBuffer: api::VkCommandBuffer,
4702 _srcImage: api::VkImage,
4703 _srcImageLayout: api::VkImageLayout,
4704 _dstBuffer: api::VkBuffer,
4705 _regionCount: u32,
4706 _pRegions: *const api::VkBufferImageCopy,
4707 ) {
4708 unimplemented!()
4709 }
4710
4711 #[allow(non_snake_case)]
4712 pub unsafe extern "system" fn vkCmdUpdateBuffer(
4713 _commandBuffer: api::VkCommandBuffer,
4714 _dstBuffer: api::VkBuffer,
4715 _dstOffset: api::VkDeviceSize,
4716 _dataSize: api::VkDeviceSize,
4717 _pData: *const c_void,
4718 ) {
4719 unimplemented!()
4720 }
4721
4722 #[allow(non_snake_case)]
4723 pub unsafe extern "system" fn vkCmdFillBuffer(
4724 _commandBuffer: api::VkCommandBuffer,
4725 _dstBuffer: api::VkBuffer,
4726 _dstOffset: api::VkDeviceSize,
4727 _size: api::VkDeviceSize,
4728 _data: u32,
4729 ) {
4730 unimplemented!()
4731 }
4732
4733 #[allow(non_snake_case)]
4734 pub unsafe extern "system" fn vkCmdClearColorImage(
4735 _commandBuffer: api::VkCommandBuffer,
4736 _image: api::VkImage,
4737 _imageLayout: api::VkImageLayout,
4738 _pColor: *const api::VkClearColorValue,
4739 _rangeCount: u32,
4740 _pRanges: *const api::VkImageSubresourceRange,
4741 ) {
4742 unimplemented!()
4743 }
4744
4745 #[allow(non_snake_case)]
4746 pub unsafe extern "system" fn vkCmdClearDepthStencilImage(
4747 _commandBuffer: api::VkCommandBuffer,
4748 _image: api::VkImage,
4749 _imageLayout: api::VkImageLayout,
4750 _pDepthStencil: *const api::VkClearDepthStencilValue,
4751 _rangeCount: u32,
4752 _pRanges: *const api::VkImageSubresourceRange,
4753 ) {
4754 unimplemented!()
4755 }
4756
4757 #[allow(non_snake_case)]
4758 pub unsafe extern "system" fn vkCmdClearAttachments(
4759 _commandBuffer: api::VkCommandBuffer,
4760 _attachmentCount: u32,
4761 _pAttachments: *const api::VkClearAttachment,
4762 _rectCount: u32,
4763 _pRects: *const api::VkClearRect,
4764 ) {
4765 unimplemented!()
4766 }
4767
4768 #[allow(non_snake_case)]
4769 pub unsafe extern "system" fn vkCmdResolveImage(
4770 _commandBuffer: api::VkCommandBuffer,
4771 _srcImage: api::VkImage,
4772 _srcImageLayout: api::VkImageLayout,
4773 _dstImage: api::VkImage,
4774 _dstImageLayout: api::VkImageLayout,
4775 _regionCount: u32,
4776 _pRegions: *const api::VkImageResolve,
4777 ) {
4778 unimplemented!()
4779 }
4780
4781 #[allow(non_snake_case)]
4782 pub unsafe extern "system" fn vkCmdSetEvent(
4783 _commandBuffer: api::VkCommandBuffer,
4784 _event: api::VkEvent,
4785 _stageMask: api::VkPipelineStageFlags,
4786 ) {
4787 unimplemented!()
4788 }
4789
4790 #[allow(non_snake_case)]
4791 pub unsafe extern "system" fn vkCmdResetEvent(
4792 _commandBuffer: api::VkCommandBuffer,
4793 _event: api::VkEvent,
4794 _stageMask: api::VkPipelineStageFlags,
4795 ) {
4796 unimplemented!()
4797 }
4798
4799 #[allow(non_snake_case)]
4800 pub unsafe extern "system" fn vkCmdWaitEvents(
4801 _commandBuffer: api::VkCommandBuffer,
4802 _eventCount: u32,
4803 _pEvents: *const api::VkEvent,
4804 _srcStageMask: api::VkPipelineStageFlags,
4805 _dstStageMask: api::VkPipelineStageFlags,
4806 _memoryBarrierCount: u32,
4807 _pMemoryBarriers: *const api::VkMemoryBarrier,
4808 _bufferMemoryBarrierCount: u32,
4809 _pBufferMemoryBarriers: *const api::VkBufferMemoryBarrier,
4810 _imageMemoryBarrierCount: u32,
4811 _pImageMemoryBarriers: *const api::VkImageMemoryBarrier,
4812 ) {
4813 unimplemented!()
4814 }
4815
4816 #[allow(non_snake_case)]
4817 pub unsafe extern "system" fn vkCmdPipelineBarrier(
4818 _commandBuffer: api::VkCommandBuffer,
4819 _srcStageMask: api::VkPipelineStageFlags,
4820 _dstStageMask: api::VkPipelineStageFlags,
4821 _dependencyFlags: api::VkDependencyFlags,
4822 _memoryBarrierCount: u32,
4823 _pMemoryBarriers: *const api::VkMemoryBarrier,
4824 _bufferMemoryBarrierCount: u32,
4825 _pBufferMemoryBarriers: *const api::VkBufferMemoryBarrier,
4826 _imageMemoryBarrierCount: u32,
4827 _pImageMemoryBarriers: *const api::VkImageMemoryBarrier,
4828 ) {
4829 unimplemented!()
4830 }
4831
4832 #[allow(non_snake_case)]
4833 pub unsafe extern "system" fn vkCmdBeginQuery(
4834 _commandBuffer: api::VkCommandBuffer,
4835 _queryPool: api::VkQueryPool,
4836 _query: u32,
4837 _flags: api::VkQueryControlFlags,
4838 ) {
4839 unimplemented!()
4840 }
4841
4842 #[allow(non_snake_case)]
4843 pub unsafe extern "system" fn vkCmdEndQuery(
4844 _commandBuffer: api::VkCommandBuffer,
4845 _queryPool: api::VkQueryPool,
4846 _query: u32,
4847 ) {
4848 unimplemented!()
4849 }
4850
4851 #[allow(non_snake_case)]
4852 pub unsafe extern "system" fn vkCmdResetQueryPool(
4853 _commandBuffer: api::VkCommandBuffer,
4854 _queryPool: api::VkQueryPool,
4855 _firstQuery: u32,
4856 _queryCount: u32,
4857 ) {
4858 unimplemented!()
4859 }
4860
4861 #[allow(non_snake_case)]
4862 pub unsafe extern "system" fn vkCmdWriteTimestamp(
4863 _commandBuffer: api::VkCommandBuffer,
4864 _pipelineStage: api::VkPipelineStageFlagBits,
4865 _queryPool: api::VkQueryPool,
4866 _query: u32,
4867 ) {
4868 unimplemented!()
4869 }
4870
4871 #[allow(non_snake_case)]
4872 pub unsafe extern "system" fn vkCmdCopyQueryPoolResults(
4873 _commandBuffer: api::VkCommandBuffer,
4874 _queryPool: api::VkQueryPool,
4875 _firstQuery: u32,
4876 _queryCount: u32,
4877 _dstBuffer: api::VkBuffer,
4878 _dstOffset: api::VkDeviceSize,
4879 _stride: api::VkDeviceSize,
4880 _flags: api::VkQueryResultFlags,
4881 ) {
4882 unimplemented!()
4883 }
4884
4885 #[allow(non_snake_case)]
4886 pub unsafe extern "system" fn vkCmdPushConstants(
4887 _commandBuffer: api::VkCommandBuffer,
4888 _layout: api::VkPipelineLayout,
4889 _stageFlags: api::VkShaderStageFlags,
4890 _offset: u32,
4891 _size: u32,
4892 _pValues: *const c_void,
4893 ) {
4894 unimplemented!()
4895 }
4896
4897 #[allow(non_snake_case)]
4898 pub unsafe extern "system" fn vkCmdBeginRenderPass(
4899 _commandBuffer: api::VkCommandBuffer,
4900 _pRenderPassBegin: *const api::VkRenderPassBeginInfo,
4901 _contents: api::VkSubpassContents,
4902 ) {
4903 unimplemented!()
4904 }
4905
4906 #[allow(non_snake_case)]
4907 pub unsafe extern "system" fn vkCmdNextSubpass(
4908 _commandBuffer: api::VkCommandBuffer,
4909 _contents: api::VkSubpassContents,
4910 ) {
4911 unimplemented!()
4912 }
4913
4914 #[allow(non_snake_case)]
4915 pub unsafe extern "system" fn vkCmdEndRenderPass(_commandBuffer: api::VkCommandBuffer) {
4916 unimplemented!()
4917 }
4918
4919 #[allow(non_snake_case)]
4920 pub unsafe extern "system" fn vkCmdExecuteCommands(
4921 _commandBuffer: api::VkCommandBuffer,
4922 _commandBufferCount: u32,
4923 _pCommandBuffers: *const api::VkCommandBuffer,
4924 ) {
4925 unimplemented!()
4926 }
4927
4928 #[allow(non_snake_case)]
4929 pub unsafe extern "system" fn vkBindBufferMemory2(
4930 _device: api::VkDevice,
4931 _bindInfoCount: u32,
4932 _pBindInfos: *const api::VkBindBufferMemoryInfo,
4933 ) -> api::VkResult {
4934 unimplemented!()
4935 }
4936
4937 #[allow(non_snake_case)]
4938 pub unsafe extern "system" fn vkBindImageMemory2(
4939 _device: api::VkDevice,
4940 _bindInfoCount: u32,
4941 _pBindInfos: *const api::VkBindImageMemoryInfo,
4942 ) -> api::VkResult {
4943 unimplemented!()
4944 }
4945
4946 #[allow(non_snake_case)]
4947 pub unsafe extern "system" fn vkGetDeviceGroupPeerMemoryFeatures(
4948 _device: api::VkDevice,
4949 _heapIndex: u32,
4950 _localDeviceIndex: u32,
4951 _remoteDeviceIndex: u32,
4952 _pPeerMemoryFeatures: *mut api::VkPeerMemoryFeatureFlags,
4953 ) {
4954 unimplemented!()
4955 }
4956
4957 #[allow(non_snake_case)]
4958 pub unsafe extern "system" fn vkCmdSetDeviceMask(
4959 _commandBuffer: api::VkCommandBuffer,
4960 _deviceMask: u32,
4961 ) {
4962 unimplemented!()
4963 }
4964
4965 #[allow(non_snake_case)]
4966 pub unsafe extern "system" fn vkCmdDispatchBase(
4967 _commandBuffer: api::VkCommandBuffer,
4968 _baseGroupX: u32,
4969 _baseGroupY: u32,
4970 _baseGroupZ: u32,
4971 _groupCountX: u32,
4972 _groupCountY: u32,
4973 _groupCountZ: u32,
4974 ) {
4975 unimplemented!()
4976 }
4977
4978 #[allow(non_snake_case)]
4979 pub unsafe extern "system" fn vkEnumeratePhysicalDeviceGroups(
4980 instance: api::VkInstance,
4981 physical_device_group_count: *mut u32,
4982 physical_device_group_properties: *mut api::VkPhysicalDeviceGroupProperties,
4983 ) -> api::VkResult {
4984 enumerate_helper(
4985 physical_device_group_count,
4986 physical_device_group_properties,
4987 iter::once(()),
4988 |physical_device_group_properties, _| {
4989 parse_next_chain_mut!{
4990 physical_device_group_properties as *mut api::VkPhysicalDeviceGroupProperties,
4991 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES,
4992 }
4993 let mut physical_devices = [Handle::null(); api::VK_MAX_DEVICE_GROUP_SIZE as usize];
4994 physical_devices[0] = SharedHandle::from(instance)
4995 .unwrap()
4996 .physical_device
4997 .get_handle();
4998 *physical_device_group_properties = api::VkPhysicalDeviceGroupProperties {
4999 sType: physical_device_group_properties.sType,
5000 pNext: physical_device_group_properties.pNext,
5001 physicalDeviceCount: 1,
5002 physicalDevices: physical_devices,
5003 subsetAllocation: api::VK_TRUE,
5004 };
5005 },
5006 )
5007 }
5008
5009 #[allow(non_snake_case)]
5010 pub unsafe extern "system" fn vkGetImageMemoryRequirements2(
5011 _device: api::VkDevice,
5012 _pInfo: *const api::VkImageMemoryRequirementsInfo2,
5013 _pMemoryRequirements: *mut api::VkMemoryRequirements2,
5014 ) {
5015 unimplemented!()
5016 }
5017
5018 #[allow(non_snake_case)]
5019 pub unsafe extern "system" fn vkGetBufferMemoryRequirements2(
5020 _device: api::VkDevice,
5021 info: *const api::VkBufferMemoryRequirementsInfo2,
5022 memory_requirements: *mut api::VkMemoryRequirements2,
5023 ) {
5024 parse_next_chain_const!{
5025 info,
5026 root = api::VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
5027 }
5028 parse_next_chain_mut!{
5029 memory_requirements,
5030 root = api::VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
5031 dedicated_requirements: api::VkMemoryDedicatedRequirements = api::VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS,
5032 }
5033 let ref mut memory_requirements = *memory_requirements;
5034 let ref info = *info;
5035 let buffer = SharedHandle::from(info.buffer).unwrap();
5036 let layout = DeviceMemoryLayout::calculate(buffer.size, BUFFER_ALIGNMENT);
5037 memory_requirements.memoryRequirements = api::VkMemoryRequirements {
5038 size: layout.size as u64,
5039 alignment: layout.alignment as u64,
5040 memoryTypeBits: DeviceMemoryType::Main.to_bits(),
5041 };
5042 if !dedicated_requirements.is_null() {
5043 let ref mut dedicated_requirements = *dedicated_requirements;
5044 dedicated_requirements.prefersDedicatedAllocation = api::VK_FALSE;
5045 dedicated_requirements.requiresDedicatedAllocation = api::VK_FALSE;
5046 }
5047 }
5048
5049 #[allow(non_snake_case)]
5050 pub unsafe extern "system" fn vkGetImageSparseMemoryRequirements2(
5051 _device: api::VkDevice,
5052 _pInfo: *const api::VkImageSparseMemoryRequirementsInfo2,
5053 _pSparseMemoryRequirementCount: *mut u32,
5054 _pSparseMemoryRequirements: *mut api::VkSparseImageMemoryRequirements2,
5055 ) {
5056 unimplemented!()
5057 }
5058
5059 #[allow(non_snake_case)]
5060 pub unsafe extern "system" fn vkGetPhysicalDeviceFeatures2(
5061 physical_device: api::VkPhysicalDevice,
5062 features: *mut api::VkPhysicalDeviceFeatures2,
5063 ) {
5064 parse_next_chain_mut!{
5065 features,
5066 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
5067 sampler_ycbcr_conversion_features: api::VkPhysicalDeviceSamplerYcbcrConversionFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
5068 physical_device_16bit_storage_features: api::VkPhysicalDevice16BitStorageFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
5069 variable_pointer_features: api::VkPhysicalDeviceVariablePointerFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES,
5070 physical_device_shader_draw_parameter_features: api::VkPhysicalDeviceShaderDrawParameterFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES,
5071 physical_device_protected_memory_features: api::VkPhysicalDeviceProtectedMemoryFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
5072 physical_device_multiview_features: api::VkPhysicalDeviceMultiviewFeatures = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
5073 }
5074 let physical_device = SharedHandle::from(physical_device).unwrap();
5075 physical_device.features.export_feature_set(&mut *features);
5076 if !sampler_ycbcr_conversion_features.is_null() {
5077 physical_device
5078 .features
5079 .export_feature_set(&mut *sampler_ycbcr_conversion_features);
5080 }
5081 if !physical_device_16bit_storage_features.is_null() {
5082 physical_device
5083 .features
5084 .export_feature_set(&mut *physical_device_16bit_storage_features);
5085 }
5086 if !variable_pointer_features.is_null() {
5087 physical_device
5088 .features
5089 .export_feature_set(&mut *variable_pointer_features);
5090 }
5091 if !physical_device_shader_draw_parameter_features.is_null() {
5092 physical_device
5093 .features
5094 .export_feature_set(&mut *physical_device_shader_draw_parameter_features);
5095 }
5096 if !physical_device_protected_memory_features.is_null() {
5097 physical_device
5098 .features
5099 .export_feature_set(&mut *physical_device_protected_memory_features);
5100 }
5101 if !physical_device_multiview_features.is_null() {
5102 physical_device
5103 .features
5104 .export_feature_set(&mut *physical_device_multiview_features);
5105 }
5106 }
5107
5108 #[allow(non_snake_case)]
5109 pub unsafe extern "system" fn vkGetPhysicalDeviceProperties2(
5110 physical_device: api::VkPhysicalDevice,
5111 properties: *mut api::VkPhysicalDeviceProperties2,
5112 ) {
5113 parse_next_chain_mut!{
5114 properties,
5115 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
5116 point_clipping_properties: api::VkPhysicalDevicePointClippingProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES,
5117 multiview_properties: api::VkPhysicalDeviceMultiviewProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
5118 id_properties: api::VkPhysicalDeviceIDProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES,
5119 maintenance_3_properties: api::VkPhysicalDeviceMaintenance3Properties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
5120 protected_memory_properties: api::VkPhysicalDeviceProtectedMemoryProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES,
5121 subgroup_properties: api::VkPhysicalDeviceSubgroupProperties = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES,
5122 }
5123 let ref mut properties = *properties;
5124 let physical_device = SharedHandle::from(physical_device).unwrap();
5125 properties.properties = physical_device.properties;
5126 if !point_clipping_properties.is_null() {
5127 let ref mut point_clipping_properties = *point_clipping_properties;
5128 *point_clipping_properties = api::VkPhysicalDevicePointClippingProperties {
5129 sType: point_clipping_properties.sType,
5130 pNext: point_clipping_properties.pNext,
5131 ..physical_device.point_clipping_properties
5132 };
5133 }
5134 if !multiview_properties.is_null() {
5135 let ref mut multiview_properties = *multiview_properties;
5136 *multiview_properties = api::VkPhysicalDeviceMultiviewProperties {
5137 sType: multiview_properties.sType,
5138 pNext: multiview_properties.pNext,
5139 ..physical_device.multiview_properties
5140 };
5141 }
5142 if !id_properties.is_null() {
5143 let ref mut id_properties = *id_properties;
5144 *id_properties = api::VkPhysicalDeviceIDProperties {
5145 sType: id_properties.sType,
5146 pNext: id_properties.pNext,
5147 ..physical_device.id_properties
5148 };
5149 }
5150 if !maintenance_3_properties.is_null() {
5151 let ref mut maintenance_3_properties = *maintenance_3_properties;
5152 *maintenance_3_properties = api::VkPhysicalDeviceMaintenance3Properties {
5153 sType: maintenance_3_properties.sType,
5154 pNext: maintenance_3_properties.pNext,
5155 ..physical_device.maintenance_3_properties
5156 };
5157 }
5158 if !protected_memory_properties.is_null() {
5159 let ref mut protected_memory_properties = *protected_memory_properties;
5160 *protected_memory_properties = api::VkPhysicalDeviceProtectedMemoryProperties {
5161 sType: protected_memory_properties.sType,
5162 pNext: protected_memory_properties.pNext,
5163 ..physical_device.protected_memory_properties
5164 };
5165 }
5166 if !subgroup_properties.is_null() {
5167 let ref mut subgroup_properties = *subgroup_properties;
5168 *subgroup_properties = api::VkPhysicalDeviceSubgroupProperties {
5169 sType: subgroup_properties.sType,
5170 pNext: subgroup_properties.pNext,
5171 ..physical_device.subgroup_properties
5172 };
5173 }
5174 }
5175
5176 #[allow(non_snake_case)]
5177 pub unsafe extern "system" fn vkGetPhysicalDeviceFormatProperties2(
5178 _physical_device: api::VkPhysicalDevice,
5179 format: api::VkFormat,
5180 format_properties: *mut api::VkFormatProperties2,
5181 ) {
5182 parse_next_chain_mut!{
5183 format_properties,
5184 root = api::VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
5185 }
5186 let ref mut format_properties = *format_properties;
5187 format_properties.formatProperties = PhysicalDevice::get_format_properties(format);
5188 }
5189
5190 #[allow(non_snake_case)]
5191 pub unsafe extern "system" fn vkGetPhysicalDeviceImageFormatProperties2(
5192 _physicalDevice: api::VkPhysicalDevice,
5193 _pImageFormatInfo: *const api::VkPhysicalDeviceImageFormatInfo2,
5194 _pImageFormatProperties: *mut api::VkImageFormatProperties2,
5195 ) -> api::VkResult {
5196 unimplemented!()
5197 }
5198
5199 #[allow(non_snake_case)]
5200 pub unsafe extern "system" fn vkGetPhysicalDeviceQueueFamilyProperties2(
5201 physical_device: api::VkPhysicalDevice,
5202 queue_family_property_count: *mut u32,
5203 queue_family_properties: *mut api::VkQueueFamilyProperties2,
5204 ) {
5205 enumerate_helper(
5206 queue_family_property_count,
5207 queue_family_properties,
5208 QUEUE_COUNTS.iter(),
5209 |queue_family_properties, &count| {
5210 get_physical_device_queue_family_properties(
5211 SharedHandle::from(physical_device).unwrap(),
5212 queue_family_properties,
5213 count,
5214 );
5215 },
5216 );
5217 }
5218
5219 #[allow(non_snake_case)]
5220 pub unsafe extern "system" fn vkGetPhysicalDeviceMemoryProperties2(
5221 physical_device: api::VkPhysicalDevice,
5222 memory_properties: *mut api::VkPhysicalDeviceMemoryProperties2,
5223 ) {
5224 let physical_device = SharedHandle::from(physical_device).unwrap();
5225 parse_next_chain_mut!{
5226 memory_properties,
5227 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
5228 }
5229 let ref mut memory_properties = *memory_properties;
5230 let mut properties: api::VkPhysicalDeviceMemoryProperties = mem::zeroed();
5231 properties.memoryTypeCount = DeviceMemoryTypes::default().len() as u32;
5232 for (memory_type, _) in DeviceMemoryTypes::default().iter() {
5233 properties.memoryTypes[memory_type as usize] = api::VkMemoryType {
5234 propertyFlags: memory_type.flags(),
5235 heapIndex: memory_type.heap() as u32,
5236 };
5237 }
5238 properties.memoryHeapCount = DeviceMemoryHeaps::default().len() as u32;
5239 for (memory_heap, _) in DeviceMemoryHeaps::default().iter() {
5240 properties.memoryHeaps[memory_heap as usize] = api::VkMemoryHeap {
5241 size: match memory_heap {
5242 DeviceMemoryHeap::Main => physical_device.system_memory_size * 7 / 8,
5243 },
5244 flags: memory_heap.flags(),
5245 }
5246 }
5247 memory_properties.memoryProperties = properties;
5248 }
5249
5250 #[allow(non_snake_case)]
5251 pub unsafe extern "system" fn vkGetPhysicalDeviceSparseImageFormatProperties2(
5252 _physicalDevice: api::VkPhysicalDevice,
5253 _pFormatInfo: *const api::VkPhysicalDeviceSparseImageFormatInfo2,
5254 _pPropertyCount: *mut u32,
5255 _pProperties: *mut api::VkSparseImageFormatProperties2,
5256 ) {
5257 unimplemented!()
5258 }
5259
5260 #[allow(non_snake_case)]
5261 pub unsafe extern "system" fn vkTrimCommandPool(
5262 _device: api::VkDevice,
5263 _commandPool: api::VkCommandPool,
5264 _flags: api::VkCommandPoolTrimFlags,
5265 ) {
5266 unimplemented!()
5267 }
5268
5269 #[allow(non_snake_case)]
5270 pub unsafe extern "system" fn vkGetDeviceQueue2(
5271 device: api::VkDevice,
5272 queue_info: *const api::VkDeviceQueueInfo2,
5273 queue: *mut api::VkQueue,
5274 ) {
5275 parse_next_chain_const!{
5276 queue_info,
5277 root = api::VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
5278 }
5279 let ref queue_info = *queue_info;
5280 assert_eq!(queue_info.flags, 0);
5281 let device = SharedHandle::from(device).unwrap();
5282 *queue = device.queues[queue_info.queueFamilyIndex as usize][queue_info.queueIndex as usize]
5283 .get_handle();
5284 }
5285
5286 #[allow(non_snake_case)]
5287 pub unsafe extern "system" fn vkCreateSamplerYcbcrConversion(
5288 _device: api::VkDevice,
5289 _pCreateInfo: *const api::VkSamplerYcbcrConversionCreateInfo,
5290 _pAllocator: *const api::VkAllocationCallbacks,
5291 _pYcbcrConversion: *mut api::VkSamplerYcbcrConversion,
5292 ) -> api::VkResult {
5293 unimplemented!()
5294 }
5295
5296 #[allow(non_snake_case)]
5297 pub unsafe extern "system" fn vkDestroySamplerYcbcrConversion(
5298 _device: api::VkDevice,
5299 _ycbcrConversion: api::VkSamplerYcbcrConversion,
5300 _pAllocator: *const api::VkAllocationCallbacks,
5301 ) {
5302 unimplemented!()
5303 }
5304
5305 #[allow(non_snake_case)]
5306 pub unsafe extern "system" fn vkCreateDescriptorUpdateTemplate(
5307 _device: api::VkDevice,
5308 _pCreateInfo: *const api::VkDescriptorUpdateTemplateCreateInfo,
5309 _pAllocator: *const api::VkAllocationCallbacks,
5310 _pDescriptorUpdateTemplate: *mut api::VkDescriptorUpdateTemplate,
5311 ) -> api::VkResult {
5312 unimplemented!()
5313 }
5314
5315 #[allow(non_snake_case)]
5316 pub unsafe extern "system" fn vkDestroyDescriptorUpdateTemplate(
5317 _device: api::VkDevice,
5318 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5319 _pAllocator: *const api::VkAllocationCallbacks,
5320 ) {
5321 unimplemented!()
5322 }
5323
5324 #[allow(non_snake_case)]
5325 pub unsafe extern "system" fn vkUpdateDescriptorSetWithTemplate(
5326 _device: api::VkDevice,
5327 _descriptorSet: api::VkDescriptorSet,
5328 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5329 _pData: *const c_void,
5330 ) {
5331 unimplemented!()
5332 }
5333
5334 #[allow(non_snake_case)]
5335 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalBufferProperties(
5336 _physicalDevice: api::VkPhysicalDevice,
5337 _pExternalBufferInfo: *const api::VkPhysicalDeviceExternalBufferInfo,
5338 _pExternalBufferProperties: *mut api::VkExternalBufferProperties,
5339 ) {
5340 unimplemented!()
5341 }
5342
5343 #[allow(non_snake_case)]
5344 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalFenceProperties(
5345 _physicalDevice: api::VkPhysicalDevice,
5346 _pExternalFenceInfo: *const api::VkPhysicalDeviceExternalFenceInfo,
5347 _pExternalFenceProperties: *mut api::VkExternalFenceProperties,
5348 ) {
5349 unimplemented!()
5350 }
5351
5352 #[allow(non_snake_case)]
5353 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalSemaphoreProperties(
5354 _physicalDevice: api::VkPhysicalDevice,
5355 _pExternalSemaphoreInfo: *const api::VkPhysicalDeviceExternalSemaphoreInfo,
5356 _pExternalSemaphoreProperties: *mut api::VkExternalSemaphoreProperties,
5357 ) {
5358 unimplemented!()
5359 }
5360
5361 #[allow(non_snake_case)]
5362 pub unsafe extern "system" fn vkGetDescriptorSetLayoutSupport(
5363 _device: api::VkDevice,
5364 _pCreateInfo: *const api::VkDescriptorSetLayoutCreateInfo,
5365 _pSupport: *mut api::VkDescriptorSetLayoutSupport,
5366 ) {
5367 unimplemented!()
5368 }
5369
5370 #[allow(non_snake_case)]
5371 pub unsafe extern "system" fn vkDestroySurfaceKHR(
5372 _instance: api::VkInstance,
5373 surface: api::VkSurfaceKHR,
5374 _allocator: *const api::VkAllocationCallbacks,
5375 ) {
5376 if !surface.is_null() {
5377 let surface = SharedHandle::from(surface).unwrap();
5378 match surface.platform {
5379 api::VK_ICD_WSI_PLATFORM_MIR => {
5380 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_MIR")
5381 }
5382 api::VK_ICD_WSI_PLATFORM_WAYLAND => {
5383 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_WAYLAND")
5384 }
5385 api::VK_ICD_WSI_PLATFORM_WIN32 => {
5386 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_WIN32")
5387 }
5388 api::VK_ICD_WSI_PLATFORM_XCB => {
5389 Box::from_raw(surface.take().get().unwrap().as_ptr() as *mut api::VkIcdSurfaceXcb);
5390 }
5391 api::VK_ICD_WSI_PLATFORM_XLIB => {
5392 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_XLIB")
5393 }
5394 api::VK_ICD_WSI_PLATFORM_ANDROID => {
5395 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_ANDROID")
5396 }
5397 api::VK_ICD_WSI_PLATFORM_MACOS => {
5398 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_MACOS")
5399 }
5400 api::VK_ICD_WSI_PLATFORM_IOS => {
5401 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_IOS")
5402 }
5403 api::VK_ICD_WSI_PLATFORM_DISPLAY => {
5404 panic!("unimplemented platform: VK_ICD_WSI_PLATFORM_DISPLAY")
5405 }
5406 platform => panic!("unknown VkSurfaceKHR platform: {:?}", platform),
5407 }
5408 }
5409 }
5410
5411 #[allow(non_snake_case)]
5412 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceSupportKHR(
5413 _physicalDevice: api::VkPhysicalDevice,
5414 _queueFamilyIndex: u32,
5415 _surface: api::VkSurfaceKHR,
5416 _pSupported: *mut api::VkBool32,
5417 ) -> api::VkResult {
5418 unimplemented!()
5419 }
5420
5421 #[allow(non_snake_case)]
5422 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5423 physical_device: api::VkPhysicalDevice,
5424 surface: api::VkSurfaceKHR,
5425 surface_capabilities: *mut api::VkSurfaceCapabilitiesKHR,
5426 ) -> api::VkResult {
5427 let mut surface_capabilities_2 = api::VkSurfaceCapabilities2KHR {
5428 sType: api::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
5429 pNext: null_mut(),
5430 surfaceCapabilities: mem::zeroed(),
5431 };
5432 match vkGetPhysicalDeviceSurfaceCapabilities2KHR(
5433 physical_device,
5434 &api::VkPhysicalDeviceSurfaceInfo2KHR {
5435 sType: api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
5436 pNext: null(),
5437 surface: surface,
5438 },
5439 &mut surface_capabilities_2,
5440 ) {
5441 api::VK_SUCCESS => {
5442 *surface_capabilities = surface_capabilities_2.surfaceCapabilities;
5443 api::VK_SUCCESS
5444 }
5445 error => error,
5446 }
5447 }
5448
5449 #[allow(non_snake_case)]
5450 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceFormatsKHR(
5451 _physical_device: api::VkPhysicalDevice,
5452 surface: api::VkSurfaceKHR,
5453 surface_format_count: *mut u32,
5454 surface_formats: *mut api::VkSurfaceFormatKHR,
5455 ) -> api::VkResult {
5456 let surface_implementation =
5457 SurfacePlatform::from(SharedHandle::from(surface).unwrap().platform)
5458 .unwrap()
5459 .get_surface_implementation();
5460 let returned_surface_formats = match surface_implementation.get_surface_formats(surface) {
5461 Ok(returned_surface_formats) => returned_surface_formats,
5462 Err(result) => return result,
5463 };
5464 enumerate_helper(
5465 surface_format_count,
5466 surface_formats,
5467 returned_surface_formats.iter(),
5468 |a, b| *a = *b,
5469 )
5470 }
5471
5472 #[allow(non_snake_case)]
5473 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfacePresentModesKHR(
5474 _physical_device: api::VkPhysicalDevice,
5475 surface: api::VkSurfaceKHR,
5476 present_mode_count: *mut u32,
5477 present_modes: *mut api::VkPresentModeKHR,
5478 ) -> api::VkResult {
5479 let surface_implementation =
5480 SurfacePlatform::from(SharedHandle::from(surface).unwrap().platform)
5481 .unwrap()
5482 .get_surface_implementation();
5483 let returned_present_modes = match surface_implementation.get_present_modes(surface) {
5484 Ok(returned_present_modes) => returned_present_modes,
5485 Err(result) => return result,
5486 };
5487 enumerate_helper(
5488 present_mode_count,
5489 present_modes,
5490 returned_present_modes.iter(),
5491 |a, b| *a = *b,
5492 )
5493 }
5494
5495 #[allow(non_snake_case)]
5496 pub unsafe extern "system" fn vkCreateSwapchainKHR(
5497 device: api::VkDevice,
5498 create_info: *const api::VkSwapchainCreateInfoKHR,
5499 _allocator: *const api::VkAllocationCallbacks,
5500 swapchain: *mut api::VkSwapchainKHR,
5501 ) -> api::VkResult {
5502 parse_next_chain_const!{
5503 create_info,
5504 root = api::VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
5505 device_group_swapchain_create_info: api::VkDeviceGroupSwapchainCreateInfoKHR = api::VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR,
5506 }
5507 let ref create_info = *create_info;
5508 let device_group_swapchain_create_info = if device_group_swapchain_create_info.is_null() {
5509 None
5510 } else {
5511 Some(&*device_group_swapchain_create_info)
5512 };
5513 *swapchain = Handle::null();
5514 let platform =
5515 SurfacePlatform::from(SharedHandle::from(create_info.surface).unwrap().platform).unwrap();
5516 match platform
5517 .get_surface_implementation()
5518 .build(create_info, device_group_swapchain_create_info)
5519 {
5520 Ok(new_swapchain) => {
5521 *swapchain = OwnedHandle::<api::VkSwapchainKHR>::new(new_swapchain).take();
5522 api::VK_SUCCESS
5523 }
5524 Err(error) => error,
5525 }
5526 }
5527
5528 #[allow(non_snake_case)]
5529 pub unsafe extern "system" fn vkDestroySwapchainKHR(
5530 _device: api::VkDevice,
5531 swapchain: api::VkSwapchainKHR,
5532 _allocator: *const api::VkAllocationCallbacks,
5533 ) {
5534 if !swapchain.is_null() {
5535 OwnedHandle::from(swapchain);
5536 }
5537 }
5538
5539 #[allow(non_snake_case)]
5540 pub unsafe extern "system" fn vkGetSwapchainImagesKHR(
5541 _device: api::VkDevice,
5542 _swapchain: api::VkSwapchainKHR,
5543 _pSwapchainImageCount: *mut u32,
5544 _pSwapchainImages: *mut api::VkImage,
5545 ) -> api::VkResult {
5546 unimplemented!()
5547 }
5548
5549 #[allow(non_snake_case)]
5550 pub unsafe extern "system" fn vkAcquireNextImageKHR(
5551 _device: api::VkDevice,
5552 _swapchain: api::VkSwapchainKHR,
5553 _timeout: u64,
5554 _semaphore: api::VkSemaphore,
5555 _fence: api::VkFence,
5556 _pImageIndex: *mut u32,
5557 ) -> api::VkResult {
5558 unimplemented!()
5559 }
5560
5561 #[allow(non_snake_case)]
5562 pub unsafe extern "system" fn vkQueuePresentKHR(
5563 _queue: api::VkQueue,
5564 _pPresentInfo: *const api::VkPresentInfoKHR,
5565 ) -> api::VkResult {
5566 unimplemented!()
5567 }
5568
5569 #[allow(non_snake_case)]
5570 pub unsafe extern "system" fn vkGetDeviceGroupPresentCapabilitiesKHR(
5571 _device: api::VkDevice,
5572 _pDeviceGroupPresentCapabilities: *mut api::VkDeviceGroupPresentCapabilitiesKHR,
5573 ) -> api::VkResult {
5574 unimplemented!()
5575 }
5576
5577 #[allow(non_snake_case)]
5578 pub unsafe extern "system" fn vkGetDeviceGroupSurfacePresentModesKHR(
5579 _device: api::VkDevice,
5580 _surface: api::VkSurfaceKHR,
5581 _pModes: *mut api::VkDeviceGroupPresentModeFlagsKHR,
5582 ) -> api::VkResult {
5583 unimplemented!()
5584 }
5585
5586 #[allow(non_snake_case)]
5587 pub unsafe extern "system" fn vkGetPhysicalDevicePresentRectanglesKHR(
5588 _physicalDevice: api::VkPhysicalDevice,
5589 _surface: api::VkSurfaceKHR,
5590 _pRectCount: *mut u32,
5591 _pRects: *mut api::VkRect2D,
5592 ) -> api::VkResult {
5593 unimplemented!()
5594 }
5595
5596 #[allow(non_snake_case)]
5597 pub unsafe extern "system" fn vkAcquireNextImage2KHR(
5598 _device: api::VkDevice,
5599 _pAcquireInfo: *const api::VkAcquireNextImageInfoKHR,
5600 _pImageIndex: *mut u32,
5601 ) -> api::VkResult {
5602 unimplemented!()
5603 }
5604
5605 #[allow(non_snake_case)]
5606 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPropertiesKHR(
5607 _physicalDevice: api::VkPhysicalDevice,
5608 _pPropertyCount: *mut u32,
5609 _pProperties: *mut api::VkDisplayPropertiesKHR,
5610 ) -> api::VkResult {
5611 unimplemented!()
5612 }
5613
5614 #[allow(non_snake_case)]
5615 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5616 _physicalDevice: api::VkPhysicalDevice,
5617 _pPropertyCount: *mut u32,
5618 _pProperties: *mut api::VkDisplayPlanePropertiesKHR,
5619 ) -> api::VkResult {
5620 unimplemented!()
5621 }
5622
5623 #[allow(non_snake_case)]
5624 pub unsafe extern "system" fn vkGetDisplayPlaneSupportedDisplaysKHR(
5625 _physicalDevice: api::VkPhysicalDevice,
5626 _planeIndex: u32,
5627 _pDisplayCount: *mut u32,
5628 _pDisplays: *mut api::VkDisplayKHR,
5629 ) -> api::VkResult {
5630 unimplemented!()
5631 }
5632
5633 #[allow(non_snake_case)]
5634 pub unsafe extern "system" fn vkGetDisplayModePropertiesKHR(
5635 _physicalDevice: api::VkPhysicalDevice,
5636 _display: api::VkDisplayKHR,
5637 _pPropertyCount: *mut u32,
5638 _pProperties: *mut api::VkDisplayModePropertiesKHR,
5639 ) -> api::VkResult {
5640 unimplemented!()
5641 }
5642
5643 #[allow(non_snake_case)]
5644 pub unsafe extern "system" fn vkCreateDisplayModeKHR(
5645 _physicalDevice: api::VkPhysicalDevice,
5646 _display: api::VkDisplayKHR,
5647 _pCreateInfo: *const api::VkDisplayModeCreateInfoKHR,
5648 _pAllocator: *const api::VkAllocationCallbacks,
5649 _pMode: *mut api::VkDisplayModeKHR,
5650 ) -> api::VkResult {
5651 unimplemented!()
5652 }
5653
5654 #[allow(non_snake_case)]
5655 pub unsafe extern "system" fn vkGetDisplayPlaneCapabilitiesKHR(
5656 _physicalDevice: api::VkPhysicalDevice,
5657 _mode: api::VkDisplayModeKHR,
5658 _planeIndex: u32,
5659 _pCapabilities: *mut api::VkDisplayPlaneCapabilitiesKHR,
5660 ) -> api::VkResult {
5661 unimplemented!()
5662 }
5663
5664 #[allow(non_snake_case)]
5665 pub unsafe extern "system" fn vkCreateDisplayPlaneSurfaceKHR(
5666 _instance: api::VkInstance,
5667 _pCreateInfo: *const api::VkDisplaySurfaceCreateInfoKHR,
5668 _pAllocator: *const api::VkAllocationCallbacks,
5669 _pSurface: *mut api::VkSurfaceKHR,
5670 ) -> api::VkResult {
5671 unimplemented!()
5672 }
5673
5674 #[allow(non_snake_case)]
5675 pub unsafe extern "system" fn vkCreateSharedSwapchainsKHR(
5676 _device: api::VkDevice,
5677 _swapchainCount: u32,
5678 _pCreateInfos: *const api::VkSwapchainCreateInfoKHR,
5679 _pAllocator: *const api::VkAllocationCallbacks,
5680 _pSwapchains: *mut api::VkSwapchainKHR,
5681 ) -> api::VkResult {
5682 unimplemented!()
5683 }
5684
5685 #[allow(non_snake_case)]
5686 pub unsafe extern "system" fn vkGetMemoryFdKHR(
5687 _device: api::VkDevice,
5688 _pGetFdInfo: *const api::VkMemoryGetFdInfoKHR,
5689 _pFd: *mut c_int,
5690 ) -> api::VkResult {
5691 unimplemented!()
5692 }
5693
5694 #[allow(non_snake_case)]
5695 pub unsafe extern "system" fn vkGetMemoryFdPropertiesKHR(
5696 _device: api::VkDevice,
5697 _handleType: api::VkExternalMemoryHandleTypeFlagBits,
5698 _fd: c_int,
5699 _pMemoryFdProperties: *mut api::VkMemoryFdPropertiesKHR,
5700 ) -> api::VkResult {
5701 unimplemented!()
5702 }
5703
5704 #[allow(non_snake_case)]
5705 pub unsafe extern "system" fn vkImportSemaphoreFdKHR(
5706 _device: api::VkDevice,
5707 _pImportSemaphoreFdInfo: *const api::VkImportSemaphoreFdInfoKHR,
5708 ) -> api::VkResult {
5709 unimplemented!()
5710 }
5711
5712 #[allow(non_snake_case)]
5713 pub unsafe extern "system" fn vkGetSemaphoreFdKHR(
5714 _device: api::VkDevice,
5715 _pGetFdInfo: *const api::VkSemaphoreGetFdInfoKHR,
5716 _pFd: *mut c_int,
5717 ) -> api::VkResult {
5718 unimplemented!()
5719 }
5720
5721 #[allow(non_snake_case)]
5722 pub unsafe extern "system" fn vkCmdPushDescriptorSetKHR(
5723 _commandBuffer: api::VkCommandBuffer,
5724 _pipelineBindPoint: api::VkPipelineBindPoint,
5725 _layout: api::VkPipelineLayout,
5726 _set: u32,
5727 _descriptorWriteCount: u32,
5728 _pDescriptorWrites: *const api::VkWriteDescriptorSet,
5729 ) {
5730 unimplemented!()
5731 }
5732
5733 #[allow(non_snake_case)]
5734 pub unsafe extern "system" fn vkCmdPushDescriptorSetWithTemplateKHR(
5735 _commandBuffer: api::VkCommandBuffer,
5736 _descriptorUpdateTemplate: api::VkDescriptorUpdateTemplate,
5737 _layout: api::VkPipelineLayout,
5738 _set: u32,
5739 _pData: *const c_void,
5740 ) {
5741 unimplemented!()
5742 }
5743
5744 #[allow(non_snake_case)]
5745 pub unsafe extern "system" fn vkCreateRenderPass2KHR(
5746 _device: api::VkDevice,
5747 _pCreateInfo: *const api::VkRenderPassCreateInfo2KHR,
5748 _pAllocator: *const api::VkAllocationCallbacks,
5749 _pRenderPass: *mut api::VkRenderPass,
5750 ) -> api::VkResult {
5751 unimplemented!()
5752 }
5753
5754 #[allow(non_snake_case)]
5755 pub unsafe extern "system" fn vkCmdBeginRenderPass2KHR(
5756 _commandBuffer: api::VkCommandBuffer,
5757 _pRenderPassBegin: *const api::VkRenderPassBeginInfo,
5758 _pSubpassBeginInfo: *const api::VkSubpassBeginInfoKHR,
5759 ) {
5760 unimplemented!()
5761 }
5762
5763 #[allow(non_snake_case)]
5764 pub unsafe extern "system" fn vkCmdNextSubpass2KHR(
5765 _commandBuffer: api::VkCommandBuffer,
5766 _pSubpassBeginInfo: *const api::VkSubpassBeginInfoKHR,
5767 _pSubpassEndInfo: *const api::VkSubpassEndInfoKHR,
5768 ) {
5769 unimplemented!()
5770 }
5771
5772 #[allow(non_snake_case)]
5773 pub unsafe extern "system" fn vkCmdEndRenderPass2KHR(
5774 _commandBuffer: api::VkCommandBuffer,
5775 _pSubpassEndInfo: *const api::VkSubpassEndInfoKHR,
5776 ) {
5777 unimplemented!()
5778 }
5779
5780 #[allow(non_snake_case)]
5781 pub unsafe extern "system" fn vkGetSwapchainStatusKHR(
5782 _device: api::VkDevice,
5783 _swapchain: api::VkSwapchainKHR,
5784 ) -> api::VkResult {
5785 unimplemented!()
5786 }
5787
5788 #[allow(non_snake_case)]
5789 pub unsafe extern "system" fn vkImportFenceFdKHR(
5790 _device: api::VkDevice,
5791 _pImportFenceFdInfo: *const api::VkImportFenceFdInfoKHR,
5792 ) -> api::VkResult {
5793 unimplemented!()
5794 }
5795
5796 #[allow(non_snake_case)]
5797 pub unsafe extern "system" fn vkGetFenceFdKHR(
5798 _device: api::VkDevice,
5799 _pGetFdInfo: *const api::VkFenceGetFdInfoKHR,
5800 _pFd: *mut c_int,
5801 ) -> api::VkResult {
5802 unimplemented!()
5803 }
5804
5805 #[allow(non_snake_case)]
5806 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilities2KHR(
5807 _physical_device: api::VkPhysicalDevice,
5808 surface_info: *const api::VkPhysicalDeviceSurfaceInfo2KHR,
5809 surface_capabilities: *mut api::VkSurfaceCapabilities2KHR,
5810 ) -> api::VkResult {
5811 parse_next_chain_const!{
5812 surface_info,
5813 root = api::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
5814 }
5815 let ref surface_info = *surface_info;
5816 parse_next_chain_mut!{
5817 surface_capabilities,
5818 root = api::VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
5819 }
5820 let ref mut surface_capabilities = *surface_capabilities;
5821 let surface_implementation =
5822 SurfacePlatform::from(SharedHandle::from(surface_info.surface).unwrap().platform)
5823 .unwrap()
5824 .get_surface_implementation();
5825 match surface_implementation.get_capabilities(surface_info.surface) {
5826 Ok(capabilities) => {
5827 surface_capabilities.surfaceCapabilities = capabilities;
5828 api::VK_SUCCESS
5829 }
5830 Err(result) => result,
5831 }
5832 }
5833
5834 #[allow(non_snake_case)]
5835 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceFormats2KHR(
5836 _physicalDevice: api::VkPhysicalDevice,
5837 _pSurfaceInfo: *const api::VkPhysicalDeviceSurfaceInfo2KHR,
5838 _pSurfaceFormatCount: *mut u32,
5839 _pSurfaceFormats: *mut api::VkSurfaceFormat2KHR,
5840 ) -> api::VkResult {
5841 unimplemented!()
5842 }
5843
5844 #[allow(non_snake_case)]
5845 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayProperties2KHR(
5846 _physicalDevice: api::VkPhysicalDevice,
5847 _pPropertyCount: *mut u32,
5848 _pProperties: *mut api::VkDisplayProperties2KHR,
5849 ) -> api::VkResult {
5850 unimplemented!()
5851 }
5852
5853 #[allow(non_snake_case)]
5854 pub unsafe extern "system" fn vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
5855 _physicalDevice: api::VkPhysicalDevice,
5856 _pPropertyCount: *mut u32,
5857 _pProperties: *mut api::VkDisplayPlaneProperties2KHR,
5858 ) -> api::VkResult {
5859 unimplemented!()
5860 }
5861
5862 #[allow(non_snake_case)]
5863 pub unsafe extern "system" fn vkGetDisplayModeProperties2KHR(
5864 _physicalDevice: api::VkPhysicalDevice,
5865 _display: api::VkDisplayKHR,
5866 _pPropertyCount: *mut u32,
5867 _pProperties: *mut api::VkDisplayModeProperties2KHR,
5868 ) -> api::VkResult {
5869 unimplemented!()
5870 }
5871
5872 #[allow(non_snake_case)]
5873 pub unsafe extern "system" fn vkGetDisplayPlaneCapabilities2KHR(
5874 _physicalDevice: api::VkPhysicalDevice,
5875 _pDisplayPlaneInfo: *const api::VkDisplayPlaneInfo2KHR,
5876 _pCapabilities: *mut api::VkDisplayPlaneCapabilities2KHR,
5877 ) -> api::VkResult {
5878 unimplemented!()
5879 }
5880
5881 #[allow(non_snake_case)]
5882 pub unsafe extern "system" fn vkCmdDrawIndirectCountKHR(
5883 _commandBuffer: api::VkCommandBuffer,
5884 _buffer: api::VkBuffer,
5885 _offset: api::VkDeviceSize,
5886 _countBuffer: api::VkBuffer,
5887 _countBufferOffset: api::VkDeviceSize,
5888 _maxDrawCount: u32,
5889 _stride: u32,
5890 ) {
5891 unimplemented!()
5892 }
5893
5894 #[allow(non_snake_case)]
5895 pub unsafe extern "system" fn vkCmdDrawIndexedIndirectCountKHR(
5896 _commandBuffer: api::VkCommandBuffer,
5897 _buffer: api::VkBuffer,
5898 _offset: api::VkDeviceSize,
5899 _countBuffer: api::VkBuffer,
5900 _countBufferOffset: api::VkDeviceSize,
5901 _maxDrawCount: u32,
5902 _stride: u32,
5903 ) {
5904 unimplemented!()
5905 }
5906
5907 #[allow(non_snake_case)]
5908 pub unsafe extern "system" fn vkCreateDebugReportCallbackEXT(
5909 _instance: api::VkInstance,
5910 _pCreateInfo: *const api::VkDebugReportCallbackCreateInfoEXT,
5911 _pAllocator: *const api::VkAllocationCallbacks,
5912 _pCallback: *mut api::VkDebugReportCallbackEXT,
5913 ) -> api::VkResult {
5914 unimplemented!()
5915 }
5916
5917 #[allow(non_snake_case)]
5918 pub unsafe extern "system" fn vkDestroyDebugReportCallbackEXT(
5919 _instance: api::VkInstance,
5920 _callback: api::VkDebugReportCallbackEXT,
5921 _pAllocator: *const api::VkAllocationCallbacks,
5922 ) {
5923 unimplemented!()
5924 }
5925
5926 #[allow(non_snake_case)]
5927 pub unsafe extern "system" fn vkDebugReportMessageEXT(
5928 _instance: api::VkInstance,
5929 _flags: api::VkDebugReportFlagsEXT,
5930 _objectType: api::VkDebugReportObjectTypeEXT,
5931 _object: u64,
5932 _location: usize,
5933 _messageCode: i32,
5934 _pLayerPrefix: *const c_char,
5935 _pMessage: *const c_char,
5936 ) {
5937 unimplemented!()
5938 }
5939
5940 #[allow(non_snake_case)]
5941 pub unsafe extern "system" fn vkDebugMarkerSetObjectTagEXT(
5942 _device: api::VkDevice,
5943 _pTagInfo: *const api::VkDebugMarkerObjectTagInfoEXT,
5944 ) -> api::VkResult {
5945 unimplemented!()
5946 }
5947
5948 #[allow(non_snake_case)]
5949 pub unsafe extern "system" fn vkDebugMarkerSetObjectNameEXT(
5950 _device: api::VkDevice,
5951 _pNameInfo: *const api::VkDebugMarkerObjectNameInfoEXT,
5952 ) -> api::VkResult {
5953 unimplemented!()
5954 }
5955
5956 #[allow(non_snake_case)]
5957 pub unsafe extern "system" fn vkCmdDebugMarkerBeginEXT(
5958 _commandBuffer: api::VkCommandBuffer,
5959 _pMarkerInfo: *const api::VkDebugMarkerMarkerInfoEXT,
5960 ) {
5961 unimplemented!()
5962 }
5963
5964 #[allow(non_snake_case)]
5965 pub unsafe extern "system" fn vkCmdDebugMarkerEndEXT(_commandBuffer: api::VkCommandBuffer) {
5966 unimplemented!()
5967 }
5968
5969 #[allow(non_snake_case)]
5970 pub unsafe extern "system" fn vkCmdDebugMarkerInsertEXT(
5971 _commandBuffer: api::VkCommandBuffer,
5972 _pMarkerInfo: *const api::VkDebugMarkerMarkerInfoEXT,
5973 ) {
5974 unimplemented!()
5975 }
5976
5977 #[allow(non_snake_case)]
5978 pub unsafe extern "system" fn vkCmdDrawIndirectCountAMD(
5979 _commandBuffer: api::VkCommandBuffer,
5980 _buffer: api::VkBuffer,
5981 _offset: api::VkDeviceSize,
5982 _countBuffer: api::VkBuffer,
5983 _countBufferOffset: api::VkDeviceSize,
5984 _maxDrawCount: u32,
5985 _stride: u32,
5986 ) {
5987 unimplemented!()
5988 }
5989
5990 #[allow(non_snake_case)]
5991 pub unsafe extern "system" fn vkCmdDrawIndexedIndirectCountAMD(
5992 _commandBuffer: api::VkCommandBuffer,
5993 _buffer: api::VkBuffer,
5994 _offset: api::VkDeviceSize,
5995 _countBuffer: api::VkBuffer,
5996 _countBufferOffset: api::VkDeviceSize,
5997 _maxDrawCount: u32,
5998 _stride: u32,
5999 ) {
6000 unimplemented!()
6001 }
6002
6003 #[allow(non_snake_case)]
6004 pub unsafe extern "system" fn vkGetShaderInfoAMD(
6005 _device: api::VkDevice,
6006 _pipeline: api::VkPipeline,
6007 _shaderStage: api::VkShaderStageFlagBits,
6008 _infoType: api::VkShaderInfoTypeAMD,
6009 _pInfoSize: *mut usize,
6010 _pInfo: *mut c_void,
6011 ) -> api::VkResult {
6012 unimplemented!()
6013 }
6014
6015 #[allow(non_snake_case)]
6016 pub unsafe extern "system" fn vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6017 _physicalDevice: api::VkPhysicalDevice,
6018 _format: api::VkFormat,
6019 _type_: api::VkImageType,
6020 _tiling: api::VkImageTiling,
6021 _usage: api::VkImageUsageFlags,
6022 _flags: api::VkImageCreateFlags,
6023 _externalHandleType: api::VkExternalMemoryHandleTypeFlagsNV,
6024 _pExternalImageFormatProperties: *mut api::VkExternalImageFormatPropertiesNV,
6025 ) -> api::VkResult {
6026 unimplemented!()
6027 }
6028
6029 #[allow(non_snake_case)]
6030 pub unsafe extern "system" fn vkCmdBeginConditionalRenderingEXT(
6031 _commandBuffer: api::VkCommandBuffer,
6032 _pConditionalRenderingBegin: *const api::VkConditionalRenderingBeginInfoEXT,
6033 ) {
6034 unimplemented!()
6035 }
6036
6037 #[allow(non_snake_case)]
6038 pub unsafe extern "system" fn vkCmdEndConditionalRenderingEXT(
6039 _commandBuffer: api::VkCommandBuffer,
6040 ) {
6041 unimplemented!()
6042 }
6043
6044 #[allow(non_snake_case)]
6045 pub unsafe extern "system" fn vkCmdSetViewportWScalingNV(
6046 _commandBuffer: api::VkCommandBuffer,
6047 _firstViewport: u32,
6048 _viewportCount: u32,
6049 _pViewportWScalings: *const api::VkViewportWScalingNV,
6050 ) {
6051 unimplemented!()
6052 }
6053
6054 #[allow(non_snake_case)]
6055 pub unsafe extern "system" fn vkReleaseDisplayEXT(
6056 _physicalDevice: api::VkPhysicalDevice,
6057 _display: api::VkDisplayKHR,
6058 ) -> api::VkResult {
6059 unimplemented!()
6060 }
6061
6062 #[allow(non_snake_case)]
6063 pub unsafe extern "system" fn vkGetPhysicalDeviceSurfaceCapabilities2EXT(
6064 _physicalDevice: api::VkPhysicalDevice,
6065 _surface: api::VkSurfaceKHR,
6066 _pSurfaceCapabilities: *mut api::VkSurfaceCapabilities2EXT,
6067 ) -> api::VkResult {
6068 unimplemented!()
6069 }
6070
6071 #[allow(non_snake_case)]
6072 pub unsafe extern "system" fn vkDisplayPowerControlEXT(
6073 _device: api::VkDevice,
6074 _display: api::VkDisplayKHR,
6075 _pDisplayPowerInfo: *const api::VkDisplayPowerInfoEXT,
6076 ) -> api::VkResult {
6077 unimplemented!()
6078 }
6079
6080 #[allow(non_snake_case)]
6081 pub unsafe extern "system" fn vkRegisterDeviceEventEXT(
6082 _device: api::VkDevice,
6083 _pDeviceEventInfo: *const api::VkDeviceEventInfoEXT,
6084 _pAllocator: *const api::VkAllocationCallbacks,
6085 _pFence: *mut api::VkFence,
6086 ) -> api::VkResult {
6087 unimplemented!()
6088 }
6089
6090 #[allow(non_snake_case)]
6091 pub unsafe extern "system" fn vkRegisterDisplayEventEXT(
6092 _device: api::VkDevice,
6093 _display: api::VkDisplayKHR,
6094 _pDisplayEventInfo: *const api::VkDisplayEventInfoEXT,
6095 _pAllocator: *const api::VkAllocationCallbacks,
6096 _pFence: *mut api::VkFence,
6097 ) -> api::VkResult {
6098 unimplemented!()
6099 }
6100
6101 #[allow(non_snake_case)]
6102 pub unsafe extern "system" fn vkGetSwapchainCounterEXT(
6103 _device: api::VkDevice,
6104 _swapchain: api::VkSwapchainKHR,
6105 _counter: api::VkSurfaceCounterFlagBitsEXT,
6106 _pCounterValue: *mut u64,
6107 ) -> api::VkResult {
6108 unimplemented!()
6109 }
6110
6111 #[allow(non_snake_case)]
6112 pub unsafe extern "system" fn vkGetRefreshCycleDurationGOOGLE(
6113 _device: api::VkDevice,
6114 _swapchain: api::VkSwapchainKHR,
6115 _pDisplayTimingProperties: *mut api::VkRefreshCycleDurationGOOGLE,
6116 ) -> api::VkResult {
6117 unimplemented!()
6118 }
6119
6120 #[allow(non_snake_case)]
6121 pub unsafe extern "system" fn vkGetPastPresentationTimingGOOGLE(
6122 _device: api::VkDevice,
6123 _swapchain: api::VkSwapchainKHR,
6124 _pPresentationTimingCount: *mut u32,
6125 _pPresentationTimings: *mut api::VkPastPresentationTimingGOOGLE,
6126 ) -> api::VkResult {
6127 unimplemented!()
6128 }
6129
6130 #[allow(non_snake_case)]
6131 pub unsafe extern "system" fn vkCmdSetDiscardRectangleEXT(
6132 _commandBuffer: api::VkCommandBuffer,
6133 _firstDiscardRectangle: u32,
6134 _discardRectangleCount: u32,
6135 _pDiscardRectangles: *const api::VkRect2D,
6136 ) {
6137 unimplemented!()
6138 }
6139
6140 #[allow(non_snake_case)]
6141 pub unsafe extern "system" fn vkSetHdrMetadataEXT(
6142 _device: api::VkDevice,
6143 _swapchainCount: u32,
6144 _pSwapchains: *const api::VkSwapchainKHR,
6145 _pMetadata: *const api::VkHdrMetadataEXT,
6146 ) {
6147 unimplemented!()
6148 }
6149
6150 #[allow(non_snake_case)]
6151 pub unsafe extern "system" fn vkSetDebugUtilsObjectNameEXT(
6152 _device: api::VkDevice,
6153 _pNameInfo: *const api::VkDebugUtilsObjectNameInfoEXT,
6154 ) -> api::VkResult {
6155 unimplemented!()
6156 }
6157
6158 #[allow(non_snake_case)]
6159 pub unsafe extern "system" fn vkSetDebugUtilsObjectTagEXT(
6160 _device: api::VkDevice,
6161 _pTagInfo: *const api::VkDebugUtilsObjectTagInfoEXT,
6162 ) -> api::VkResult {
6163 unimplemented!()
6164 }
6165
6166 #[allow(non_snake_case)]
6167 pub unsafe extern "system" fn vkQueueBeginDebugUtilsLabelEXT(
6168 _queue: api::VkQueue,
6169 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6170 ) {
6171 unimplemented!()
6172 }
6173
6174 #[allow(non_snake_case)]
6175 pub unsafe extern "system" fn vkQueueEndDebugUtilsLabelEXT(_queue: api::VkQueue) {
6176 unimplemented!()
6177 }
6178
6179 #[allow(non_snake_case)]
6180 pub unsafe extern "system" fn vkQueueInsertDebugUtilsLabelEXT(
6181 _queue: api::VkQueue,
6182 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6183 ) {
6184 unimplemented!()
6185 }
6186
6187 #[allow(non_snake_case)]
6188 pub unsafe extern "system" fn vkCmdBeginDebugUtilsLabelEXT(
6189 _commandBuffer: api::VkCommandBuffer,
6190 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6191 ) {
6192 unimplemented!()
6193 }
6194
6195 #[allow(non_snake_case)]
6196 pub unsafe extern "system" fn vkCmdEndDebugUtilsLabelEXT(_commandBuffer: api::VkCommandBuffer) {
6197 unimplemented!()
6198 }
6199
6200 #[allow(non_snake_case)]
6201 pub unsafe extern "system" fn vkCmdInsertDebugUtilsLabelEXT(
6202 _commandBuffer: api::VkCommandBuffer,
6203 _pLabelInfo: *const api::VkDebugUtilsLabelEXT,
6204 ) {
6205 unimplemented!()
6206 }
6207
6208 #[allow(non_snake_case)]
6209 pub unsafe extern "system" fn vkCreateDebugUtilsMessengerEXT(
6210 _instance: api::VkInstance,
6211 _pCreateInfo: *const api::VkDebugUtilsMessengerCreateInfoEXT,
6212 _pAllocator: *const api::VkAllocationCallbacks,
6213 _pMessenger: *mut api::VkDebugUtilsMessengerEXT,
6214 ) -> api::VkResult {
6215 unimplemented!()
6216 }
6217
6218 #[allow(non_snake_case)]
6219 pub unsafe extern "system" fn vkDestroyDebugUtilsMessengerEXT(
6220 _instance: api::VkInstance,
6221 _messenger: api::VkDebugUtilsMessengerEXT,
6222 _pAllocator: *const api::VkAllocationCallbacks,
6223 ) {
6224 unimplemented!()
6225 }
6226
6227 #[allow(non_snake_case)]
6228 pub unsafe extern "system" fn vkSubmitDebugUtilsMessageEXT(
6229 _instance: api::VkInstance,
6230 _messageSeverity: api::VkDebugUtilsMessageSeverityFlagBitsEXT,
6231 _messageTypes: api::VkDebugUtilsMessageTypeFlagsEXT,
6232 _pCallbackData: *const api::VkDebugUtilsMessengerCallbackDataEXT,
6233 ) {
6234 unimplemented!()
6235 }
6236
6237 #[allow(non_snake_case)]
6238 pub unsafe extern "system" fn vkCmdSetSampleLocationsEXT(
6239 _commandBuffer: api::VkCommandBuffer,
6240 _pSampleLocationsInfo: *const api::VkSampleLocationsInfoEXT,
6241 ) {
6242 unimplemented!()
6243 }
6244
6245 #[allow(non_snake_case)]
6246 pub unsafe extern "system" fn vkGetPhysicalDeviceMultisamplePropertiesEXT(
6247 _physicalDevice: api::VkPhysicalDevice,
6248 _samples: api::VkSampleCountFlagBits,
6249 _pMultisampleProperties: *mut api::VkMultisamplePropertiesEXT,
6250 ) {
6251 unimplemented!()
6252 }
6253
6254 #[allow(non_snake_case)]
6255 pub unsafe extern "system" fn vkCreateValidationCacheEXT(
6256 _device: api::VkDevice,
6257 _pCreateInfo: *const api::VkValidationCacheCreateInfoEXT,
6258 _pAllocator: *const api::VkAllocationCallbacks,
6259 _pValidationCache: *mut api::VkValidationCacheEXT,
6260 ) -> api::VkResult {
6261 unimplemented!()
6262 }
6263
6264 #[allow(non_snake_case)]
6265 pub unsafe extern "system" fn vkDestroyValidationCacheEXT(
6266 _device: api::VkDevice,
6267 _validationCache: api::VkValidationCacheEXT,
6268 _pAllocator: *const api::VkAllocationCallbacks,
6269 ) {
6270 unimplemented!()
6271 }
6272
6273 #[allow(non_snake_case)]
6274 pub unsafe extern "system" fn vkMergeValidationCachesEXT(
6275 _device: api::VkDevice,
6276 _dstCache: api::VkValidationCacheEXT,
6277 _srcCacheCount: u32,
6278 _pSrcCaches: *const api::VkValidationCacheEXT,
6279 ) -> api::VkResult {
6280 unimplemented!()
6281 }
6282
6283 #[allow(non_snake_case)]
6284 pub unsafe extern "system" fn vkGetValidationCacheDataEXT(
6285 _device: api::VkDevice,
6286 _validationCache: api::VkValidationCacheEXT,
6287 _pDataSize: *mut usize,
6288 _pData: *mut c_void,
6289 ) -> api::VkResult {
6290 unimplemented!()
6291 }
6292
6293 #[allow(non_snake_case)]
6294 pub unsafe extern "system" fn vkCmdBindShadingRateImageNV(
6295 _commandBuffer: api::VkCommandBuffer,
6296 _imageView: api::VkImageView,
6297 _imageLayout: api::VkImageLayout,
6298 ) {
6299 unimplemented!()
6300 }
6301
6302 #[allow(non_snake_case)]
6303 pub unsafe extern "system" fn vkCmdSetViewportShadingRatePaletteNV(
6304 _commandBuffer: api::VkCommandBuffer,
6305 _firstViewport: u32,
6306 _viewportCount: u32,
6307 _pShadingRatePalettes: *const api::VkShadingRatePaletteNV,
6308 ) {
6309 unimplemented!()
6310 }
6311
6312 #[allow(non_snake_case)]
6313 pub unsafe extern "system" fn vkCmdSetCoarseSampleOrderNV(
6314 _commandBuffer: api::VkCommandBuffer,
6315 _sampleOrderType: api::VkCoarseSampleOrderTypeNV,
6316 _customSampleOrderCount: u32,
6317 _pCustomSampleOrders: *const api::VkCoarseSampleOrderCustomNV,
6318 ) {
6319 unimplemented!()
6320 }
6321
6322 #[allow(non_snake_case)]
6323 pub unsafe extern "system" fn vkGetMemoryHostPointerPropertiesEXT(
6324 _device: api::VkDevice,
6325 _handleType: api::VkExternalMemoryHandleTypeFlagBits,
6326 _pHostPointer: *const c_void,
6327 _pMemoryHostPointerProperties: *mut api::VkMemoryHostPointerPropertiesEXT,
6328 ) -> api::VkResult {
6329 unimplemented!()
6330 }
6331
6332 #[allow(non_snake_case)]
6333 pub unsafe extern "system" fn vkCmdWriteBufferMarkerAMD(
6334 _commandBuffer: api::VkCommandBuffer,
6335 _pipelineStage: api::VkPipelineStageFlagBits,
6336 _dstBuffer: api::VkBuffer,
6337 _dstOffset: api::VkDeviceSize,
6338 _marker: u32,
6339 ) {
6340 unimplemented!()
6341 }
6342
6343 #[allow(non_snake_case)]
6344 pub unsafe extern "system" fn vkCmdDrawMeshTasksNV(
6345 _commandBuffer: api::VkCommandBuffer,
6346 _taskCount: u32,
6347 _firstTask: u32,
6348 ) {
6349 unimplemented!()
6350 }
6351
6352 #[allow(non_snake_case)]
6353 pub unsafe extern "system" fn vkCmdDrawMeshTasksIndirectNV(
6354 _commandBuffer: api::VkCommandBuffer,
6355 _buffer: api::VkBuffer,
6356 _offset: api::VkDeviceSize,
6357 _drawCount: u32,
6358 _stride: u32,
6359 ) {
6360 unimplemented!()
6361 }
6362
6363 #[allow(non_snake_case)]
6364 pub unsafe extern "system" fn vkCmdDrawMeshTasksIndirectCountNV(
6365 _commandBuffer: api::VkCommandBuffer,
6366 _buffer: api::VkBuffer,
6367 _offset: api::VkDeviceSize,
6368 _countBuffer: api::VkBuffer,
6369 _countBufferOffset: api::VkDeviceSize,
6370 _maxDrawCount: u32,
6371 _stride: u32,
6372 ) {
6373 unimplemented!()
6374 }
6375
6376 #[allow(non_snake_case)]
6377 pub unsafe extern "system" fn vkCmdSetExclusiveScissorNV(
6378 _commandBuffer: api::VkCommandBuffer,
6379 _firstExclusiveScissor: u32,
6380 _exclusiveScissorCount: u32,
6381 _pExclusiveScissors: *const api::VkRect2D,
6382 ) {
6383 unimplemented!()
6384 }
6385
6386 #[allow(non_snake_case)]
6387 pub unsafe extern "system" fn vkCmdSetCheckpointNV(
6388 _commandBuffer: api::VkCommandBuffer,
6389 _pCheckpointMarker: *const c_void,
6390 ) {
6391 unimplemented!()
6392 }
6393
6394 #[allow(non_snake_case)]
6395 pub unsafe extern "system" fn vkGetQueueCheckpointDataNV(
6396 _queue: api::VkQueue,
6397 _pCheckpointDataCount: *mut u32,
6398 _pCheckpointData: *mut api::VkCheckpointDataNV,
6399 ) {
6400 unimplemented!()
6401 }
6402
6403 #[cfg(unix)]
6404 #[allow(non_snake_case)]
6405 pub unsafe extern "system" fn vkCreateXcbSurfaceKHR(
6406 _instance: api::VkInstance,
6407 create_info: *const api::VkXcbSurfaceCreateInfoKHR,
6408 _allocator: *const api::VkAllocationCallbacks,
6409 surface: *mut api::VkSurfaceKHR,
6410 ) -> api::VkResult {
6411 parse_next_chain_const!{
6412 create_info,
6413 root = api::VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
6414 }
6415 let ref create_info = *create_info;
6416 let new_surface = Box::new(api::VkIcdSurfaceXcb {
6417 base: api::VkIcdSurfaceBase {
6418 platform: api::VK_ICD_WSI_PLATFORM_XCB,
6419 },
6420 connection: create_info.connection,
6421 window: create_info.window,
6422 });
6423 *surface = api::VkSurfaceKHR::new(NonNull::new(
6424 Box::into_raw(new_surface) as *mut api::VkIcdSurfaceBase
6425 ));
6426 api::VK_SUCCESS
6427 }
6428
6429 #[cfg(unix)]
6430 #[allow(non_snake_case)]
6431 pub unsafe extern "system" fn vkGetPhysicalDeviceXcbPresentationSupportKHR(
6432 _physicalDevice: api::VkPhysicalDevice,
6433 _queueFamilyIndex: u32,
6434 _connection: *mut xcb::ffi::xcb_connection_t,
6435 _visual_id: xcb::ffi::xcb_visualid_t,
6436 ) -> api::VkBool32 {
6437 unimplemented!()
6438 }