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