diff --git a/libportability-gfx/src/conv.rs b/libportability-gfx/src/conv.rs index 44545da..bb252fb 100644 --- a/libportability-gfx/src/conv.rs +++ b/libportability-gfx/src/conv.rs @@ -1,11 +1,10 @@ use hal::{buffer, command, device, format, image, memory, pass, pso, query, window}; -use hal::{IndexType, Features, Limits, PatchSize, Primitive}; +use hal::{Features, IndexType, Limits, PatchSize, Primitive}; use std::mem; use super::*; - pub fn limits_from_hal(limits: Limits) -> VkPhysicalDeviceLimits { let viewport_size = limits.max_viewport_dimensions[0].max(limits.max_viewport_dimensions[1]); VkPhysicalDeviceLimits { @@ -53,7 +52,7 @@ pub fn limits_from_hal(limits: Limits) -> VkPhysicalDeviceLimits { maxPerStageDescriptorSamplers: limits.max_per_stage_descriptor_samplers as _, maxDescriptorSetSampledImages: limits.max_descriptor_set_sampled_images as _, maxDescriptorSetSamplers: limits.max_descriptor_set_samplers as _, - .. unsafe { mem::zeroed() } //TODO + ..unsafe { mem::zeroed() } //TODO } } @@ -86,16 +85,33 @@ pub fn features_from_hal(features: Features) -> VkPhysicalDeviceFeatures { pipelineStatisticsQuery: features.contains(Features::PIPELINE_STATISTICS_QUERY) as _, vertexPipelineStoresAndAtomics: features.contains(Features::VERTEX_STORES_AND_ATOMICS) as _, fragmentStoresAndAtomics: features.contains(Features::FRAGMENT_STORES_AND_ATOMICS) as _, - shaderTessellationAndGeometryPointSize: features.contains(Features::SHADER_TESSELLATION_AND_GEOMETRY_POINT_SIZE) as _, + shaderTessellationAndGeometryPointSize: features + .contains(Features::SHADER_TESSELLATION_AND_GEOMETRY_POINT_SIZE) + as _, shaderImageGatherExtended: features.contains(Features::SHADER_IMAGE_GATHER_EXTENDED) as _, - shaderStorageImageExtendedFormats: features.contains(Features::SHADER_STORAGE_IMAGE_EXTENDED_FORMATS) as _, - shaderStorageImageMultisample: features.contains(Features::SHADER_STORAGE_IMAGE_MULTISAMPLE) as _, - shaderStorageImageReadWithoutFormat: features.contains(Features::SHADER_STORAGE_IMAGE_READ_WITHOUT_FORMAT) as _, - shaderStorageImageWriteWithoutFormat: features.contains(Features::SHADER_STORAGE_IMAGE_WRITE_WITHOUT_FORMAT) as _, - shaderUniformBufferArrayDynamicIndexing: features.contains(Features::SHADER_UNIFORM_BUFFER_ARRAY_DYNAMIC_INDEXING) as _, - shaderSampledImageArrayDynamicIndexing: features.contains(Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING) as _, - shaderStorageBufferArrayDynamicIndexing: features.contains(Features::SHADER_STORAGE_BUFFER_ARRAY_DYNAMIC_INDEXING) as _, - shaderStorageImageArrayDynamicIndexing: features.contains(Features::SHADER_STORAGE_IMAGE_ARRAY_DYNAMIC_INDEXING) as _, + shaderStorageImageExtendedFormats: features + .contains(Features::SHADER_STORAGE_IMAGE_EXTENDED_FORMATS) + as _, + shaderStorageImageMultisample: features.contains(Features::SHADER_STORAGE_IMAGE_MULTISAMPLE) + as _, + shaderStorageImageReadWithoutFormat: features + .contains(Features::SHADER_STORAGE_IMAGE_READ_WITHOUT_FORMAT) + as _, + shaderStorageImageWriteWithoutFormat: features + .contains(Features::SHADER_STORAGE_IMAGE_WRITE_WITHOUT_FORMAT) + as _, + shaderUniformBufferArrayDynamicIndexing: features + .contains(Features::SHADER_UNIFORM_BUFFER_ARRAY_DYNAMIC_INDEXING) + as _, + shaderSampledImageArrayDynamicIndexing: features + .contains(Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING) + as _, + shaderStorageBufferArrayDynamicIndexing: features + .contains(Features::SHADER_STORAGE_BUFFER_ARRAY_DYNAMIC_INDEXING) + as _, + shaderStorageImageArrayDynamicIndexing: features + .contains(Features::SHADER_STORAGE_IMAGE_ARRAY_DYNAMIC_INDEXING) + as _, shaderClipDistance: features.contains(Features::SHADER_CLIP_DISTANCE) as _, shaderCullDistance: features.contains(Features::SHADER_CULL_DISTANCE) as _, shaderFloat64: features.contains(Features::SHADER_FLOAT64) as _, @@ -131,7 +147,9 @@ pub fn format_properties_from_hal(properties: format::Properties) -> VkFormatPro } } -pub fn image_format_properties_from_hal(properties: image::FormatProperties) -> VkImageFormatProperties { +pub fn image_format_properties_from_hal( + properties: image::FormatProperties, +) -> VkImageFormatProperties { VkImageFormatProperties { maxExtent: extent3d_from_hal(properties.max_extent), maxMipLevels: properties.max_levels as _, @@ -284,9 +302,16 @@ pub fn map_image_kind( debug_assert_ne!(array_layers, 0); match ty { VkImageType::VK_IMAGE_TYPE_1D => image::Kind::D1(extent.width as _, array_layers), - VkImageType::VK_IMAGE_TYPE_2D => image::Kind::D2(extent.width as _, extent.height as _, array_layers, samples as _), - VkImageType::VK_IMAGE_TYPE_3D => image::Kind::D3(extent.width as _, extent.height as _, extent.depth as _), - _ => unreachable!() + VkImageType::VK_IMAGE_TYPE_2D => image::Kind::D2( + extent.width as _, + extent.height as _, + array_layers, + samples as _, + ), + VkImageType::VK_IMAGE_TYPE_3D => { + image::Kind::D3(extent.width as _, extent.height as _, extent.depth as _) + } + _ => unreachable!(), } } @@ -299,7 +324,7 @@ pub fn map_view_kind(ty: VkImageViewType) -> image::ViewKind { VkImageViewType::VK_IMAGE_VIEW_TYPE_3D => image::ViewKind::D3, VkImageViewType::VK_IMAGE_VIEW_TYPE_CUBE => image::ViewKind::Cube, VkImageViewType::VK_IMAGE_VIEW_TYPE_CUBE_ARRAY => image::ViewKind::CubeArray, - _ => unreachable!() + _ => unreachable!(), } } @@ -309,8 +334,12 @@ pub fn map_image_layout(layout: VkImageLayout) -> image::Layout { VkImageLayout::VK_IMAGE_LAYOUT_UNDEFINED => Undefined, VkImageLayout::VK_IMAGE_LAYOUT_GENERAL => General, VkImageLayout::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL => ColorAttachmentOptimal, - VkImageLayout::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL => DepthStencilAttachmentOptimal, - VkImageLayout::VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL => DepthStencilReadOnlyOptimal, + VkImageLayout::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL => { + DepthStencilAttachmentOptimal + } + VkImageLayout::VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL => { + DepthStencilReadOnlyOptimal + } VkImageLayout::VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL => ShaderReadOnlyOptimal, VkImageLayout::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL => TransferSrcOptimal, VkImageLayout::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL => TransferDstOptimal, @@ -560,8 +589,9 @@ pub fn map_attachment_store_op(op: VkAttachmentStoreOp) -> pass::AttachmentStore pub fn map_subpass_contents(contents: VkSubpassContents) -> command::SubpassContents { match contents { VkSubpassContents::VK_SUBPASS_CONTENTS_INLINE => command::SubpassContents::Inline, - VkSubpassContents::VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS => - command::SubpassContents::SecondaryBuffers, + VkSubpassContents::VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS => { + command::SubpassContents::SecondaryBuffers + } _ => panic!("Unexpected subpass contents: {:?}", contents), } @@ -570,7 +600,7 @@ pub fn map_subpass_contents(contents: VkSubpassContents) -> command::SubpassCont pub fn map_stencil_face(face: VkStencilFaceFlags) -> pso::Face { match unsafe { mem::transmute(face) } { VkStencilFaceFlagBits::VK_STENCIL_FACE_FRONT_BIT => pso::Face::FRONT, - VkStencilFaceFlagBits::VK_STENCIL_FACE_BACK_BIT => pso::Face::BACK, + VkStencilFaceFlagBits::VK_STENCIL_FACE_BACK_BIT => pso::Face::BACK, VkStencilFaceFlagBits::VK_STENCIL_FRONT_AND_BACK => pso::Face::all(), _ => panic!("Unexpected stencil face: {:?}", face), } @@ -594,7 +624,10 @@ pub fn map_front_face(face: VkFrontFace) -> pso::FrontFace { } } -pub fn map_primitive_topology(topology: VkPrimitiveTopology, patch_size: PatchSize) -> Option { +pub fn map_primitive_topology( + topology: VkPrimitiveTopology, + patch_size: PatchSize, +) -> Option { use super::VkPrimitiveTopology::*; Some(match topology { @@ -622,14 +655,15 @@ pub fn map_present_mode(present_mode: VkPresentModeKHR) -> window::PresentMode { pub fn map_composite_alpha(composite_alpha: VkCompositeAlphaFlagBitsKHR) -> window::CompositeAlpha { if composite_alpha == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR { window::CompositeAlpha::OPAQUE - } else - if composite_alpha == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR { + } else if composite_alpha + == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR + { window::CompositeAlpha::PREMULTIPLIED - } else - if composite_alpha == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR { + } else if composite_alpha + == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR + { window::CompositeAlpha::POSTMULTIPLIED - } else - if composite_alpha == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR { + } else if composite_alpha == VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR { window::CompositeAlpha::INHERIT } else { error!("Unrecognized composite alpha: {:?}", composite_alpha); @@ -674,21 +708,23 @@ fn map_blend_factor(factor: VkBlendFactor) -> pso::Factor { } pub fn map_blend_op( - blend_op: VkBlendOp, src_factor: VkBlendFactor, dst_factor: VkBlendFactor, + blend_op: VkBlendOp, + src_factor: VkBlendFactor, + dst_factor: VkBlendFactor, ) -> pso::BlendOp { use super::VkBlendOp::*; match blend_op { VK_BLEND_OP_ADD => pso::BlendOp::Add { src: map_blend_factor(src_factor), - dst: map_blend_factor(dst_factor) + dst: map_blend_factor(dst_factor), }, VK_BLEND_OP_SUBTRACT => pso::BlendOp::Sub { src: map_blend_factor(src_factor), - dst: map_blend_factor(dst_factor) + dst: map_blend_factor(dst_factor), }, VK_BLEND_OP_REVERSE_SUBTRACT => pso::BlendOp::RevSub { src: map_blend_factor(src_factor), - dst: map_blend_factor(dst_factor) + dst: map_blend_factor(dst_factor), }, VK_BLEND_OP_MIN => pso::BlendOp::Min, VK_BLEND_OP_MAX => pso::BlendOp::Max, @@ -706,7 +742,7 @@ pub fn map_filter(filter: VkFilter) -> image::Filter { match filter { VkFilter::VK_FILTER_NEAREST => image::Filter::Nearest, VkFilter::VK_FILTER_LINEAR => image::Filter::Linear, - _ => panic!("Unsupported filter {:?}", filter) + _ => panic!("Unsupported filter {:?}", filter), } } @@ -714,7 +750,7 @@ pub fn map_mipmap_filter(mode: VkSamplerMipmapMode) -> image::Filter { match mode { VkSamplerMipmapMode::VK_SAMPLER_MIPMAP_MODE_NEAREST => image::Filter::Nearest, VkSamplerMipmapMode::VK_SAMPLER_MIPMAP_MODE_LINEAR => image::Filter::Linear, - _ => panic!("Unsupported mipmap mode {:?}", mode) + _ => panic!("Unsupported mipmap mode {:?}", mode), } } @@ -761,7 +797,7 @@ pub fn map_clear_rect(rect: &VkClearRect) -> pso::ClearRect { let base = rect.baseArrayLayer as image::Layer; pso::ClearRect { rect: map_rect(&rect.rect), - layers: base .. base + rect.layerCount as image::Layer, + layers: base..base + rect.layerCount as image::Layer, } } @@ -773,7 +809,7 @@ pub fn map_viewport(vp: &VkViewport) -> pso::Viewport { w: vp.width as _, h: vp.height as _, }, - depth: vp.minDepth .. vp.maxDepth, + depth: vp.minDepth..vp.maxDepth, } } @@ -797,9 +833,9 @@ pub fn map_index_type(ty: VkIndexType) -> IndexType { pub fn map_query_type(ty: VkQueryType, statistic: VkQueryPipelineStatisticFlags) -> query::Type { match ty { VkQueryType::VK_QUERY_TYPE_OCCLUSION => query::Type::Occlusion, - VkQueryType::VK_QUERY_TYPE_PIPELINE_STATISTICS => query::Type::PipelineStatistics( - map_pipeline_statistics(statistic) - ), + VkQueryType::VK_QUERY_TYPE_PIPELINE_STATISTICS => { + query::Type::PipelineStatistics(map_pipeline_statistics(statistic)) + } VkQueryType::VK_QUERY_TYPE_TIMESTAMP => query::Type::Timestamp, _ => panic!("Unexpected query type: {:?}", ty), } diff --git a/libportability-gfx/src/handle.rs b/libportability-gfx/src/handle.rs index 33b1971..2cc7d47 100644 --- a/libportability-gfx/src/handle.rs +++ b/libportability-gfx/src/handle.rs @@ -1,17 +1,17 @@ -use VK_NULL_HANDLE; -use std::{borrow, cmp, fmt, ops}; #[cfg(feature = "nightly")] use std::sync::{Arc, Mutex}; +use std::{borrow, cmp, fmt, ops}; +use VK_NULL_HANDLE; #[cfg(feature = "nightly")] use hal::backend::FastHashMap; use copyless::{BoxAllocation, BoxHelper}; - #[cfg(feature = "nightly")] lazy_static! { - static ref REGISTRY: Arc>> = Arc::new(Mutex::new(FastHashMap::default())); + static ref REGISTRY: Arc>> = + Arc::new(Mutex::new(FastHashMap::default())); } #[repr(C)] @@ -141,9 +141,9 @@ pub type DispatchHandle = Handle; #[cfg(feature = "dispatch")] mod dispatch { - use VK_NULL_HANDLE; use copyless::{BoxAllocation, BoxHelper}; use std::{borrow, cmp, fmt, ops}; + use VK_NULL_HANDLE; const ICD_LOADER_MAGIC: u64 = 0x01CDC0DE; diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index ae0e4d6..7fba056 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -1,13 +1,13 @@ -use hal::{command as com, memory, pass, pso, queue}; -use hal::{Features, Instance}; use hal::adapter::PhysicalDevice; use hal::buffer::IndexBufferView; use hal::command::CommandBuffer; use hal::device::{Device, WaitFor}; -use hal::pso::DescriptorPool; use hal::pool::CommandPool as _; +use hal::pso::DescriptorPool; use hal::queue::{CommandQueue, QueueFamily}; use hal::window::{Surface, Swapchain as _}; +use hal::{command as com, memory, pass, pso, queue}; +use hal::{Features, Instance}; use std::borrow::Cow; #[cfg(feature = "gfx-backend-metal")] @@ -73,7 +73,10 @@ pub extern "C" fn gfxCreateInstance( "no" => false, other => panic!("unknown arguments option: {}", other), }; - println!("GFX: arguments override {:?}", backend.experiments.argument_buffers); + println!( + "GFX: arguments override {:?}", + backend.experiments.argument_buffers + ); } } @@ -90,8 +93,7 @@ pub extern "C" fn gfxCreateInstance( // Compare major and minor parts of version only - patch is ignored let (supported_major, supported_minor, _) = VERSION; let requested_major_minor = ai.apiVersion >> 12; - let version_supported = requested_major_minor - & (supported_major << 10 | supported_minor) + let version_supported = requested_major_minor & (supported_major << 10 | supported_minor) == requested_major_minor; if !version_supported { return VkResult::VK_ERROR_INCOMPATIBLE_DRIVER; @@ -101,16 +103,16 @@ pub extern "C" fn gfxCreateInstance( let mut enabled_extensions = Vec::new(); if create_info.enabledExtensionCount != 0 { for raw in unsafe { - slice::from_raw_parts(create_info.ppEnabledExtensionNames, create_info.enabledExtensionCount as _) + slice::from_raw_parts( + create_info.ppEnabledExtensionNames, + create_info.enabledExtensionCount as _, + ) } { let cstr = unsafe { CStr::from_ptr(*raw) }; if !INSTANCE_EXTENSION_NAMES.contains(&cstr.to_bytes_with_nul()) { return VkResult::VK_ERROR_EXTENSION_NOT_PRESENT; } - let owned = cstr - .to_str() - .expect("Invalid extension name") - .to_owned(); + let owned = cstr.to_str().expect("Invalid extension name").to_owned(); enabled_extensions.push(owned); } } @@ -198,10 +200,14 @@ pub extern "C" fn gfxGetPhysicalDeviceQueueFamilyProperties( | VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32 | VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32 } - hal::queue::QueueType::Graphics => VkQueueFlagBits::VK_QUEUE_GRAPHICS_BIT as u32 - | VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32, - hal::queue::QueueType::Compute => VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32 - | VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32, + hal::queue::QueueType::Graphics => { + VkQueueFlagBits::VK_QUEUE_GRAPHICS_BIT as u32 + | VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32 + } + hal::queue::QueueType::Compute => { + VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32 + | VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32 + } hal::queue::QueueType::Transfer => VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32, }, queueCount: family.max_queues() as _, @@ -235,15 +241,15 @@ pub extern "C" fn gfxGetPhysicalDeviceFeatures2KHR( while !ptr.is_null() { ptr = match unsafe { *ptr } { VkStructureType::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR => { - let data = unsafe { - (ptr as *mut VkPhysicalDeviceFeatures2KHR).as_mut().unwrap() - }; + let data = unsafe { (ptr as *mut VkPhysicalDeviceFeatures2KHR).as_mut().unwrap() }; data.features = conv::features_from_hal(features); data.pNext } - VkStructureType::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_EXTX =>{ + VkStructureType::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_EXTX => { let data = unsafe { - (ptr as *mut VkPhysicalDevicePortabilitySubsetFeaturesEXTX).as_mut().unwrap() + (ptr as *mut VkPhysicalDevicePortabilitySubsetFeaturesEXTX) + .as_mut() + .unwrap() }; if features.contains(hal::Features::TRIANGLE_FAN) { data.triangleFans = VK_TRUE; @@ -263,8 +269,11 @@ pub extern "C" fn gfxGetPhysicalDeviceFeatures2KHR( other => { warn!("Unrecognized {:?}, skipping", other); unsafe { - (ptr as *const VkPhysicalDeviceFeatures2KHR).as_ref().unwrap() - }.pNext + (ptr as *const VkPhysicalDeviceFeatures2KHR) + .as_ref() + .unwrap() + } + .pNext } } as *const VkStructureType; } @@ -275,7 +284,9 @@ pub extern "C" fn gfxGetPhysicalDeviceFormatProperties( format: VkFormat, pFormatProperties: *mut VkFormatProperties, ) { - let properties = adapter.physical_device.format_properties(conv::map_format(format)); + let properties = adapter + .physical_device + .format_properties(conv::map_format(format)); unsafe { *pFormatProperties = conv::format_properties_from_hal(properties); } @@ -285,7 +296,8 @@ fn get_physical_device_image_format_properties( adapter: VkPhysicalDevice, info: &VkPhysicalDeviceImageFormatInfo2KHR, ) -> Option { - adapter.physical_device + adapter + .physical_device .image_format_properties( conv::map_format(info.format).unwrap(), match info.type_ { @@ -317,7 +329,7 @@ pub extern "C" fn gfxGetPhysicalDeviceImageFormatProperties( type_, tiling, usage, - flags + flags, }; match get_physical_device_image_format_properties(adapter, &info) { Some(props) => unsafe { @@ -340,14 +352,18 @@ pub extern "C" fn gfxGetPhysicalDeviceImageFormatProperties2KHR( ptr = match unsafe { *ptr } { VkStructureType::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR => { let data = unsafe { - (ptr as *const VkPhysicalDeviceImageFormatInfo2KHR).as_ref().unwrap() + (ptr as *const VkPhysicalDeviceImageFormatInfo2KHR) + .as_ref() + .unwrap() }; properties = get_physical_device_image_format_properties(adapter, data); data.pNext } VkStructureType::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_SUPPORT_EXTX => { let data = unsafe { - (ptr as *const VkPhysicalDeviceImageViewSupportEXTX).as_ref().unwrap() + (ptr as *const VkPhysicalDeviceImageViewSupportEXTX) + .as_ref() + .unwrap() }; #[cfg(feature = "gfx-backend-metal")] { @@ -363,8 +379,11 @@ pub extern "C" fn gfxGetPhysicalDeviceImageFormatProperties2KHR( other => { warn!("Unrecognized {:?}, skipping", other); unsafe { - (ptr as *const VkPhysicalDeviceImageFormatInfo2KHR).as_ref().unwrap() - }.pNext + (ptr as *const VkPhysicalDeviceImageFormatInfo2KHR) + .as_ref() + .unwrap() + } + .pNext } } as *const VkStructureType; } @@ -494,7 +513,7 @@ pub extern "C" fn gfxGetInstanceProcAddr( return device_addr; } - proc_addr!{ name, + proc_addr! { name, vkCreateInstance, PFN_vkCreateInstance => gfxCreateInstance, vkDestroyInstance, PFN_vkDestroyInstance => gfxDestroyInstance, vkCreateDevice, PFN_vkCreateDevice => gfxCreateDevice, @@ -552,9 +571,14 @@ pub extern "C" fn gfxGetDeviceProcAddr( | "vkAcquireNextImageKHR" | "vkQueuePresentKHR" => { let search_name = str::from_utf8( - &VK_KHR_SWAPCHAIN_EXTENSION_NAME[.. VK_KHR_SWAPCHAIN_EXTENSION_NAME.len()-1] - ).unwrap(); - if !device.enabled_extensions.iter().any(|ext| ext == search_name) { + &VK_KHR_SWAPCHAIN_EXTENSION_NAME[..VK_KHR_SWAPCHAIN_EXTENSION_NAME.len() - 1], + ) + .unwrap(); + if !device + .enabled_extensions + .iter() + .any(|ext| ext == search_name) + { return None; } } @@ -562,7 +586,7 @@ pub extern "C" fn gfxGetDeviceProcAddr( } } - proc_addr!{ name, + proc_addr! { name, vkGetDeviceProcAddr, PFN_vkGetDeviceProcAddr => gfxGetDeviceProcAddr, vkDestroyDevice, PFN_vkDestroyDevice => gfxDestroyDevice, vkGetDeviceMemoryCommitment, PFN_vkGetDeviceMemoryCommitment => gfxGetDeviceMemoryCommitment, @@ -732,69 +756,79 @@ pub extern "C" fn gfxCreateDevice( .iter() .map(|info| { let family = &adapter.queue_families[info.queueFamilyIndex as usize]; - (family, &priorities[.. info.queueCount as usize]) + (family, &priorities[..info.queueCount as usize]) }) .collect::>(); let enabled = if let Some(ef) = unsafe { dev_info.pEnabledFeatures.as_ref() } { fn feat(on: u32, flag: Features) -> Features { - if on != 0 { flag } else { Features::empty() } + if on != 0 { + flag + } else { + Features::empty() + } } - feat(ef.robustBufferAccess, Features::ROBUST_BUFFER_ACCESS) | - feat(ef.fullDrawIndexUint32, Features::FULL_DRAW_INDEX_U32) | - feat(ef.imageCubeArray, Features::IMAGE_CUBE_ARRAY) | - feat(ef.independentBlend, Features::INDEPENDENT_BLENDING) | - feat(ef.geometryShader, Features::GEOMETRY_SHADER) | - feat(ef.tessellationShader, Features::TESSELLATION_SHADER) | - feat(ef.sampleRateShading, Features::SAMPLE_RATE_SHADING) | - feat(ef.dualSrcBlend, Features::DUAL_SRC_BLENDING) | - feat(ef.logicOp, Features::LOGIC_OP) | - feat(ef.multiDrawIndirect, Features::MULTI_DRAW_INDIRECT) | - feat(ef.drawIndirectFirstInstance, Features::DRAW_INDIRECT_FIRST_INSTANCE) | - feat(ef.depthClamp, Features::DEPTH_CLAMP) | - feat(ef.depthBiasClamp, Features::DEPTH_BIAS_CLAMP) | - feat(ef.fillModeNonSolid, Features::NON_FILL_POLYGON_MODE) | - feat(ef.depthBounds, Features::DEPTH_BOUNDS) | - feat(ef.wideLines, Features::LINE_WIDTH) | - feat(ef.largePoints, Features::POINT_SIZE) | - feat(ef.alphaToOne, Features::ALPHA_TO_ONE) | - feat(ef.multiViewport, Features::MULTI_VIEWPORTS) | - feat(ef.samplerAnisotropy, Features::SAMPLER_ANISOTROPY) | - feat(ef.textureCompressionETC2, Features::FORMAT_ETC2) | - feat(ef.textureCompressionASTC_LDR, Features::FORMAT_ASTC_LDR) | - feat(ef.textureCompressionBC, Features::FORMAT_BC) | - feat(ef.occlusionQueryPrecise, Features::PRECISE_OCCLUSION_QUERY) | - feat(ef.pipelineStatisticsQuery, Features::PIPELINE_STATISTICS_QUERY) | - feat(ef.vertexPipelineStoresAndAtomics, Features::VERTEX_STORES_AND_ATOMICS) | - feat(ef.fragmentStoresAndAtomics, Features::FRAGMENT_STORES_AND_ATOMICS) | - feat(ef.shaderTessellationAndGeometryPointSize, Features::SHADER_TESSELLATION_AND_GEOMETRY_POINT_SIZE) | - feat(ef.shaderImageGatherExtended, Features::SHADER_IMAGE_GATHER_EXTENDED) | - feat(ef.shaderStorageImageExtendedFormats, Features::SHADER_STORAGE_IMAGE_EXTENDED_FORMATS) | - feat(ef.shaderStorageImageMultisample, Features::SHADER_STORAGE_IMAGE_MULTISAMPLE) | - feat(ef.shaderStorageImageReadWithoutFormat, Features::SHADER_STORAGE_IMAGE_READ_WITHOUT_FORMAT) | - feat(ef.shaderStorageImageWriteWithoutFormat, Features::SHADER_STORAGE_IMAGE_WRITE_WITHOUT_FORMAT) | - feat(ef.shaderUniformBufferArrayDynamicIndexing, Features::SHADER_UNIFORM_BUFFER_ARRAY_DYNAMIC_INDEXING) | - feat(ef.shaderSampledImageArrayDynamicIndexing, Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING) | - feat(ef.shaderStorageBufferArrayDynamicIndexing, Features::SHADER_STORAGE_BUFFER_ARRAY_DYNAMIC_INDEXING) | - feat(ef.shaderStorageImageArrayDynamicIndexing, Features::SHADER_STORAGE_IMAGE_ARRAY_DYNAMIC_INDEXING) | - feat(ef.shaderClipDistance, Features::SHADER_CLIP_DISTANCE) | - feat(ef.shaderCullDistance, Features::SHADER_CULL_DISTANCE) | - feat(ef.shaderFloat64, Features::SHADER_FLOAT64) | - feat(ef.shaderInt64, Features::SHADER_INT64) | - feat(ef.shaderInt16, Features::SHADER_INT16) | - feat(ef.shaderResourceResidency, Features::SHADER_RESOURCE_RESIDENCY) | - feat(ef.shaderResourceMinLod, Features::SHADER_RESOURCE_MIN_LOD) | - feat(ef.sparseBinding, Features::SPARSE_BINDING) | - feat(ef.sparseResidencyBuffer, Features::SPARSE_RESIDENCY_BUFFER) | - feat(ef.sparseResidencyImage2D, Features::SPARSE_RESIDENCY_IMAGE_2D) | - feat(ef.sparseResidencyImage3D, Features::SPARSE_RESIDENCY_IMAGE_3D) | - feat(ef.sparseResidency2Samples, Features::SPARSE_RESIDENCY_2_SAMPLES) | - feat(ef.sparseResidency4Samples, Features::SPARSE_RESIDENCY_4_SAMPLES) | - feat(ef.sparseResidency8Samples, Features::SPARSE_RESIDENCY_8_SAMPLES) | - feat(ef.sparseResidency16Samples, Features::SPARSE_RESIDENCY_16_SAMPLES) | - feat(ef.sparseResidencyAliased, Features::SPARSE_RESIDENCY_ALIASED) | - feat(ef.variableMultisampleRate, Features::VARIABLE_MULTISAMPLE_RATE) | - feat(ef.inheritedQueries, Features::INHERITED_QUERIES) + + // Attributes on expressions are experimental for now. Use function as workaround. + #[rustfmt::skip] + fn feats(ef: &VkPhysicalDeviceFeatures) -> Features { + feat(ef.robustBufferAccess, Features::ROBUST_BUFFER_ACCESS) | + feat(ef.fullDrawIndexUint32, Features::FULL_DRAW_INDEX_U32) | + feat(ef.imageCubeArray, Features::IMAGE_CUBE_ARRAY) | + feat(ef.independentBlend, Features::INDEPENDENT_BLENDING) | + feat(ef.geometryShader, Features::GEOMETRY_SHADER) | + feat(ef.tessellationShader, Features::TESSELLATION_SHADER) | + feat(ef.sampleRateShading, Features::SAMPLE_RATE_SHADING) | + feat(ef.dualSrcBlend, Features::DUAL_SRC_BLENDING) | + feat(ef.logicOp, Features::LOGIC_OP) | + feat(ef.multiDrawIndirect, Features::MULTI_DRAW_INDIRECT) | + feat(ef.drawIndirectFirstInstance, Features::DRAW_INDIRECT_FIRST_INSTANCE) | + feat(ef.depthClamp, Features::DEPTH_CLAMP) | + feat(ef.depthBiasClamp, Features::DEPTH_BIAS_CLAMP) | + feat(ef.fillModeNonSolid, Features::NON_FILL_POLYGON_MODE) | + feat(ef.depthBounds, Features::DEPTH_BOUNDS) | + feat(ef.wideLines, Features::LINE_WIDTH) | + feat(ef.largePoints, Features::POINT_SIZE) | + feat(ef.alphaToOne, Features::ALPHA_TO_ONE) | + feat(ef.multiViewport, Features::MULTI_VIEWPORTS) | + feat(ef.samplerAnisotropy, Features::SAMPLER_ANISOTROPY) | + feat(ef.textureCompressionETC2, Features::FORMAT_ETC2) | + feat(ef.textureCompressionASTC_LDR, Features::FORMAT_ASTC_LDR) | + feat(ef.textureCompressionBC, Features::FORMAT_BC) | + feat(ef.occlusionQueryPrecise, Features::PRECISE_OCCLUSION_QUERY) | + feat(ef.pipelineStatisticsQuery, Features::PIPELINE_STATISTICS_QUERY) | + feat(ef.vertexPipelineStoresAndAtomics, Features::VERTEX_STORES_AND_ATOMICS) | + feat(ef.fragmentStoresAndAtomics, Features::FRAGMENT_STORES_AND_ATOMICS) | + feat(ef.shaderTessellationAndGeometryPointSize, Features::SHADER_TESSELLATION_AND_GEOMETRY_POINT_SIZE) | + feat(ef.shaderImageGatherExtended, Features::SHADER_IMAGE_GATHER_EXTENDED) | + feat(ef.shaderStorageImageExtendedFormats, Features::SHADER_STORAGE_IMAGE_EXTENDED_FORMATS) | + feat(ef.shaderStorageImageMultisample, Features::SHADER_STORAGE_IMAGE_MULTISAMPLE) | + feat(ef.shaderStorageImageReadWithoutFormat, Features::SHADER_STORAGE_IMAGE_READ_WITHOUT_FORMAT) | + feat(ef.shaderStorageImageWriteWithoutFormat, Features::SHADER_STORAGE_IMAGE_WRITE_WITHOUT_FORMAT) | + feat(ef.shaderUniformBufferArrayDynamicIndexing, Features::SHADER_UNIFORM_BUFFER_ARRAY_DYNAMIC_INDEXING) | + feat(ef.shaderSampledImageArrayDynamicIndexing, Features::SHADER_SAMPLED_IMAGE_ARRAY_DYNAMIC_INDEXING) | + feat(ef.shaderStorageBufferArrayDynamicIndexing, Features::SHADER_STORAGE_BUFFER_ARRAY_DYNAMIC_INDEXING) | + feat(ef.shaderStorageImageArrayDynamicIndexing, Features::SHADER_STORAGE_IMAGE_ARRAY_DYNAMIC_INDEXING) | + feat(ef.shaderClipDistance, Features::SHADER_CLIP_DISTANCE) | + feat(ef.shaderCullDistance, Features::SHADER_CULL_DISTANCE) | + feat(ef.shaderFloat64, Features::SHADER_FLOAT64) | + feat(ef.shaderInt64, Features::SHADER_INT64) | + feat(ef.shaderInt16, Features::SHADER_INT16) | + feat(ef.shaderResourceResidency, Features::SHADER_RESOURCE_RESIDENCY) | + feat(ef.shaderResourceMinLod, Features::SHADER_RESOURCE_MIN_LOD) | + feat(ef.sparseBinding, Features::SPARSE_BINDING) | + feat(ef.sparseResidencyBuffer, Features::SPARSE_RESIDENCY_BUFFER) | + feat(ef.sparseResidencyImage2D, Features::SPARSE_RESIDENCY_IMAGE_2D) | + feat(ef.sparseResidencyImage3D, Features::SPARSE_RESIDENCY_IMAGE_3D) | + feat(ef.sparseResidency2Samples, Features::SPARSE_RESIDENCY_2_SAMPLES) | + feat(ef.sparseResidency4Samples, Features::SPARSE_RESIDENCY_4_SAMPLES) | + feat(ef.sparseResidency8Samples, Features::SPARSE_RESIDENCY_8_SAMPLES) | + feat(ef.sparseResidency16Samples, Features::SPARSE_RESIDENCY_16_SAMPLES) | + feat(ef.sparseResidencyAliased, Features::SPARSE_RESIDENCY_ALIASED) | + feat(ef.variableMultisampleRate, Features::VARIABLE_MULTISAMPLE_RATE) | + feat(ef.inheritedQueries, Features::INHERITED_QUERIES) + } + feats(&ef) } else { Features::empty() }; @@ -805,9 +839,7 @@ pub extern "C" fn gfxCreateDevice( RenderDoc::new().expect("Failed to init renderdoc") }; - let gpu = unsafe { - adapter.physical_device.open(&request_infos, enabled) - }; + let gpu = unsafe { adapter.physical_device.open(&request_infos, enabled) }; match gpu { Ok(mut gpu) => { @@ -829,8 +861,8 @@ pub extern "C" fn gfxCreateDevice( let queues = queue_infos .iter() .map(|info| { - let queues = - gpu.queue_groups + let queues = gpu + .queue_groups .iter() .position(|group| group.family.0 == info.queueFamilyIndex as usize) .map(|i| gpu.queue_groups.swap_remove(i).queues) @@ -855,16 +887,16 @@ pub extern "C" fn gfxCreateDevice( let mut enabled_extensions = Vec::new(); if dev_info.enabledExtensionCount != 0 { for raw in unsafe { - slice::from_raw_parts(dev_info.ppEnabledExtensionNames, dev_info.enabledExtensionCount as _) + slice::from_raw_parts( + dev_info.ppEnabledExtensionNames, + dev_info.enabledExtensionCount as _, + ) } { let cstr = unsafe { CStr::from_ptr(*raw) }; if !DEVICE_EXTENSION_NAMES.contains(&cstr.to_bytes_with_nul()) { return VkResult::VK_ERROR_EXTENSION_NOT_PRESENT; } - let owned = cstr - .to_str() - .expect("Invalid extension name") - .to_owned(); + let owned = cstr.to_str().expect("Invalid extension name").to_owned(); enabled_extensions.push(owned); } } @@ -888,7 +920,7 @@ pub extern "C" fn gfxCreateDevice( Err(err) => { error!("{:?}", err); conv::map_err_device_creation(err) - }, + } } } @@ -1062,7 +1094,9 @@ pub extern "C" fn gfxEnumerateInstanceLayerProperties( _pProperties: *mut VkLayerProperties, ) -> VkResult { warn!("TODO: gfxEnumerateInstanceLayerProperties"); - unsafe { *pPropertyCount = 0; } + unsafe { + *pPropertyCount = 0; + } VkResult::VK_SUCCESS } @@ -1073,7 +1107,9 @@ pub extern "C" fn gfxEnumerateDeviceLayerProperties( _pProperties: *mut VkLayerProperties, ) -> VkResult { warn!("TODO: gfxEnumerateDeviceLayerProperties"); - unsafe { *pPropertyCount = 0; } + unsafe { + *pPropertyCount = 0; + } VkResult::VK_SUCCESS } @@ -1084,23 +1120,20 @@ pub extern "C" fn gfxGetDeviceQueue( queueIndex: u32, pQueue: *mut VkQueue, ) { - let queue = gpu.queues - .get(&queueFamilyIndex) - .unwrap()[queueIndex as usize]; + let queue = gpu.queues.get(&queueFamilyIndex).unwrap()[queueIndex as usize]; - #[cfg(feature = "gfx-backend-metal")] - { - if let Ok(value) = env::var("GFX_METAL_STITCHING") { - let mut q = queue; - q.stitch_deferred = match value.to_lowercase().as_str() { - "yes" => true, - "no" => false, - other => panic!("unknown stitching option: {}", other), - }; - println!("GFX: stitching override {:?}", q.stitch_deferred); - } + #[cfg(feature = "gfx-backend-metal")] + { + if let Ok(value) = env::var("GFX_METAL_STITCHING") { + let mut q = queue; + q.stitch_deferred = match value.to_lowercase().as_str() { + "yes" => true, + "no" => false, + other => panic!("unknown stitching option: {}", other), + }; + println!("GFX: stitching override {:?}", q.stitch_deferred); } - + } unsafe { *pQueue = queue; @@ -1113,25 +1146,36 @@ pub extern "C" fn gfxQueueSubmit( pSubmits: *const VkSubmitInfo, fence: VkFence, ) -> VkResult { - let submits = unsafe { - slice::from_raw_parts(pSubmits, submitCount as usize) - }; + let submits = unsafe { slice::from_raw_parts(pSubmits, submitCount as usize) }; for (i, submission) in submits.iter().enumerate() { let cmd_slice = unsafe { - slice::from_raw_parts(submission.pCommandBuffers, submission.commandBufferCount as _) + slice::from_raw_parts( + submission.pCommandBuffers, + submission.commandBufferCount as _, + ) }; let wait_semaphores = unsafe { - let semaphores = slice::from_raw_parts(submission.pWaitSemaphores, submission.waitSemaphoreCount as _); - let stages = slice::from_raw_parts(submission.pWaitDstStageMask, submission.waitSemaphoreCount as _); + let semaphores = slice::from_raw_parts( + submission.pWaitSemaphores, + submission.waitSemaphoreCount as _, + ); + let stages = slice::from_raw_parts( + submission.pWaitDstStageMask, + submission.waitSemaphoreCount as _, + ); - stages.into_iter() + stages + .into_iter() .zip(semaphores) .map(|(stage, semaphore)| (&**semaphore, conv::map_pipeline_stage_flags(*stage))) }; let signal_semaphores = unsafe { - slice::from_raw_parts(submission.pSignalSemaphores, submission.signalSemaphoreCount as _) - .into_iter() - .map(|semaphore| &**semaphore) + slice::from_raw_parts( + submission.pSignalSemaphores, + submission.signalSemaphoreCount as _, + ) + .into_iter() + .map(|semaphore| &**semaphore) }; let submission = hal::queue::Submission { @@ -1147,7 +1191,9 @@ pub extern "C" fn gfxQueueSubmit( } else { None }; - unsafe { queue.submit(submission, fence); } + unsafe { + queue.submit(submission, fence); + } } // sometimes, all you need is a fence... @@ -1159,10 +1205,7 @@ pub extern "C" fn gfxQueueSubmit( signal_semaphores: empty(), }; unsafe { - queue.submit::( - submission, - fence.as_ref(), - ) + queue.submit::(submission, fence.as_ref()) }; } @@ -1187,7 +1230,8 @@ pub extern "C" fn gfxAllocateMemory( ) -> VkResult { unsafe { let info = &*pAllocateInfo; - let memory = gpu.device + let memory = gpu + .device .allocate_memory( hal::MemoryTypeId(info.memoryTypeIndex as _), info.allocationSize, @@ -1226,9 +1270,7 @@ pub extern "C" fn gfxMapMemory( }; unsafe { - *ppData = gpu.device - .map_memory(&memory, range) - .unwrap() as *mut _; // TODO + *ppData = gpu.device.map_memory(&memory, range).unwrap() as *mut _; // TODO } VkResult::VK_SUCCESS @@ -1245,9 +1287,7 @@ pub extern "C" fn gfxFlushMappedMemoryRanges( memoryRangeCount: u32, pMemoryRanges: *const VkMappedMemoryRange, ) -> VkResult { - let ranges = unsafe { - slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _) - } + let ranges = unsafe { slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _) } .iter() .map(|r| { let range = if r.size == VK_WHOLE_SIZE as VkDeviceSize { @@ -1259,9 +1299,7 @@ pub extern "C" fn gfxFlushMappedMemoryRanges( (&*r.memory, range) }); - match unsafe { - gpu.device.flush_mapped_memory_ranges(ranges) - } { + match unsafe { gpu.device.flush_mapped_memory_ranges(ranges) } { Ok(()) => VkResult::VK_SUCCESS, Err(oom) => map_oom(oom), } @@ -1272,9 +1310,7 @@ pub extern "C" fn gfxInvalidateMappedMemoryRanges( memoryRangeCount: u32, pMemoryRanges: *const VkMappedMemoryRange, ) -> VkResult { - let ranges = unsafe { - slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _) - } + let ranges = unsafe { slice::from_raw_parts(pMemoryRanges, memoryRangeCount as _) } .iter() .map(|r| { let range = if r.size == VK_WHOLE_SIZE as VkDeviceSize { @@ -1286,9 +1322,7 @@ pub extern "C" fn gfxInvalidateMappedMemoryRanges( (&*r.memory, range) }); - match unsafe { - gpu.device.invalidate_mapped_memory_ranges(ranges) - } { + match unsafe { gpu.device.invalidate_mapped_memory_ranges(ranges) } { Ok(()) => VkResult::VK_SUCCESS, Err(oom) => map_oom(oom), } @@ -1335,9 +1369,7 @@ pub extern "C" fn gfxGetBufferMemoryRequirements( buffer: VkBuffer, pMemoryRequirements: *mut VkMemoryRequirements, ) { - let req = unsafe { - gpu.device.get_buffer_requirements(&*buffer) - }; + let req = unsafe { gpu.device.get_buffer_requirements(&*buffer) }; *unsafe { &mut *pMemoryRequirements } = VkMemoryRequirements { size: req.size, @@ -1351,9 +1383,7 @@ pub extern "C" fn gfxGetImageMemoryRequirements( image: VkImage, pMemoryRequirements: *mut VkMemoryRequirements, ) { - let req = unsafe { - gpu.device.get_image_requirements(&image.raw) - }; + let req = unsafe { gpu.device.get_image_requirements(&image.raw) }; *unsafe { &mut *pMemoryRequirements } = VkMemoryRequirements { size: req.size, @@ -1409,7 +1439,9 @@ pub extern "C" fn gfxGetPhysicalDeviceSparseImageFormatProperties( pPropertyCount: *mut u32, _pProperties: *mut VkSparseImageFormatProperties, ) { - unsafe { *pPropertyCount = 0; } //TODO + unsafe { + *pPropertyCount = 0; + } //TODO } #[inline] pub extern "C" fn gfxQueueBindSparse( @@ -1459,25 +1491,17 @@ pub extern "C" fn gfxResetFences( fenceCount: u32, pFences: *const VkFence, ) -> VkResult { - let fence_slice = unsafe { - slice::from_raw_parts(pFences, fenceCount as _) - }; - let fences = fence_slice - .into_iter() - .map(|fence| &**fence); + let fence_slice = unsafe { slice::from_raw_parts(pFences, fenceCount as _) }; + let fences = fence_slice.into_iter().map(|fence| &**fence); - match unsafe { - gpu.device.reset_fences(fences) - } { + match unsafe { gpu.device.reset_fences(fences) } { Ok(()) => VkResult::VK_SUCCESS, Err(oom) => map_oom(oom), } } #[inline] pub extern "C" fn gfxGetFenceStatus(gpu: VkDevice, fence: VkFence) -> VkResult { - match unsafe { - gpu.device.get_fence_status(&*fence) - } { + match unsafe { gpu.device.get_fence_status(&*fence) } { Ok(true) => VkResult::VK_SUCCESS, Ok(false) => VkResult::VK_NOT_READY, Err(hal::device::DeviceLost) => VkResult::VK_ERROR_DEVICE_LOST, @@ -1493,23 +1517,15 @@ pub extern "C" fn gfxWaitForFences( ) -> VkResult { let result = match fenceCount { 0 => Ok(true), - 1 => unsafe { - gpu.device.wait_for_fence(&**pFences, timeout) - }, + 1 => unsafe { gpu.device.wait_for_fence(&**pFences, timeout) }, _ => { - let fence_slice = unsafe { - slice::from_raw_parts(pFences, fenceCount as _) - }; - let fences = fence_slice - .into_iter() - .map(|fence| &**fence); + let fence_slice = unsafe { slice::from_raw_parts(pFences, fenceCount as _) }; + let fences = fence_slice.into_iter().map(|fence| &**fence); let wait_for = match waitAll { VK_FALSE => WaitFor::Any, _ => WaitFor::All, }; - unsafe { - gpu.device.wait_for_fences(fences, wait_for, timeout) - } + unsafe { gpu.device.wait_for_fences(fences, wait_for, timeout) } } }; @@ -1517,7 +1533,9 @@ pub extern "C" fn gfxWaitForFences( Ok(true) => VkResult::VK_SUCCESS, Ok(false) => VkResult::VK_TIMEOUT, Err(hal::device::OomOrDeviceLost::OutOfMemory(oom)) => map_oom(oom), - Err(hal::device::OomOrDeviceLost::DeviceLost(hal::device::DeviceLost)) => VkResult::VK_ERROR_DEVICE_LOST, + Err(hal::device::OomOrDeviceLost::DeviceLost(hal::device::DeviceLost)) => { + VkResult::VK_ERROR_DEVICE_LOST + } } } #[inline] @@ -1584,7 +1602,9 @@ pub extern "C" fn gfxGetEventStatus(gpu: VkDevice, event: VkEvent) -> VkResult { Ok(true) => VkResult::VK_EVENT_SET, Ok(false) => VkResult::VK_EVENT_RESET, Err(hal::device::OomOrDeviceLost::OutOfMemory(oom)) => map_oom(oom), - Err(hal::device::OomOrDeviceLost::DeviceLost(hal::device::DeviceLost)) => VkResult::VK_ERROR_DEVICE_LOST, + Err(hal::device::OomOrDeviceLost::DeviceLost(hal::device::DeviceLost)) => { + VkResult::VK_ERROR_DEVICE_LOST + } } } #[inline] @@ -1653,7 +1673,7 @@ pub extern "C" fn gfxGetQueryPoolResults( let result = unsafe { gpu.device.get_query_pool_results( &*queryPool, - firstQuery .. firstQuery + queryCount, + firstQuery..firstQuery + queryCount, slice::from_raw_parts_mut(pData as *mut u8, dataSize), stride, conv::map_query_result(flags), @@ -1677,7 +1697,8 @@ pub extern "C" fn gfxCreateBuffer( assert_eq!(info.flags, 0); // TODO unsafe { - let buffer = gpu.device + let buffer = gpu + .device .create_buffer(info.size, conv::map_buffer_usage(info.usage)) .expect("Error on creating buffer"); *pBuffer = Handle::new(buffer); @@ -1763,7 +1784,8 @@ pub extern "C" fn gfxCreateImage( info.samples, ); unsafe { - let image = gpu.device + let image = gpu + .device .create_image( kind, info.mipLevels as _, @@ -1804,10 +1826,8 @@ pub extern "C" fn gfxGetImageSubresourceLayout( pLayout: *mut VkSubresourceLayout, ) { let footprint = unsafe { - gpu.device.get_image_subresource_footprint( - &image.raw, - image.map_subresource(*pSubresource), - ) + gpu.device + .get_image_subresource_footprint(&image.raw, image.map_subresource(*pSubresource)) }; let sub_layout = VkSubresourceLayout { @@ -1870,7 +1890,8 @@ pub extern "C" fn gfxCreateShaderModule( unsafe { let info = &*pCreateInfo; let code = slice::from_raw_parts(info.pCode as *const u32, info.codeSize as usize / 4); - let shader_module = gpu.device + let shader_module = gpu + .device .create_shader_module(code) .expect("Error creating shader module"); // TODO *pShaderModule = Handle::new(shader_module); @@ -1899,15 +1920,16 @@ pub extern "C" fn gfxCreatePipelineCache( let info = unsafe { &*pCreateInfo }; let data = if info.initialDataSize != 0 { Some(unsafe { - slice::from_raw_parts(info.pInitialData as *const u8, info.initialDataSize as usize) + slice::from_raw_parts( + info.pInitialData as *const u8, + info.initialDataSize as usize, + ) }) } else { None }; - let cache = match unsafe { - gpu.device.create_pipeline_cache(data) - } { + let cache = match unsafe { gpu.device.create_pipeline_cache(data) } { Ok(cache) => cache, Err(oom) => return map_oom(oom), }; @@ -1935,7 +1957,9 @@ pub extern "C" fn gfxGetPipelineCacheData( _pData: *mut ::std::os::raw::c_void, ) -> VkResult { //TODO: save - unsafe { *pDataSize = 0; } + unsafe { + *pDataSize = 0; + } VkResult::VK_SUCCESS } #[inline] @@ -1947,7 +1971,8 @@ pub extern "C" fn gfxMergePipelineCaches( ) -> VkResult { match unsafe { let caches = slice::from_raw_parts(pSrcCaches, srcCacheCount as usize); - gpu.device.merge_pipeline_caches(&*dstCache, caches.iter().map(|h| &**h)) + gpu.device + .merge_pipeline_caches(&*dstCache, caches.iter().map(|h| &**h)) } { Ok(()) => VkResult::VK_SUCCESS, Err(oom) => map_oom(oom), @@ -1963,9 +1988,7 @@ pub extern "C" fn gfxCreateGraphicsPipelines( _pAllocator: *const VkAllocationCallbacks, pPipelines: *mut VkPipeline, ) -> VkResult { - let infos = unsafe { - slice::from_raw_parts(pCreateInfos, createInfoCount as _) - }; + let infos = unsafe { slice::from_raw_parts(pCreateInfos, createInfoCount as _) }; let mut spec_constants = Vec::new(); let mut spec_data = Vec::new(); @@ -1973,20 +1996,17 @@ pub extern "C" fn gfxCreateGraphicsPipelines( // Collect all information which we will borrow later. Need to work around // the borrow checker here. for info in infos { - let stages = unsafe { - slice::from_raw_parts(info.pStages, info.stageCount as _) - }; + let stages = unsafe { slice::from_raw_parts(info.pStages, info.stageCount as _) }; for stage in stages { if let Some(spec_info) = unsafe { stage.pSpecializationInfo.as_ref() } { - let entries = unsafe { slice::from_raw_parts( - spec_info.pMapEntries, - spec_info.mapEntryCount as _, - )}; + let entries = unsafe { + slice::from_raw_parts(spec_info.pMapEntries, spec_info.mapEntryCount as _) + }; for entry in entries { let base = spec_data.len() as u16 + entry.offset as u16; spec_constants.push(pso::SpecializationConstant { id: entry.constantID, - range: base .. base + (entry.size as u16), + range: base..base + (entry.size as u16), }); } spec_data.extend_from_slice(unsafe { @@ -1999,7 +2019,8 @@ pub extern "C" fn gfxCreateGraphicsPipelines( let mut cur_specialization = 0; let descs = infos.into_iter().map(|info| { - let rasterizer_discard = unsafe { &*info.pRasterizationState }.rasterizerDiscardEnable == VK_TRUE; + let rasterizer_discard = + unsafe { &*info.pRasterizationState }.rasterizerDiscardEnable == VK_TRUE; let empty_dyn_states = []; let dyn_states = match unsafe { info.pDynamicState.as_ref() } { @@ -2014,13 +2035,16 @@ pub extern "C" fn gfxCreateGraphicsPipelines( pso::Rasterizer { polygon_mode: match state.polygonMode { VkPolygonMode::VK_POLYGON_MODE_FILL => pso::PolygonMode::Fill, - VkPolygonMode::VK_POLYGON_MODE_LINE => { - pso::PolygonMode::Line(if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_LINE_WIDTH) { + VkPolygonMode::VK_POLYGON_MODE_LINE => pso::PolygonMode::Line( + if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_LINE_WIDTH) + { pso::State::Dynamic } else { pso::State::Static(state.lineWidth) - }) - } + }, + ), VkPolygonMode::VK_POLYGON_MODE_POINT => pso::PolygonMode::Point, mode => panic!("Unexpected polygon mode: {:?}", mode), }, @@ -2028,15 +2052,20 @@ pub extern "C" fn gfxCreateGraphicsPipelines( front_face: conv::map_front_face(state.frontFace), depth_clamping: state.depthClampEnable == VK_TRUE, depth_bias: if state.depthBiasEnable == VK_TRUE { - Some(if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_DEPTH_BIAS) { - pso::State::Dynamic - } else { - pso::State::Static(pso::DepthBias { - const_factor: state.depthBiasConstantFactor, - clamp: state.depthBiasClamp, - slope_factor: state.depthBiasSlopeFactor, - }) - }) + Some( + if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_DEPTH_BIAS) + { + pso::State::Dynamic + } else { + pso::State::Static(pso::DepthBias { + const_factor: state.depthBiasConstantFactor, + clamp: state.depthBiasClamp, + slope_factor: state.depthBiasSlopeFactor, + }) + }, + ) } else { None }, @@ -2053,16 +2082,15 @@ pub extern "C" fn gfxCreateGraphicsPipelines( fragment: None, }; - let stages = unsafe { - slice::from_raw_parts(info.pStages, info.stageCount as _) - }; + let stages = unsafe { slice::from_raw_parts(info.pStages, info.stageCount as _) }; for stage in stages { use super::VkShaderStageFlagBits::*; let name = unsafe { CStr::from_ptr(stage.pName) }; let spec_count = unsafe { - stage.pSpecializationInfo + stage + .pSpecializationInfo .as_ref() .map(|spec_info| spec_info.mapEntryCount as usize) .unwrap_or(0) @@ -2071,7 +2099,9 @@ pub extern "C" fn gfxCreateGraphicsPipelines( entry: name.to_str().unwrap(), module: &*stage.module, specialization: pso::Specialization { - constants: Cow::from(&spec_constants[cur_specialization .. cur_specialization + spec_count]), + constants: Cow::from( + &spec_constants[cur_specialization..cur_specialization + spec_count], + ), data: Cow::from(&spec_data), }, }; @@ -2082,10 +2112,18 @@ pub extern "C" fn gfxCreateGraphicsPipelines( let fake_vs_entry = mem::replace(&mut set.vertex, entry_point); mem::forget(fake_vs_entry); } - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT => { set.hull = Some(entry_point); } - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT => { set.domain = Some(entry_point); } - VK_SHADER_STAGE_GEOMETRY_BIT => { set.geometry = Some(entry_point); } - VK_SHADER_STAGE_FRAGMENT_BIT if !rasterizer_discard => { set.fragment = Some(entry_point); } + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT => { + set.hull = Some(entry_point); + } + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT => { + set.domain = Some(entry_point); + } + VK_SHADER_STAGE_GEOMETRY_BIT => { + set.geometry = Some(entry_point); + } + VK_SHADER_STAGE_FRAGMENT_BIT if !rasterizer_discard => { + set.fragment = Some(entry_point); + } stage => panic!("Unexpected shader stage: {:?}", stage), } } @@ -2114,8 +2152,12 @@ pub extern "C" fn gfxCreateGraphicsPipelines( .iter() .map(|binding| { let rate = match binding.inputRate { - VkVertexInputRate::VK_VERTEX_INPUT_RATE_VERTEX => pso::VertexInputRate::Vertex, - VkVertexInputRate::VK_VERTEX_INPUT_RATE_INSTANCE => pso::VertexInputRate::Instance(1), + VkVertexInputRate::VK_VERTEX_INPUT_RATE_VERTEX => { + pso::VertexInputRate::Vertex + } + VkVertexInputRate::VK_VERTEX_INPUT_RATE_INSTANCE => { + pso::VertexInputRate::Instance(1) + } rate => panic!("Unexpected input rate: {:?}", rate), }; @@ -2163,9 +2205,12 @@ pub extern "C" fn gfxCreateGraphicsPipelines( ) { Some(primitive) => primitive, None => { - error!("Primitive topology {:?} is not supported", input_state.topology); + error!( + "Primitive topology {:?} is not supported", + input_state.topology + ); hal::Primitive::PointList - }, + } }; pso::InputAssemblerDesc { @@ -2238,60 +2283,78 @@ pub extern "C" fn gfxCreateGraphicsPipelines( // TODO: `pDepthStencilState` could contain garbage, but implementations // can ignore it in some circumstances. How to handle it? let depth_stencil = if !rasterizer_discard { - unsafe { info - .pDepthStencilState - .as_ref() - .map(|state| { - let depth_test = if state.depthTestEnable == VK_TRUE { - Some(pso::DepthTest { - fun: conv::map_compare_op(state.depthCompareOp), - write: state.depthWriteEnable == VK_TRUE, - }) - } else { - None - }; + unsafe { + info.pDepthStencilState + .as_ref() + .map(|state| { + let depth_test = if state.depthTestEnable == VK_TRUE { + Some(pso::DepthTest { + fun: conv::map_compare_op(state.depthCompareOp), + write: state.depthWriteEnable == VK_TRUE, + }) + } else { + None + }; - fn map_stencil_state(state: VkStencilOpState) -> pso::StencilFace { - pso::StencilFace { - fun: conv::map_compare_op(state.compareOp), - op_fail: conv::map_stencil_op(state.failOp), - op_depth_fail: conv::map_stencil_op(state.depthFailOp), - op_pass: conv::map_stencil_op(state.passOp), + fn map_stencil_state(state: VkStencilOpState) -> pso::StencilFace { + pso::StencilFace { + fun: conv::map_compare_op(state.compareOp), + op_fail: conv::map_stencil_op(state.failOp), + op_depth_fail: conv::map_stencil_op(state.depthFailOp), + op_pass: conv::map_stencil_op(state.passOp), + } } - } - let stencil_test = if state.stencilTestEnable == VK_TRUE { - Some(pso::StencilTest { - faces: pso::Sided { front: map_stencil_state(state.front), back: map_stencil_state(state.back) }, - read_masks: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK) { - pso::State::Dynamic - } else { - pso::State::Static(pso::Sided { front: state.front.compareMask, back: state.back.compareMask }) - }, - write_masks: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_WRITE_MASK) { - pso::State::Dynamic - } else { - pso::State::Static(pso::Sided { front: state.front.writeMask, back: state.back.writeMask }) - }, - reference_values: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_REFERENCE) { - pso::State::Dynamic - } else { - pso::State::Static(pso::Sided { front: state.front.reference, back: state.back.reference }) - }, - }) - } else { - None - }; + let stencil_test = if state.stencilTestEnable == VK_TRUE { + Some(pso::StencilTest { + faces: pso::Sided { + front: map_stencil_state(state.front), + back: map_stencil_state(state.back), + }, + read_masks: if dyn_states.iter().any(|&ds| { + ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK + }) { + pso::State::Dynamic + } else { + pso::State::Static(pso::Sided { + front: state.front.compareMask, + back: state.back.compareMask, + }) + }, + write_masks: if dyn_states.iter().any(|&ds| { + ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_WRITE_MASK + }) { + pso::State::Dynamic + } else { + pso::State::Static(pso::Sided { + front: state.front.writeMask, + back: state.back.writeMask, + }) + }, + reference_values: if dyn_states.iter().any(|&ds| { + ds == VkDynamicState::VK_DYNAMIC_STATE_STENCIL_REFERENCE + }) { + pso::State::Dynamic + } else { + pso::State::Static(pso::Sided { + front: state.front.reference, + back: state.back.reference, + }) + }, + }) + } else { + None + }; - // TODO: depth bounds + // TODO: depth bounds - pso::DepthStencilDesc { - depth: depth_test, - depth_bounds: state.depthBoundsTestEnable == VK_TRUE, - stencil: stencil_test, - } - }) - .unwrap_or_default() + pso::DepthStencilDesc { + depth: depth_test, + depth_bounds: state.depthBoundsTestEnable == VK_TRUE, + stencil: stencil_test, + } + }) + .unwrap_or_default() } } else { pso::DepthStencilDesc::default() @@ -2303,31 +2366,42 @@ pub extern "C" fn gfxCreateGraphicsPipelines( None }; let baked_states = pso::BakedStates { - viewport: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_VIEWPORT) { + viewport: if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_VIEWPORT) + { None } else { vp_state .and_then(|vp| unsafe { vp.pViewports.as_ref() }) .map(conv::map_viewport) }, - scissor: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_SCISSOR) { + scissor: if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_SCISSOR) + { None } else { vp_state .and_then(|vp| unsafe { vp.pScissors.as_ref() }) .map(conv::map_rect) }, - blend_color: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_BLEND_CONSTANTS) { + blend_color: if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_BLEND_CONSTANTS) + { None } else { - unsafe { info.pColorBlendState.as_ref() } - .map(|cbs| cbs.blendConstants) + unsafe { info.pColorBlendState.as_ref() }.map(|cbs| cbs.blendConstants) }, - depth_bounds: if dyn_states.iter().any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_DEPTH_BOUNDS) { + depth_bounds: if dyn_states + .iter() + .any(|&ds| ds == VkDynamicState::VK_DYNAMIC_STATE_DEPTH_BOUNDS) + { None } else { unsafe { info.pDepthStencilState.as_ref() } - .map(|db| db.minDepthBounds .. db.maxDepthBounds) + .map(|db| db.minDepthBounds..db.maxDepthBounds) }, }; @@ -2340,10 +2414,16 @@ pub extern "C" fn gfxCreateGraphicsPipelines( let flags = { let mut flags = pso::PipelineCreationFlags::empty(); - if info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT as u32 != 0 { + if info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT as u32 + != 0 + { flags |= pso::PipelineCreationFlags::DISABLE_OPTIMIZATION; } - if info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT as u32 != 0 { + if info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT as u32 + != 0 + { flags |= pso::PipelineCreationFlags::ALLOW_DERIVATIVES; } @@ -2351,12 +2431,16 @@ pub extern "C" fn gfxCreateGraphicsPipelines( }; let parent = { - let is_derivative = info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DERIVATIVE_BIT as u32 != 0; + let is_derivative = info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DERIVATIVE_BIT as u32 + != 0; if let Some(base_pso) = info.basePipelineHandle.as_ref() { match *base_pso { Pipeline::Graphics(ref pso) => pso::BasePipeline::Pipeline(pso), - Pipeline::Compute(_) => panic!("Base pipeline handle must be a graphics pipeline"), + Pipeline::Compute(_) => { + panic!("Base pipeline handle must be a graphics pipeline") + } } } else if is_derivative && info.basePipelineIndex > 0 { pso::BasePipeline::Index(info.basePipelineIndex as _) @@ -2383,11 +2467,10 @@ pub extern "C" fn gfxCreateGraphicsPipelines( }); let pipelines = unsafe { - gpu.device.create_graphics_pipelines(descs, pipelineCache.as_ref()) - }; - let out_pipelines = unsafe { - slice::from_raw_parts_mut(pPipelines, infos.len()) + gpu.device + .create_graphics_pipelines(descs, pipelineCache.as_ref()) }; + let out_pipelines = unsafe { slice::from_raw_parts_mut(pPipelines, infos.len()) }; if pipelines.iter().any(|p| p.is_err()) { for pipeline in pipelines { @@ -2415,9 +2498,7 @@ pub extern "C" fn gfxCreateComputePipelines( _pAllocator: *const VkAllocationCallbacks, pPipelines: *mut VkPipeline, ) -> VkResult { - let infos = unsafe { - slice::from_raw_parts(pCreateInfos, createInfoCount as _) - }; + let infos = unsafe { slice::from_raw_parts(pCreateInfos, createInfoCount as _) }; // Collect all information which we will borrow later. Need to work around // the borrow checker here. @@ -2428,15 +2509,14 @@ pub extern "C" fn gfxCreateComputePipelines( // the borrow checker here. for info in infos { if let Some(spec_info) = unsafe { info.stage.pSpecializationInfo.as_ref() } { - let entries = unsafe { slice::from_raw_parts( - spec_info.pMapEntries, - spec_info.mapEntryCount as _, - )}; + let entries = unsafe { + slice::from_raw_parts(spec_info.pMapEntries, spec_info.mapEntryCount as _) + }; for entry in entries { let base = spec_data.len() as u16 + entry.offset as u16; spec_constants.push(pso::SpecializationConstant { id: entry.constantID, - range: base .. base + (entry.size as u16), + range: base..base + (entry.size as u16), }); } spec_data.extend_from_slice(unsafe { @@ -2446,69 +2526,79 @@ pub extern "C" fn gfxCreateComputePipelines( } let mut cur_specialization = 0; - let descs = infos - .iter() - .map(|info| { - let name = unsafe { CStr::from_ptr(info.stage.pName) }; - let spec_count = unsafe { - info.stage.pSpecializationInfo - .as_ref() - .map(|spec_info| spec_info.mapEntryCount as usize) - .unwrap_or(0) - }; - let shader = pso::EntryPoint { - entry: name.to_str().unwrap(), - module: &*info.stage.module, - specialization: pso::Specialization { - constants: Cow::from(&spec_constants[cur_specialization .. cur_specialization + spec_count]), - data: Cow::from(&spec_data), - }, - }; - cur_specialization += spec_count; + let descs = infos.iter().map(|info| { + let name = unsafe { CStr::from_ptr(info.stage.pName) }; + let spec_count = unsafe { + info.stage + .pSpecializationInfo + .as_ref() + .map(|spec_info| spec_info.mapEntryCount as usize) + .unwrap_or(0) + }; + let shader = pso::EntryPoint { + entry: name.to_str().unwrap(), + module: &*info.stage.module, + specialization: pso::Specialization { + constants: Cow::from( + &spec_constants[cur_specialization..cur_specialization + spec_count], + ), + data: Cow::from(&spec_data), + }, + }; + cur_specialization += spec_count; - let layout = &*info.layout; - let flags = { - let mut flags = pso::PipelineCreationFlags::empty(); + let layout = &*info.layout; + let flags = { + let mut flags = pso::PipelineCreationFlags::empty(); - if info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT as u32 != 0 { - flags |= pso::PipelineCreationFlags::DISABLE_OPTIMIZATION; - } - if info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT as u32 != 0 { - flags |= pso::PipelineCreationFlags::ALLOW_DERIVATIVES; - } - - flags - }; - - let parent = { - let is_derivative = info.flags & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DERIVATIVE_BIT as u32 != 0; - - if let Some(base_pso) = info.basePipelineHandle.as_ref() { - match *base_pso { - Pipeline::Graphics(_) => panic!("Base pipeline handle must be a compute pipeline"), - Pipeline::Compute(ref pso) => pso::BasePipeline::Pipeline(pso), - } - } else if is_derivative && info.basePipelineIndex > 0 { - pso::BasePipeline::Index(info.basePipelineIndex as _) - } else { - pso::BasePipeline::None // TODO - } - }; - - pso::ComputePipelineDesc { - shader, - layout, - flags, - parent, + if info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT as u32 + != 0 + { + flags |= pso::PipelineCreationFlags::DISABLE_OPTIMIZATION; } - }); + if info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT as u32 + != 0 + { + flags |= pso::PipelineCreationFlags::ALLOW_DERIVATIVES; + } + + flags + }; + + let parent = { + let is_derivative = info.flags + & VkPipelineCreateFlagBits::VK_PIPELINE_CREATE_DERIVATIVE_BIT as u32 + != 0; + + if let Some(base_pso) = info.basePipelineHandle.as_ref() { + match *base_pso { + Pipeline::Graphics(_) => { + panic!("Base pipeline handle must be a compute pipeline") + } + Pipeline::Compute(ref pso) => pso::BasePipeline::Pipeline(pso), + } + } else if is_derivative && info.basePipelineIndex > 0 { + pso::BasePipeline::Index(info.basePipelineIndex as _) + } else { + pso::BasePipeline::None // TODO + } + }; + + pso::ComputePipelineDesc { + shader, + layout, + flags, + parent, + } + }); let pipelines = unsafe { - gpu.device.create_compute_pipelines(descs, pipelineCache.as_ref()) - }; - let out_pipelines = unsafe { - slice::from_raw_parts_mut(pPipelines, infos.len()) + gpu.device + .create_compute_pipelines(descs, pipelineCache.as_ref()) }; + let out_pipelines = unsafe { slice::from_raw_parts_mut(pPipelines, infos.len()) }; if pipelines.iter().any(|p| p.is_err()) { for pipeline in pipelines { @@ -2536,10 +2626,10 @@ pub extern "C" fn gfxDestroyPipeline( match pipeline.unbox() { Some(Pipeline::Graphics(pipeline)) => unsafe { gpu.device.destroy_graphics_pipeline(pipeline) - } + }, Some(Pipeline::Compute(pipeline)) => unsafe { gpu.device.destroy_compute_pipeline(pipeline) - } + }, None => {} } } @@ -2551,35 +2641,29 @@ pub extern "C" fn gfxCreatePipelineLayout( pPipelineLayout: *mut VkPipelineLayout, ) -> VkResult { let info = unsafe { &*pCreateInfo }; - let set_layouts = unsafe { - slice::from_raw_parts(info.pSetLayouts, info.setLayoutCount as _) - }; + let set_layouts = unsafe { slice::from_raw_parts(info.pSetLayouts, info.setLayoutCount as _) }; let push_constants = unsafe { slice::from_raw_parts(info.pPushConstantRanges, info.pushConstantRangeCount as _) }; - let layouts = set_layouts - .iter() - .map(|layout| &**layout); + let layouts = set_layouts.iter().map(|layout| &**layout); - let ranges = push_constants - .iter() - .map(|constant| { - let stages = conv::map_stage_flags(constant.stageFlags); - let start = constant.offset / 4; - let size = constant.size / 4; + let ranges = push_constants.iter().map(|constant| { + let stages = conv::map_stage_flags(constant.stageFlags); + let start = constant.offset / 4; + let size = constant.size / 4; - (stages, start .. start+size) - }); + (stages, start..start + size) + }); - let pipeline_layout = match unsafe { - gpu.device.create_pipeline_layout(layouts, ranges) - } { + let pipeline_layout = match unsafe { gpu.device.create_pipeline_layout(layouts, ranges) } { Ok(pipeline) => pipeline, Err(oom) => return map_oom(oom), }; - unsafe { *pPipelineLayout = Handle::new(pipeline_layout); } + unsafe { + *pPipelineLayout = Handle::new(pipeline_layout); + } VkResult::VK_SUCCESS } #[inline] @@ -2612,7 +2696,7 @@ pub extern "C" fn gfxCreateSampler( conv::map_wrap_mode(info.addressModeW), ), lod_bias: info.mipLodBias.into(), - lod_range: info.minLod.into() .. info.maxLod.into(), + lod_range: info.minLod.into()..info.maxLod.into(), comparison: if info.compareEnable == VK_TRUE { Some(conv::map_compare_op(info.compareOp)) } else { @@ -2626,13 +2710,13 @@ pub extern "C" fn gfxCreateSampler( hal::image::Anisotropic::Off }, }; - let sampler = match unsafe { - gpu.device.create_sampler(gfx_info) - } { + let sampler = match unsafe { gpu.device.create_sampler(gfx_info) } { Ok(s) => s, Err(alloc) => return map_alloc_error(alloc), }; - unsafe { *pSampler = Handle::new(sampler); } + unsafe { + *pSampler = Handle::new(sampler); + } VkResult::VK_SUCCESS } #[inline] @@ -2655,22 +2739,18 @@ pub extern "C" fn gfxCreateDescriptorSetLayout( pSetLayout: *mut VkDescriptorSetLayout, ) -> VkResult { let info = unsafe { &*pCreateInfo }; - let layout_bindings = unsafe { - slice::from_raw_parts(info.pBindings, info.bindingCount as _) - }; + let layout_bindings = unsafe { slice::from_raw_parts(info.pBindings, info.bindingCount as _) }; - let sampler_iter = layout_bindings - .iter() - .flat_map(|binding| { - if binding.pImmutableSamplers.is_null() { - (&[]).into_iter().cloned() - } else { - let slice = unsafe { - slice::from_raw_parts(binding.pImmutableSamplers, binding.descriptorCount as _) - }; - slice.iter().cloned() - } - }); + let sampler_iter = layout_bindings.iter().flat_map(|binding| { + if binding.pImmutableSamplers.is_null() { + (&[]).into_iter().cloned() + } else { + let slice = unsafe { + slice::from_raw_parts(binding.pImmutableSamplers, binding.descriptorCount as _) + }; + slice.iter().cloned() + } + }); let bindings = layout_bindings .iter() @@ -2683,13 +2763,16 @@ pub extern "C" fn gfxCreateDescriptorSetLayout( }); let set_layout = match unsafe { - gpu.device.create_descriptor_set_layout(bindings, sampler_iter) + gpu.device + .create_descriptor_set_layout(bindings, sampler_iter) } { Ok(sl) => sl, Err(oom) => return map_oom(oom), }; - unsafe { *pSetLayout = Handle::new(set_layout); } + unsafe { + *pSetLayout = Handle::new(set_layout); + } VkResult::VK_SUCCESS } #[inline] @@ -2714,18 +2797,12 @@ pub extern "C" fn gfxCreateDescriptorPool( let info = unsafe { &*pCreateInfo }; let max_sets = info.maxSets as usize; - let pool_sizes = unsafe { - slice::from_raw_parts(info.pPoolSizes, info.poolSizeCount as _) - }; + let pool_sizes = unsafe { slice::from_raw_parts(info.pPoolSizes, info.poolSizeCount as _) }; - let ranges = pool_sizes - .iter() - .map(|pool| { - pso::DescriptorRangeDesc { - ty: conv::map_descriptor_type(pool.type_), - count: pool.descriptorCount as _, - } - }); + let ranges = pool_sizes.iter().map(|pool| pso::DescriptorRangeDesc { + ty: conv::map_descriptor_type(pool.type_), + count: pool.descriptorCount as _, + }); let pool = super::DescriptorPool { raw: match unsafe { @@ -2739,14 +2816,20 @@ pub extern "C" fn gfxCreateDescriptorPool( Err(oom) => return map_oom(oom), }, temp_sets: Vec::with_capacity(max_sets), - set_handles: if info.flags & VkDescriptorPoolCreateFlagBits::VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT as u32 != 0 { + set_handles: if info.flags + & VkDescriptorPoolCreateFlagBits::VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT + as u32 + != 0 + { None } else { Some(Vec::with_capacity(max_sets)) }, }; - unsafe { *pDescriptorPool = Handle::new(pool); } + unsafe { + *pDescriptorPool = Handle::new(pool); + } VkResult::VK_SUCCESS } #[inline] @@ -2789,21 +2872,19 @@ pub extern "C" fn gfxAllocateDescriptorSets( pDescriptorSets: *mut VkDescriptorSet, ) -> VkResult { let info = unsafe { &mut *(pAllocateInfo as *mut VkDescriptorSetAllocateInfo) }; - let super::DescriptorPool { ref mut raw, ref mut temp_sets, ref mut set_handles } = *info.descriptorPool; + let super::DescriptorPool { + ref mut raw, + ref mut temp_sets, + ref mut set_handles, + } = *info.descriptorPool; - let out_sets = unsafe { - slice::from_raw_parts_mut(pDescriptorSets, info.descriptorSetCount as _) - }; - let set_layouts = unsafe { - slice::from_raw_parts(info.pSetLayouts, info.descriptorSetCount as _) - }; - let layouts = set_layouts - .iter() - .map(|layout| &**layout); + let out_sets = + unsafe { slice::from_raw_parts_mut(pDescriptorSets, info.descriptorSetCount as _) }; + let set_layouts = + unsafe { slice::from_raw_parts(info.pSetLayouts, info.descriptorSetCount as _) }; + let layouts = set_layouts.iter().map(|layout| &**layout); - match unsafe { - raw.allocate_sets(layouts, temp_sets) - } { + match unsafe { raw.allocate_sets(layouts, temp_sets) } { Ok(()) => { assert_eq!(temp_sets.len(), info.descriptorSetCount as usize); for (set, raw_set) in out_sets.iter_mut().zip(temp_sets.drain(..)) { @@ -2837,14 +2918,11 @@ pub extern "C" fn gfxFreeDescriptorSets( descriptorSetCount: u32, pDescriptorSets: *const VkDescriptorSet, ) -> VkResult { - let descriptor_sets = unsafe { - slice::from_raw_parts(pDescriptorSets, descriptorSetCount as _) - }; + let descriptor_sets = + unsafe { slice::from_raw_parts(pDescriptorSets, descriptorSetCount as _) }; assert!(descriptorPool.set_handles.is_none()); - let sets = descriptor_sets - .into_iter() - .filter_map(|set| set.unbox()); + let sets = descriptor_sets.into_iter().filter_map(|set| set.unbox()); unsafe { descriptorPool.raw.free_sets(sets); @@ -2863,35 +2941,27 @@ impl<'a> Iterator for DescriptorIter<'a> { type Item = pso::Descriptor<'a, B>; fn next(&mut self) -> Option { match self.ty { - pso::DescriptorType::Sampler => { - self.image_infos.next().map(|image| { - pso::Descriptor::Sampler(&*image.sampler) - }) - } - pso::DescriptorType::InputAttachment | - pso::DescriptorType::SampledImage | - pso::DescriptorType::StorageImage => { - self.image_infos.next().map(|image| { - pso::Descriptor::Image( - &*image.imageView, - conv::map_image_layout(image.imageLayout), - ) - }) - } - pso::DescriptorType::UniformTexelBuffer => { - self.texel_buffer_views.next().map(|view| { - pso::Descriptor::UniformTexelBuffer(&**view) - }) - } - pso::DescriptorType::StorageTexelBuffer => { - self.texel_buffer_views.next().map(|view| { - pso::Descriptor::StorageTexelBuffer(&**view) - }) - } - pso::DescriptorType::UniformBuffer | - pso::DescriptorType::StorageBuffer | - pso::DescriptorType::UniformBufferDynamic | - pso::DescriptorType::StorageBufferDynamic => { + pso::DescriptorType::Sampler => self + .image_infos + .next() + .map(|image| pso::Descriptor::Sampler(&*image.sampler)), + pso::DescriptorType::InputAttachment + | pso::DescriptorType::SampledImage + | pso::DescriptorType::StorageImage => self.image_infos.next().map(|image| { + pso::Descriptor::Image(&*image.imageView, conv::map_image_layout(image.imageLayout)) + }), + pso::DescriptorType::UniformTexelBuffer => self + .texel_buffer_views + .next() + .map(|view| pso::Descriptor::UniformTexelBuffer(&**view)), + pso::DescriptorType::StorageTexelBuffer => self + .texel_buffer_views + .next() + .map(|view| pso::Descriptor::StorageTexelBuffer(&**view)), + pso::DescriptorType::UniformBuffer + | pso::DescriptorType::StorageBuffer + | pso::DescriptorType::UniformBufferDynamic + | pso::DescriptorType::StorageBufferDynamic => { self.buffer_infos.next().map(|buffer| { let end = if buffer.range as i32 == VK_WHOLE_SIZE { None @@ -2901,19 +2971,17 @@ impl<'a> Iterator for DescriptorIter<'a> { pso::Descriptor::Buffer( // Non-sparse buffer need to be bound to device memory. &*buffer.buffer, - Some(buffer.offset) .. end, - ) - }) - } - pso::DescriptorType::CombinedImageSampler => { - self.image_infos.next().map(|image| { - pso::Descriptor::CombinedImageSampler( - &*image.imageView, - conv::map_image_layout(image.imageLayout), - &*image.sampler, + Some(buffer.offset)..end, ) }) } + pso::DescriptorType::CombinedImageSampler => self.image_infos.next().map(|image| { + pso::Descriptor::CombinedImageSampler( + &*image.imageView, + conv::map_image_layout(image.imageLayout), + &*image.sampler, + ) + }), } } } @@ -2926,21 +2994,23 @@ pub extern "C" fn gfxUpdateDescriptorSets( descriptorCopyCount: u32, pDescriptorCopies: *const VkCopyDescriptorSet, ) { - let write_infos = unsafe { - slice::from_raw_parts(pDescriptorWrites, descriptorWriteCount as _) - }; + let write_infos = + unsafe { slice::from_raw_parts(pDescriptorWrites, descriptorWriteCount as _) }; let writes = write_infos.iter().map(|write| { let descriptors = DescriptorIter { ty: conv::map_descriptor_type(write.descriptorType), image_infos: unsafe { slice::from_raw_parts(write.pImageInfo, write.descriptorCount as _) - }.iter(), + } + .iter(), buffer_infos: unsafe { slice::from_raw_parts(write.pBufferInfo, write.descriptorCount as _) - }.iter(), + } + .iter(), texel_buffer_views: unsafe { slice::from_raw_parts(write.pTexelBufferView, write.descriptorCount as _) - }.iter() + } + .iter(), }; pso::DescriptorSetWrite { set: &*write.dstSet, @@ -2950,20 +3020,16 @@ pub extern "C" fn gfxUpdateDescriptorSets( } }); - let copies = unsafe { - slice::from_raw_parts(pDescriptorCopies, descriptorCopyCount as _) - } + let copies = unsafe { slice::from_raw_parts(pDescriptorCopies, descriptorCopyCount as _) } .iter() - .map(|copy| { - pso::DescriptorSetCopy { - src_set: &*copy.srcSet, - src_binding: copy.srcBinding as _, - src_array_offset: copy.srcArrayElement as _, - dst_set: &*copy.dstSet, - dst_binding: copy.dstBinding as _, - dst_array_offset: copy.dstArrayElement as _, - count: copy.descriptorCount as _, - } + .map(|copy| pso::DescriptorSetCopy { + src_set: &*copy.srcSet, + src_binding: copy.srcBinding as _, + src_array_offset: copy.srcArrayElement as _, + dst_set: &*copy.dstSet, + dst_binding: copy.dstBinding as _, + dst_array_offset: copy.dstArrayElement as _, + count: copy.descriptorCount as _, }); unsafe { @@ -2980,9 +3046,8 @@ pub extern "C" fn gfxCreateFramebuffer( ) -> VkResult { let info = unsafe { &*pCreateInfo }; - let attachments_slice = unsafe { - slice::from_raw_parts(info.pAttachments, info.attachmentCount as _) - }; + let attachments_slice = + unsafe { slice::from_raw_parts(info.pAttachments, info.attachmentCount as _) }; let attachments = attachments_slice .into_iter() .map(|attachment| &**attachment); @@ -2994,7 +3059,8 @@ pub extern "C" fn gfxCreateFramebuffer( }; unsafe { - let framebuffer = gpu.device + let framebuffer = gpu + .device .create_framebuffer(&*info.renderPass, attachments, extent) .unwrap(); *pFramebuffer = Handle::new(framebuffer); @@ -3024,36 +3090,31 @@ pub extern "C" fn gfxCreateRenderPass( let info = unsafe { &*pCreateInfo }; // Attachment descriptions - let raw_attachments = unsafe { - slice::from_raw_parts(info.pAttachments, info.attachmentCount as _) - }; - let attachments = raw_attachments - .into_iter() - .map(|attachment| { - assert_eq!(attachment.flags, 0); // TODO + let raw_attachments = + unsafe { slice::from_raw_parts(info.pAttachments, info.attachmentCount as _) }; + let attachments = raw_attachments.into_iter().map(|attachment| { + assert_eq!(attachment.flags, 0); // TODO - let initial_layout = conv::map_image_layout(attachment.initialLayout); - let final_layout = conv::map_image_layout(attachment.finalLayout); + let initial_layout = conv::map_image_layout(attachment.initialLayout); + let final_layout = conv::map_image_layout(attachment.finalLayout); - pass::Attachment { - format: conv::map_format(attachment.format), - samples: attachment.samples as u32 as _, - ops: pass::AttachmentOps { - load: conv::map_attachment_load_op(attachment.loadOp), - store: conv::map_attachment_store_op(attachment.storeOp), - }, - stencil_ops: pass::AttachmentOps { - load: conv::map_attachment_load_op(attachment.stencilLoadOp), - store: conv::map_attachment_store_op(attachment.stencilStoreOp), - }, - layouts: initial_layout .. final_layout, - } - }); + pass::Attachment { + format: conv::map_format(attachment.format), + samples: attachment.samples as u32 as _, + ops: pass::AttachmentOps { + load: conv::map_attachment_load_op(attachment.loadOp), + store: conv::map_attachment_store_op(attachment.storeOp), + }, + stencil_ops: pass::AttachmentOps { + load: conv::map_attachment_load_op(attachment.stencilLoadOp), + store: conv::map_attachment_store_op(attachment.stencilStoreOp), + }, + layouts: initial_layout..final_layout, + } + }); // Subpass descriptions - let subpasses_raw = unsafe { - slice::from_raw_parts(info.pSubpasses, info.subpassCount as _) - }; + let subpasses_raw = unsafe { slice::from_raw_parts(info.pSubpasses, info.subpassCount as _) }; // Store all attachment references, referenced by the subpasses. let mut attachment_refs = Vec::with_capacity(subpasses_raw.len()); @@ -3066,7 +3127,10 @@ pub extern "C" fn gfxCreateRenderPass( } fn map_attachment_ref(att_ref: &VkAttachmentReference) -> pass::AttachmentRef { - (att_ref.attachment as _, conv::map_image_layout(att_ref.layout)) + ( + att_ref.attachment as _, + conv::map_image_layout(att_ref.layout), + ) } for subpass in subpasses_raw { @@ -3086,10 +3150,13 @@ pub extern "C" fn gfxCreateRenderPass( Vec::new() } else { unsafe { - slice::from_raw_parts(subpass.pResolveAttachments, subpass.colorAttachmentCount as _) - .into_iter() - .map(map_attachment_ref) - .collect() + slice::from_raw_parts( + subpass.pResolveAttachments, + subpass.colorAttachmentCount as _, + ) + .into_iter() + .map(map_attachment_ref) + .collect() } }; let depth_stencil = unsafe { @@ -3101,10 +3168,13 @@ pub extern "C" fn gfxCreateRenderPass( }; let preserve = unsafe { - slice::from_raw_parts(subpass.pPreserveAttachments, subpass.preserveAttachmentCount as _) - .into_iter() - .map(|id| *id as usize) - .collect::>() + slice::from_raw_parts( + subpass.pPreserveAttachments, + subpass.preserveAttachmentCount as _, + ) + .into_iter() + .map(|id| *id as usize) + .collect::>() }; attachment_refs.push(AttachmentRefs { @@ -3127,9 +3197,8 @@ pub extern "C" fn gfxCreateRenderPass( }); // Subpass dependencies - let dependencies = unsafe { - slice::from_raw_parts(info.pDependencies, info.dependencyCount as _) - }; + let dependencies = + unsafe { slice::from_raw_parts(info.pDependencies, info.dependencyCount as _) }; fn map_subpass_ref(subpass: u32) -> pass::SubpassRef { if subpass == VK_SUBPASS_EXTERNAL as u32 { @@ -3139,31 +3208,30 @@ pub extern "C" fn gfxCreateRenderPass( } } - let dependencies = dependencies - .into_iter() - .map(|dependency| { - // assert_eq!(dependency.dependencyFlags, 0); // TODO + let dependencies = dependencies.into_iter().map(|dependency| { + // assert_eq!(dependency.dependencyFlags, 0); // TODO - let src_pass = map_subpass_ref(dependency.srcSubpass); - let dst_pass = map_subpass_ref(dependency.dstSubpass); + let src_pass = map_subpass_ref(dependency.srcSubpass); + let dst_pass = map_subpass_ref(dependency.dstSubpass); - let src_stage = conv::map_pipeline_stage_flags(dependency.srcStageMask); - let dst_stage = conv::map_pipeline_stage_flags(dependency.dstStageMask); + let src_stage = conv::map_pipeline_stage_flags(dependency.srcStageMask); + let dst_stage = conv::map_pipeline_stage_flags(dependency.dstStageMask); - // Our portability implementation only supports image access flags atm. - // Global buffer barriers can't be handled currently. - let src_access = conv::map_image_access(dependency.srcAccessMask); - let dst_access = conv::map_image_access(dependency.dstAccessMask); + // Our portability implementation only supports image access flags atm. + // Global buffer barriers can't be handled currently. + let src_access = conv::map_image_access(dependency.srcAccessMask); + let dst_access = conv::map_image_access(dependency.dstAccessMask); - pass::SubpassDependency { - passes: src_pass .. dst_pass, - stages: src_stage .. dst_stage, - accesses: src_access .. dst_access, - } - }); + pass::SubpassDependency { + passes: src_pass..dst_pass, + stages: src_stage..dst_stage, + accesses: src_access..dst_access, + } + }); let render_pass = match unsafe { - gpu.device.create_render_pass(attachments, subpasses, dependencies) + gpu.device + .create_render_pass(attachments, subpasses, dependencies) } { Ok(pass) => pass, Err(oom) => return map_oom(oom), @@ -3193,7 +3261,10 @@ pub extern "C" fn gfxGetRenderAreaGranularity( _renderPass: VkRenderPass, pGranularity: *mut VkExtent2D, ) { - let granularity = VkExtent2D { width: 1, height: 1 }; //TODO? + let granularity = VkExtent2D { + width: 1, + height: 1, + }; //TODO? unsafe { *pGranularity = granularity }; } @@ -3221,9 +3292,7 @@ pub extern "C" fn gfxCreateCommandPool( } let pool = CommandPool { - pool: match unsafe { - gpu.device.create_command_pool(family, flags) - } { + pool: match unsafe { gpu.device.create_command_pool(family, flags) } { Ok(pool) => pool, Err(oom) => return map_oom(oom), }, @@ -3255,7 +3324,9 @@ pub extern "C" fn gfxResetCommandPool( mut commandPool: VkCommandPool, flags: VkCommandPoolResetFlags, ) -> VkResult { - let release = (flags & VkCommandPoolResetFlagBits::VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT as u32) != 0; + let release = (flags + & VkCommandPoolResetFlagBits::VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT as u32) + != 0; unsafe { commandPool.pool.reset(release); } @@ -3275,9 +3346,8 @@ pub extern "C" fn gfxAllocateCommandBuffers( level => panic!("Unexpected command buffer lvel: {:?}", level), }; - let output = unsafe { - slice::from_raw_parts_mut(pCommandBuffers, info.commandBufferCount as usize) - }; + let output = + unsafe { slice::from_raw_parts_mut(pCommandBuffers, info.commandBufferCount as usize) }; for out in output.iter_mut() { let cmd_buf = info.commandPool.pool.allocate_one(level); *out = DispatchHandle::new(cmd_buf); @@ -3294,9 +3364,7 @@ pub extern "C" fn gfxFreeCommandBuffers( commandBufferCount: u32, pCommandBuffers: *const VkCommandBuffer, ) { - let slice = unsafe { - slice::from_raw_parts(pCommandBuffers, commandBufferCount as _) - }; + let slice = unsafe { slice::from_raw_parts(pCommandBuffers, commandBufferCount as _) }; commandPool.buffers.retain(|buf| !slice.contains(buf)); let buffers = slice.iter().filter_map(|buffer| buffer.unbox()); @@ -3341,7 +3409,9 @@ pub extern "C" fn gfxResetCommandBuffer( mut commandBuffer: VkCommandBuffer, flags: VkCommandBufferResetFlags, ) -> VkResult { - let release_resources = flags & VkCommandBufferResetFlagBits::VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT as u32 != 0; + let release_resources = flags + & VkCommandBufferResetFlagBits::VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT as u32 + != 0; unsafe { commandBuffer.reset(release_resources); } @@ -3356,10 +3426,8 @@ pub extern "C" fn gfxCmdBindPipeline( match *pipeline { Pipeline::Graphics(ref pipeline) => unsafe { commandBuffer.bind_graphics_pipeline(pipeline) - } - Pipeline::Compute(ref pipeline) => unsafe { - commandBuffer.bind_compute_pipeline(pipeline) - } + }, + Pipeline::Compute(ref pipeline) => unsafe { commandBuffer.bind_compute_pipeline(pipeline) }, } } #[inline] @@ -3428,7 +3496,7 @@ pub extern "C" fn gfxCmdSetDepthBounds( maxDepthBounds: f32, ) { unsafe { - commandBuffer.set_depth_bounds(minDepthBounds .. maxDepthBounds); + commandBuffer.set_depth_bounds(minDepthBounds..maxDepthBounds); } } #[inline] @@ -3438,10 +3506,7 @@ pub extern "C" fn gfxCmdSetStencilCompareMask( compareMask: u32, ) { unsafe { - commandBuffer.set_stencil_read_mask( - conv::map_stencil_face(faceMask), - compareMask, - ); + commandBuffer.set_stencil_read_mask(conv::map_stencil_face(faceMask), compareMask); } } #[inline] @@ -3451,10 +3516,7 @@ pub extern "C" fn gfxCmdSetStencilWriteMask( writeMask: u32, ) { unsafe { - commandBuffer.set_stencil_write_mask( - conv::map_stencil_face(faceMask), - writeMask, - ); + commandBuffer.set_stencil_write_mask(conv::map_stencil_face(faceMask), writeMask); } } #[inline] @@ -3464,10 +3526,7 @@ pub extern "C" fn gfxCmdSetStencilReference( reference: u32, ) { unsafe { - commandBuffer.set_stencil_reference( - conv::map_stencil_face(faceMask), - reference, - ); + commandBuffer.set_stencil_reference(conv::map_stencil_face(faceMask), reference); } } #[inline] @@ -3486,9 +3545,7 @@ pub extern "C" fn gfxCmdBindDescriptorSets( .into_iter() .map(|set| &**set) }; - let offsets = unsafe { - slice::from_raw_parts(pDynamicOffsets, dynamicOffsetCount as _) - }; + let offsets = unsafe { slice::from_raw_parts(pDynamicOffsets, dynamicOffsetCount as _) }; match pipelineBindPoint { VkPipelineBindPoint::VK_PIPELINE_BIND_POINT_GRAPHICS => unsafe { @@ -3498,7 +3555,7 @@ pub extern "C" fn gfxCmdBindDescriptorSets( descriptor_sets, offsets, ); - } + }, VkPipelineBindPoint::VK_PIPELINE_BIND_POINT_COMPUTE => unsafe { commandBuffer.bind_compute_descriptor_sets( &*layout, @@ -3506,7 +3563,7 @@ pub extern "C" fn gfxCmdBindDescriptorSets( descriptor_sets, offsets, ); - } + }, _ => panic!("Unexpected pipeline bind point: {:?}", pipelineBindPoint), } } @@ -3518,13 +3575,11 @@ pub extern "C" fn gfxCmdBindIndexBuffer( indexType: VkIndexType, ) { unsafe { - commandBuffer.bind_index_buffer( - IndexBufferView { - buffer: &*buffer, - offset, - index_type: conv::map_index_type(indexType), - } - ); + commandBuffer.bind_index_buffer(IndexBufferView { + buffer: &*buffer, + offset, + index_type: conv::map_index_type(indexType), + }); } } @@ -3536,19 +3591,13 @@ pub extern "C" fn gfxCmdBindVertexBuffers( pBuffers: *const VkBuffer, pOffsets: *const VkDeviceSize, ) { - let buffers = unsafe { - slice::from_raw_parts(pBuffers, bindingCount as _) - }; - let offsets = unsafe { - slice::from_raw_parts(pOffsets, bindingCount as _) - }; + let buffers = unsafe { slice::from_raw_parts(pBuffers, bindingCount as _) }; + let offsets = unsafe { slice::from_raw_parts(pOffsets, bindingCount as _) }; let views = buffers .into_iter() .zip(offsets) - .map(|(buffer, offset)| { - (*buffer, *offset) - }); + .map(|(buffer, offset)| (*buffer, *offset)); unsafe { commandBuffer.bind_vertex_buffers(firstBinding, views); @@ -3564,8 +3613,8 @@ pub extern "C" fn gfxCmdDraw( ) { unsafe { commandBuffer.draw( - firstVertex .. firstVertex + vertexCount, - firstInstance .. firstInstance + instanceCount, + firstVertex..firstVertex + vertexCount, + firstInstance..firstInstance + instanceCount, ); } } @@ -3580,9 +3629,9 @@ pub extern "C" fn gfxCmdDrawIndexed( ) { unsafe { commandBuffer.draw_indexed( - firstIndex .. firstIndex + indexCount, + firstIndex..firstIndex + indexCount, vertexOffset, - firstInstance .. firstInstance + instanceCount, + firstInstance..firstInstance + instanceCount, ); } } @@ -3595,12 +3644,7 @@ pub extern "C" fn gfxCmdDrawIndirect( stride: u32, ) { unsafe { - commandBuffer.draw_indirect( - &*buffer, - offset, - drawCount, - stride, - ); + commandBuffer.draw_indirect(&*buffer, offset, drawCount, stride); } } #[inline] @@ -3612,12 +3656,7 @@ pub extern "C" fn gfxCmdDrawIndexedIndirect( stride: u32, ) { unsafe { - commandBuffer.draw_indexed_indirect( - &*buffer, - offset, - drawCount, - stride, - ); + commandBuffer.draw_indexed_indirect(&*buffer, offset, drawCount, stride); } } #[inline] @@ -3638,10 +3677,7 @@ pub extern "C" fn gfxCmdDispatchIndirect( offset: VkDeviceSize, ) { unsafe { - commandBuffer.dispatch_indirect( - &*buffer, - offset, - ); + commandBuffer.dispatch_indirect(&*buffer, offset); } } #[inline] @@ -3652,9 +3688,7 @@ pub extern "C" fn gfxCmdCopyBuffer( regionCount: u32, pRegions: *const VkBufferCopy, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .map(|r| com::BufferCopy { src: r.srcOffset, @@ -3663,11 +3697,7 @@ pub extern "C" fn gfxCmdCopyBuffer( }); unsafe { - commandBuffer.copy_buffer( - &*srcBuffer, - &*dstBuffer, - regions, - ); + commandBuffer.copy_buffer(&*srcBuffer, &*dstBuffer, regions); } } #[inline] @@ -3680,9 +3710,7 @@ pub extern "C" fn gfxCmdCopyImage( regionCount: u32, pRegions: *const VkImageCopy, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .map(|r| com::ImageCopy { src_subresource: srcImage.map_subresource_layers(r.srcSubresource), @@ -3713,15 +3741,13 @@ pub extern "C" fn gfxCmdBlitImage( pRegions: *const VkImageBlit, filter: VkFilter, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .map(|r| com::ImageBlit { src_subresource: srcImage.map_subresource_layers(r.srcSubresource), - src_bounds: conv::map_offset(r.srcOffsets[0]) .. conv::map_offset(r.srcOffsets[1]), + src_bounds: conv::map_offset(r.srcOffsets[0])..conv::map_offset(r.srcOffsets[1]), dst_subresource: dstImage.map_subresource_layers(r.dstSubresource), - dst_bounds: conv::map_offset(r.dstOffsets[0]) .. conv::map_offset(r.dstOffsets[1]), + dst_bounds: conv::map_offset(r.dstOffsets[0])..conv::map_offset(r.dstOffsets[1]), }); unsafe { @@ -3744,9 +3770,7 @@ pub extern "C" fn gfxCmdCopyBufferToImage( regionCount: u32, pRegions: *const VkBufferImageCopy, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .map(|r| com::BufferImageCopy { buffer_offset: r.bufferOffset, @@ -3775,9 +3799,7 @@ pub extern "C" fn gfxCmdCopyImageToBuffer( regionCount: u32, pRegions: *const VkBufferImageCopy, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .map(|r| com::BufferImageCopy { buffer_offset: r.bufferOffset, @@ -3827,11 +3849,7 @@ pub extern "C" fn gfxCmdFillBuffer( (Some(dstOffset), Some(dstOffset + size)) }; unsafe { - commandBuffer.fill_buffer( - &*dstBuffer, - range, - data, - ); + commandBuffer.fill_buffer(&*dstBuffer, range, data); } } #[inline] @@ -3843,9 +3861,7 @@ pub extern "C" fn gfxCmdClearColorImage( rangeCount: u32, pRanges: *const VkImageSubresourceRange, ) { - let subresource_ranges = unsafe { - slice::from_raw_parts(pRanges, rangeCount as _) - } + let subresource_ranges = unsafe { slice::from_raw_parts(pRanges, rangeCount as _) } .iter() .map(|&range| image.map_subresource_range(range)); @@ -3853,7 +3869,9 @@ pub extern "C" fn gfxCmdClearColorImage( commandBuffer.clear_image( &image.raw, conv::map_image_layout(imageLayout), - com::ClearValue { color: mem::transmute(*pColor) }, + com::ClearValue { + color: mem::transmute(*pColor), + }, subresource_ranges, ); } @@ -3867,9 +3885,7 @@ pub extern "C" fn gfxCmdClearDepthStencilImage( rangeCount: u32, pRanges: *const VkImageSubresourceRange, ) { - let subresource_ranges = unsafe { - slice::from_raw_parts(pRanges, rangeCount as _) - } + let subresource_ranges = unsafe { slice::from_raw_parts(pRanges, rangeCount as _) } .iter() .map(|&range| image.map_subresource_range(range)); @@ -3877,8 +3893,10 @@ pub extern "C" fn gfxCmdClearDepthStencilImage( commandBuffer.clear_image( &image.raw, conv::map_image_layout(imageLayout), - com::ClearValue { depth_stencil: mem::transmute(*pDepthStencil) }, - subresource_ranges + com::ClearValue { + depth_stencil: mem::transmute(*pDepthStencil), + }, + subresource_ranges, ); } } @@ -3890,40 +3908,39 @@ pub extern "C" fn gfxCmdClearAttachments( rectCount: u32, pRects: *const VkClearRect, ) { - let attachments = unsafe { - slice::from_raw_parts(pAttachments, attachmentCount as _) - } + let attachments = unsafe { slice::from_raw_parts(pAttachments, attachmentCount as _) } .iter() .map(|at| { use VkImageAspectFlagBits::*; if at.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT as u32 != 0 { com::AttachmentClear::Color { index: at.colorAttachment as _, - value: com::ClearColor { float32: unsafe { at.clearValue.color.float32 } } //TODO? + value: com::ClearColor { + float32: unsafe { at.clearValue.color.float32 }, + }, //TODO? } } else { com::AttachmentClear::DepthStencil { depth: if at.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT as u32 != 0 { Some(unsafe { at.clearValue.depthStencil.depth }) - } else { None }, + } else { + None + }, stencil: if at.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT as u32 != 0 { Some(unsafe { at.clearValue.depthStencil.stencil }) - } else { None }, + } else { + None + }, } } }); - let rects = unsafe { - slice::from_raw_parts(pRects, rectCount as _) - } + let rects = unsafe { slice::from_raw_parts(pRects, rectCount as _) } .iter() .map(conv::map_clear_rect); unsafe { - commandBuffer.clear_attachments( - attachments, - rects - ); + commandBuffer.clear_attachments(attachments, rects); } } #[inline] @@ -3936,9 +3953,7 @@ pub extern "C" fn gfxCmdResolveImage( regionCount: u32, pRegions: *const VkImageResolve, ) { - let regions = unsafe { - slice::from_raw_parts(pRegions, regionCount as _) - } + let regions = unsafe { slice::from_raw_parts(pRegions, regionCount as _) } .iter() .cloned() .map(|resolve| com::ImageResolve { @@ -3966,10 +3981,7 @@ pub extern "C" fn gfxCmdSetEvent( stageMask: VkPipelineStageFlags, ) { unsafe { - commandBuffer.set_event( - &event, - conv::map_pipeline_stage_flags(stageMask), - ); + commandBuffer.set_event(&event, conv::map_pipeline_stage_flags(stageMask)); } } #[inline] @@ -3979,10 +3991,7 @@ pub extern "C" fn gfxCmdResetEvent( stageMask: VkPipelineStageFlags, ) { unsafe { - commandBuffer.reset_event( - &event, - conv::map_pipeline_stage_flags(stageMask), - ); + commandBuffer.reset_event(&event, conv::map_pipeline_stage_flags(stageMask)); } } @@ -3992,13 +4001,14 @@ fn make_barriers<'a>( raw_images: &'a [VkImageMemoryBarrier], ) -> impl Iterator> { let globals = raw_globals.iter().flat_map(|b| { - let buf = conv::map_buffer_access(b.srcAccessMask) .. conv::map_buffer_access(b.dstAccessMask); + let buf = + conv::map_buffer_access(b.srcAccessMask)..conv::map_buffer_access(b.dstAccessMask); let buf_bar = if !buf.start.is_empty() || !buf.end.is_empty() { Some(memory::Barrier::AllBuffers(buf)) } else { None }; - let img = conv::map_image_access(b.srcAccessMask) .. conv::map_image_access(b.dstAccessMask); + let img = conv::map_image_access(b.srcAccessMask)..conv::map_image_access(b.dstAccessMask); let img_bar = if !img.start.is_empty() || !img.end.is_empty() { Some(memory::Barrier::AllImages(img)) } else { @@ -4008,15 +4018,24 @@ fn make_barriers<'a>( }); let buffers = raw_buffers.iter().map(|b| memory::Barrier::Buffer { - states: conv::map_buffer_access(b.srcAccessMask) .. conv::map_buffer_access(b.dstAccessMask), + states: conv::map_buffer_access(b.srcAccessMask)..conv::map_buffer_access(b.dstAccessMask), target: &*b.buffer, - range: Some(b.offset) .. if b.size as i32 == VK_WHOLE_SIZE { None } else { Some(b.offset + b.size) }, + range: Some(b.offset)..if b.size as i32 == VK_WHOLE_SIZE { + None + } else { + Some(b.offset + b.size) + }, families: None, }); let images = raw_images.iter().map(|b| memory::Barrier::Image { - states: - (conv::map_image_access(b.srcAccessMask), conv::map_image_layout(b.oldLayout)) .. - (conv::map_image_access(b.dstAccessMask), conv::map_image_layout(b.newLayout)), + states: ( + conv::map_image_access(b.srcAccessMask), + conv::map_image_layout(b.oldLayout), + ) + ..( + conv::map_image_access(b.dstAccessMask), + conv::map_image_layout(b.newLayout), + ), target: &b.image.raw, range: b.image.map_subresource_range(b.subresourceRange), families: None, @@ -4039,22 +4058,21 @@ pub extern "C" fn gfxCmdWaitEvents( imageMemoryBarrierCount: u32, pImageMemoryBarriers: *const VkImageMemoryBarrier, ) { - let raw_globals = unsafe { - slice::from_raw_parts(pMemoryBarriers, memoryBarrierCount as _) - }; - let raw_buffers = unsafe { - slice::from_raw_parts(pBufferMemoryBarriers, bufferMemoryBarrierCount as _) - }; - let raw_images = unsafe { - slice::from_raw_parts(pImageMemoryBarriers, imageMemoryBarrierCount as _) - }; + let raw_globals = unsafe { slice::from_raw_parts(pMemoryBarriers, memoryBarrierCount as _) }; + let raw_buffers = + unsafe { slice::from_raw_parts(pBufferMemoryBarriers, bufferMemoryBarrierCount as _) }; + let raw_images = + unsafe { slice::from_raw_parts(pImageMemoryBarriers, imageMemoryBarrierCount as _) }; let barriers = make_barriers(raw_globals, raw_buffers, raw_images); unsafe { commandBuffer.wait_events( - slice::from_raw_parts(pEvents, eventCount as usize).iter().map(|ev| &**ev), - conv::map_pipeline_stage_flags(srcStageMask) .. conv::map_pipeline_stage_flags(dstStageMask), + slice::from_raw_parts(pEvents, eventCount as usize) + .iter() + .map(|ev| &**ev), + conv::map_pipeline_stage_flags(srcStageMask) + ..conv::map_pipeline_stage_flags(dstStageMask), barriers, ); } @@ -4072,22 +4090,20 @@ pub extern "C" fn gfxCmdPipelineBarrier( imageMemoryBarrierCount: u32, pImageMemoryBarriers: *const VkImageMemoryBarrier, ) { - let raw_globals = unsafe { - slice::from_raw_parts(pMemoryBarriers, memoryBarrierCount as _) - }; - let raw_buffers = unsafe { - slice::from_raw_parts(pBufferMemoryBarriers, bufferMemoryBarrierCount as _) - }; - let raw_images = unsafe { - slice::from_raw_parts(pImageMemoryBarriers, imageMemoryBarrierCount as _) - }; + let raw_globals = unsafe { slice::from_raw_parts(pMemoryBarriers, memoryBarrierCount as _) }; + let raw_buffers = + unsafe { slice::from_raw_parts(pBufferMemoryBarriers, bufferMemoryBarrierCount as _) }; + let raw_images = + unsafe { slice::from_raw_parts(pImageMemoryBarriers, imageMemoryBarrierCount as _) }; let barriers = make_barriers(raw_globals, raw_buffers, raw_images); unsafe { commandBuffer.pipeline_barrier( - conv::map_pipeline_stage_flags(srcStageMask) .. conv::map_pipeline_stage_flags(dstStageMask), - memory::Dependencies::from_bits(dependencyFlags as _).unwrap_or(memory::Dependencies::empty()), + conv::map_pipeline_stage_flags(srcStageMask) + ..conv::map_pipeline_stage_flags(dstStageMask), + memory::Dependencies::from_bits(dependencyFlags as _) + .unwrap_or(memory::Dependencies::empty()), barriers, ); } @@ -4129,7 +4145,7 @@ pub extern "C" fn gfxCmdResetQueryPool( queryCount: u32, ) { unsafe { - commandBuffer.reset_query_pool(&*queryPool, firstQuery .. firstQuery + queryCount); + commandBuffer.reset_query_pool(&*queryPool, firstQuery..firstQuery + queryCount); } } #[inline] @@ -4161,7 +4177,7 @@ pub extern "C" fn gfxCmdCopyQueryPoolResults( unsafe { commandBuffer.copy_query_pool_results( &*queryPool, - firstQuery .. firstQuery + queryCount, + firstQuery..firstQuery + queryCount, &*dstBuffer, dstOffset, stride, @@ -4183,11 +4199,7 @@ pub extern "C" fn gfxCmdPushConstants( let values = slice::from_raw_parts(pValues as *const u32, size as usize / 4); if stageFlags & VkShaderStageFlagBits::VK_SHADER_STAGE_COMPUTE_BIT as u32 != 0 { - commandBuffer.push_compute_constants( - &*layout, - offset, - values, - ); + commandBuffer.push_compute_constants(&*layout, offset, values); } if stageFlags & VkShaderStageFlagBits::VK_SHADER_STAGE_ALL_GRAPHICS as u32 != 0 { commandBuffer.push_graphics_constants( @@ -4243,9 +4255,7 @@ pub extern "C" fn gfxCmdNextSubpass( } } #[inline] -pub extern "C" fn gfxCmdEndRenderPass( - mut commandBuffer: VkCommandBuffer, -) { +pub extern "C" fn gfxCmdEndRenderPass(mut commandBuffer: VkCommandBuffer) { unsafe { commandBuffer.end_render_pass(); } @@ -4257,9 +4267,10 @@ pub extern "C" fn gfxCmdExecuteCommands( pCommandBuffers: *const VkCommandBuffer, ) { unsafe { - commandBuffer.execute_commands( - slice::from_raw_parts(pCommandBuffers, commandBufferCount as _), - ); + commandBuffer.execute_commands(slice::from_raw_parts( + pCommandBuffers, + commandBufferCount as _, + )); } } @@ -4273,7 +4284,7 @@ pub extern "C" fn gfxDestroySurfaceKHR( } #[inline] -pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR( +pub extern "C" fn gfxGetPhysicalDeviceSurfaceSupportKHR( adapter: VkPhysicalDevice, queueFamilyIndex: u32, surface: VkSurfaceKHR, @@ -4291,8 +4302,7 @@ pub extern "C" fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR( surface: VkSurfaceKHR, pSurfaceCapabilities: *mut VkSurfaceCapabilitiesKHR, ) -> VkResult { - let (caps, _, _supported_transforms) = - surface.compatibility(&adapter.physical_device); + let (caps, _, _supported_transforms) = surface.compatibility(&adapter.physical_device); let output = VkSurfaceCapabilitiesKHR { minImageCount: *caps.image_count.start(), @@ -4358,8 +4368,7 @@ pub extern "C" fn gfxGetPhysicalDeviceSurfacePresentModesKHR( pPresentModeCount: *mut u32, pPresentModes: *mut VkPresentModeKHR, ) -> VkResult { - let (_, _, present_modes) = surface - .compatibility(&adapter.physical_device); + let (_, _, present_modes) = surface.compatibility(&adapter.physical_device); let num_present_modes = present_modes.len(); @@ -4388,7 +4397,7 @@ pub extern "C" fn gfxGetPhysicalDeviceSurfacePresentModesKHR( #[inline] pub extern "C" fn gfxGetPhysicalDeviceWin32PresentationSupportKHR( adapter: VkPhysicalDevice, - queueFamilyIndex: u32 + queueFamilyIndex: u32, ) -> VkBool32 { VK_TRUE } @@ -4426,9 +4435,15 @@ pub extern "C" fn gfxCreateSwapchainKHR( } { Ok(pair) => pair, Err(hal::window::CreationError::OutOfMemory(oom)) => return map_oom(oom), - Err(hal::window::CreationError::DeviceLost(hal::device::DeviceLost)) => return VkResult::VK_ERROR_DEVICE_LOST, - Err(hal::window::CreationError::SurfaceLost(hal::device::SurfaceLost)) => return VkResult::VK_ERROR_SURFACE_LOST_KHR, - Err(hal::window::CreationError::WindowInUse(hal::device::WindowInUse)) => return VkResult::VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, + Err(hal::window::CreationError::DeviceLost(hal::device::DeviceLost)) => { + return VkResult::VK_ERROR_DEVICE_LOST + } + Err(hal::window::CreationError::SurfaceLost(hal::device::SurfaceLost)) => { + return VkResult::VK_ERROR_SURFACE_LOST_KHR + } + Err(hal::window::CreationError::WindowInUse(hal::device::WindowInUse)) => { + return VkResult::VK_ERROR_NATIVE_WINDOW_IN_USE_KHR + } }; #[cfg(feature = "gfx-backend-metal")] @@ -4447,11 +4462,13 @@ pub extern "C" fn gfxCreateSwapchainKHR( let images = backbuffers .into_iter() - .map(|raw| Handle::new(Image { - raw, - mip_levels: 1, - array_layers: 1, - })) + .map(|raw| { + Handle::new(Image { + raw, + mip_levels: 1, + array_layers: 1, + }) + }) .collect(); let swapchain = Swapchain { @@ -4664,7 +4681,9 @@ pub extern "C" fn gfxCreateWin32SurfaceKHR( unsafe { assert_eq!(info.flags, 0); *pSurface = Handle::new( - instance.backend.create_surface_from_hwnd(info.hinstance, info.hwnd), + instance + .backend + .create_surface_from_hwnd(info.hinstance, info.hwnd), ); VkResult::VK_SUCCESS } @@ -4679,7 +4698,11 @@ pub extern "C" fn gfxCreateWin32SurfaceKHR( } #[cfg(not(all( target_os = "windows", - any(feature = "gfx-backend-vulkan", feature = "gfx-backend-dx12", feature = "gfx-backend-dx11") + any( + feature = "gfx-backend-vulkan", + feature = "gfx-backend-dx12", + feature = "gfx-backend-dx11" + ) )))] { let _ = (instance, info, pSurface); @@ -4699,7 +4722,9 @@ pub extern "C" fn gfxCreateXcbSurfaceKHR( unsafe { assert_eq!(info.flags, 0); *pSurface = Handle::new( - instance.backend.create_surface_from_xcb(info.connection as _, info.window), + instance + .backend + .create_surface_from_xcb(info.connection as _, info.window), ); VkResult::VK_SUCCESS } @@ -4726,11 +4751,11 @@ pub extern "C" fn gfxAcquireNextImageKHR( use hal::device::OutOfMemory::{Device, Host}; - match unsafe { - raw.acquire_image(timeout, semaphore.as_ref(), fence.as_ref()) - } { + match unsafe { raw.acquire_image(timeout, semaphore.as_ref(), fence.as_ref()) } { Ok(frame) => { - unsafe { *pImageIndex = frame.0; } + unsafe { + *pImageIndex = frame.0; + } VkResult::VK_SUCCESS } Err(hal::window::AcquireError::NotReady) => VkResult::VK_NOT_READY, @@ -4738,7 +4763,9 @@ pub extern "C" fn gfxAcquireNextImageKHR( Err(hal::window::AcquireError::SurfaceLost(_)) => VkResult::VK_ERROR_SURFACE_LOST_KHR, Err(hal::window::AcquireError::DeviceLost(_)) => VkResult::VK_ERROR_DEVICE_LOST, Err(hal::window::AcquireError::Timeout) => VkResult::VK_TIMEOUT, - Err(hal::window::AcquireError::OutOfMemory(Device)) => VkResult::VK_ERROR_OUT_OF_DEVICE_MEMORY, + Err(hal::window::AcquireError::OutOfMemory(Device)) => { + VkResult::VK_ERROR_OUT_OF_DEVICE_MEMORY + } Err(hal::window::AcquireError::OutOfMemory(Host)) => VkResult::VK_ERROR_OUT_OF_HOST_MEMORY, } } @@ -4749,12 +4776,10 @@ pub extern "C" fn gfxQueuePresentKHR( ) -> VkResult { let info = unsafe { &*pPresentInfo }; - let swapchain_slice = unsafe { - slice::from_raw_parts(info.pSwapchains, info.swapchainCount as _) - }; - let index_slice = unsafe { - slice::from_raw_parts(info.pImageIndices, info.swapchainCount as _) - }; + let swapchain_slice = + unsafe { slice::from_raw_parts(info.pSwapchains, info.swapchainCount as _) }; + let index_slice = + unsafe { slice::from_raw_parts(info.pImageIndices, info.swapchainCount as _) }; let swapchains = swapchain_slice .into_iter() .zip(index_slice) @@ -4766,9 +4791,7 @@ pub extern "C" fn gfxQueuePresentKHR( .map(|semaphore| &**semaphore) }; - match unsafe { - queue.present(swapchains, wait_semaphores) - } { + match unsafe { queue.present(swapchains, wait_semaphores) } { Ok(_) => VkResult::VK_SUCCESS, Err(_) => VkResult::VK_ERROR_SURFACE_LOST_KHR, } @@ -4791,7 +4814,9 @@ pub extern "C" fn gfxCreateMetalSurfaceEXT( } assert_eq!(info.flags, 0); *pSurface = Handle::new( - instance.backend.create_surface_from_layer(info.pLayer as *mut _, enable_signposts), + instance + .backend + .create_surface_from_layer(info.pLayer as *mut _, enable_signposts), ); VkResult::VK_SUCCESS } @@ -4811,7 +4836,7 @@ pub extern "C" fn gfxCreateMacOSSurfaceMVK( ) -> VkResult { assert!(pAllocator.is_null()); let info = unsafe { &*pCreateInfo }; - #[cfg(all(target_os="macos", feature = "gfx-backend-metal"))] + #[cfg(all(target_os = "macos", feature = "gfx-backend-metal"))] unsafe { let enable_signposts = env::var("GFX_METAL_SIGNPOSTS").is_ok(); if enable_signposts { @@ -4819,11 +4844,13 @@ pub extern "C" fn gfxCreateMacOSSurfaceMVK( } assert_eq!(info.flags, 0); *pSurface = Handle::new( - instance.backend.create_surface_from_nsview(info.pView, enable_signposts), + instance + .backend + .create_surface_from_nsview(info.pView, enable_signposts), ); VkResult::VK_SUCCESS } - #[cfg(not(all(target_os="macos", feature = "gfx-backend-metal")))] + #[cfg(not(all(target_os = "macos", feature = "gfx-backend-metal")))] { let _ = (instance, info, pSurface); unreachable!() diff --git a/libportability-gfx/src/lib.rs b/libportability-gfx/src/lib.rs index f69ad24..044cba2 100644 --- a/libportability-gfx/src/lib.rs +++ b/libportability-gfx/src/lib.rs @@ -4,17 +4,10 @@ #![allow(improper_ctypes)] //TEMP: buggy Rustc FFI analysis #![cfg_attr(feature = "nightly", feature(core_intrinsics))] -extern crate gfx_hal as hal; -#[cfg(feature = "gfx-backend-dx12")] -extern crate gfx_backend_dx12 as back; #[cfg(feature = "gfx-backend-dx11")] extern crate gfx_backend_dx11 as back; -#[cfg(feature = "gfx-backend-metal")] -extern crate gfx_backend_metal as back; -#[cfg(feature = "gfx-backend-vulkan")] -extern crate gfx_backend_vulkan as back; -#[cfg(feature = "gfx-backend-gl")] -extern crate gfx_backend_gl as back; +#[cfg(feature = "gfx-backend-dx12")] +extern crate gfx_backend_dx12 as back; #[cfg(not(any( feature = "gfx-backend-dx12", feature = "gfx-backend-dx11", @@ -23,6 +16,13 @@ extern crate gfx_backend_gl as back; feature = "gfx-backend-gl", )))] extern crate gfx_backend_empty as back; +#[cfg(feature = "gfx-backend-gl")] +extern crate gfx_backend_gl as back; +#[cfg(feature = "gfx-backend-metal")] +extern crate gfx_backend_metal as back; +#[cfg(feature = "gfx-backend-vulkan")] +extern crate gfx_backend_vulkan as back; +extern crate gfx_hal as hal; extern crate copyless; #[macro_use] @@ -41,8 +41,8 @@ mod impls; use back::Backend as B; use handle::{DispatchHandle, Handle}; -use std::{slice}; use std::collections::HashMap; +use std::slice; pub use impls::*; @@ -117,7 +117,10 @@ impl Image { } } - fn map_subresource_layers(&self, subresource: VkImageSubresourceLayers) -> hal::image::SubresourceLayers { + fn map_subresource_layers( + &self, + subresource: VkImageSubresourceLayers, + ) -> hal::image::SubresourceLayers { let layer_end = if subresource.layerCount == VK_REMAINING_ARRAY_LAYERS as _ { self.array_layers } else { @@ -126,11 +129,12 @@ impl Image { hal::image::SubresourceLayers { aspects: conv::map_aspect(subresource.aspectMask), level: subresource.mipLevel as _, - layers: subresource.baseArrayLayer as _ .. layer_end as _, + layers: subresource.baseArrayLayer as _..layer_end as _, } } - fn map_subresource_range(&self, + fn map_subresource_range( + &self, subresource: VkImageSubresourceRange, ) -> hal::image::SubresourceRange { let level_end = if subresource.levelCount == VK_REMAINING_MIP_LEVELS as _ { @@ -145,8 +149,8 @@ impl Image { }; hal::image::SubresourceRange { aspects: conv::map_aspect(subresource.aspectMask), - levels: subresource.baseMipLevel as _ .. level_end as _, - layers: subresource.baseArrayLayer as _ .. layer_end as _, + levels: subresource.baseMipLevel as _..level_end as _, + layers: subresource.baseArrayLayer as _..layer_end as _, } } } @@ -269,101 +273,73 @@ pub const VK_MAX_EXTENSION_NAME_SIZE: ::std::os::raw::c_uint = 256; pub const VK_MAX_DESCRIPTION_SIZE: ::std::os::raw::c_uint = 256; pub const VK_KHR_surface: ::std::os::raw::c_uint = 1; pub const VK_KHR_SURFACE_SPEC_VERSION: ::std::os::raw::c_uint = 25; -pub const VK_KHR_SURFACE_EXTENSION_NAME: &'static [u8; 15usize] = - b"VK_KHR_surface\x00"; +pub const VK_KHR_SURFACE_EXTENSION_NAME: &'static [u8; 15usize] = b"VK_KHR_surface\x00"; pub const VK_KHR_WIN32_SURFACE_SPEC_VERSION: ::std::os::raw::c_uint = 6; pub const VK_MVK_MACOS_SURFACE_SPEC_VERSION: ::std::os::raw::c_uint = 2; -pub const VK_KHR_WIN32_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = - b"VK_KHR_win32_surface\x00"; -pub const VK_MVK_MACOS_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = - b"VK_MVK_macos_surface\x00"; -pub const VK_EXT_METAL_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = - b"VK_EXT_metal_surface\x00"; +pub const VK_KHR_WIN32_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = b"VK_KHR_win32_surface\x00"; +pub const VK_MVK_MACOS_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = b"VK_MVK_macos_surface\x00"; +pub const VK_EXT_METAL_SURFACE_EXTENSION_NAME: &'static [u8; 21usize] = b"VK_EXT_metal_surface\x00"; pub const VK_EXT_METAL_SURFACE_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_KHR_swapchain: ::std::os::raw::c_uint = 1; pub const VK_KHR_SWAPCHAIN_SPEC_VERSION: ::std::os::raw::c_uint = 68; -pub const VK_KHR_SWAPCHAIN_EXTENSION_NAME: &'static [u8; 17usize] = - b"VK_KHR_swapchain\x00"; +pub const VK_KHR_SWAPCHAIN_EXTENSION_NAME: &'static [u8; 17usize] = b"VK_KHR_swapchain\x00"; pub const VK_KHR_display: ::std::os::raw::c_uint = 1; pub const VK_KHR_DISPLAY_SPEC_VERSION: ::std::os::raw::c_uint = 21; -pub const VK_KHR_DISPLAY_EXTENSION_NAME: &'static [u8; 15usize] = - b"VK_KHR_display\x00"; +pub const VK_KHR_DISPLAY_EXTENSION_NAME: &'static [u8; 15usize] = b"VK_KHR_display\x00"; pub const VK_KHR_display_swapchain: ::std::os::raw::c_uint = 1; pub const VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION: ::std::os::raw::c_uint = 9; pub const VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME: &'static [u8; 25usize] = b"VK_KHR_display_swapchain\x00"; pub const VK_KHR_sampler_mirror_clamp_to_edge: ::std::os::raw::c_uint = 1; -pub const VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME: - &'static [u8; 36usize] = +pub const VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME: &'static [u8; 36usize] = b"VK_KHR_sampler_mirror_clamp_to_edge\x00"; pub const VK_KHR_get_physical_device_properties2: ::std::os::raw::c_uint = 1; -pub const VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME: - &'static [u8; 39usize] = +pub const VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME: &'static [u8; 39usize] = b"VK_KHR_get_physical_device_properties2\x00"; pub const VK_KHR_shader_draw_parameters: ::std::os::raw::c_uint = 1; -pub const VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME: &'static [u8; 30usize] - = +pub const VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME: &'static [u8; 30usize] = b"VK_KHR_shader_draw_parameters\x00"; pub const VK_KHR_maintenance1: ::std::os::raw::c_uint = 1; pub const VK_KHR_MAINTENANCE1_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_KHR_MAINTENANCE1_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_KHR_maintenance1\x00"; +pub const VK_KHR_MAINTENANCE1_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_KHR_maintenance1\x00"; pub const VK_KHR_push_descriptor: ::std::os::raw::c_uint = 1; pub const VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME: &'static [u8; 23usize] = b"VK_KHR_push_descriptor\x00"; pub const VK_KHR_descriptor_update_template: ::std::os::raw::c_uint = 1; -pub const VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME: - &'static [u8; 34usize] = +pub const VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME: &'static [u8; 34usize] = b"VK_KHR_descriptor_update_template\x00"; pub const VK_EXT_debug_report: ::std::os::raw::c_uint = 1; pub const VK_EXT_DEBUG_REPORT_SPEC_VERSION: ::std::os::raw::c_uint = 5; -pub const VK_EXT_DEBUG_REPORT_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_EXT_debug_report\x00"; +pub const VK_EXT_DEBUG_REPORT_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_EXT_debug_report\x00"; pub const VK_NV_glsl_shader: ::std::os::raw::c_uint = 1; pub const VK_NV_GLSL_SHADER_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_NV_GLSL_SHADER_EXTENSION_NAME: &'static [u8; 18usize] = - b"VK_NV_glsl_shader\x00"; +pub const VK_NV_GLSL_SHADER_EXTENSION_NAME: &'static [u8; 18usize] = b"VK_NV_glsl_shader\x00"; pub const VK_IMG_filter_cubic: ::std::os::raw::c_uint = 1; pub const VK_IMG_FILTER_CUBIC_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_IMG_FILTER_CUBIC_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_IMG_filter_cubic\x00"; +pub const VK_IMG_FILTER_CUBIC_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_IMG_filter_cubic\x00"; pub const VK_AMD_rasterization_order: ::std::os::raw::c_uint = 1; pub const VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME: &'static [u8; 27usize] = b"VK_AMD_rasterization_order\x00"; pub const VK_AMD_shader_trinary_minmax: ::std::os::raw::c_uint = 1; -pub const VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME: &'static [u8; 29usize] - = +pub const VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME: &'static [u8; 29usize] = b"VK_AMD_shader_trinary_minmax\x00"; pub const VK_AMD_shader_explicit_vertex_parameter: ::std::os::raw::c_uint = 1; -pub const VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME: - &'static [u8; 40usize] = +pub const VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME: &'static [u8; 40usize] = b"VK_AMD_shader_explicit_vertex_parameter\x00"; pub const VK_EXT_debug_marker: ::std::os::raw::c_uint = 1; pub const VK_EXT_DEBUG_MARKER_SPEC_VERSION: ::std::os::raw::c_uint = 4; -pub const VK_EXT_DEBUG_MARKER_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_EXT_debug_marker\x00"; +pub const VK_EXT_DEBUG_MARKER_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_EXT_debug_marker\x00"; pub const VK_AMD_gcn_shader: ::std::os::raw::c_uint = 1; pub const VK_AMD_GCN_SHADER_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_AMD_GCN_SHADER_EXTENSION_NAME: &'static [u8; 18usize] = - b"VK_AMD_gcn_shader\x00"; +pub const VK_AMD_GCN_SHADER_EXTENSION_NAME: &'static [u8; 18usize] = b"VK_AMD_gcn_shader\x00"; pub const VK_NV_dedicated_allocation: ::std::os::raw::c_uint = 1; pub const VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME: &'static [u8; 27usize] = @@ -373,36 +349,25 @@ pub const VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME: &'static [u8; 27usize] = b"VK_AMD_draw_indirect_count\x00"; pub const VK_AMD_negative_viewport_height: ::std::os::raw::c_uint = 1; -pub const VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION: ::std::os::raw::c_uint - = - 1; -pub const VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME: - &'static [u8; 32usize] = +pub const VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME: &'static [u8; 32usize] = b"VK_AMD_negative_viewport_height\x00"; pub const VK_AMD_gpu_shader_half_float: ::std::os::raw::c_uint = 1; -pub const VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME: &'static [u8; 29usize] - = +pub const VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME: &'static [u8; 29usize] = b"VK_AMD_gpu_shader_half_float\x00"; pub const VK_AMD_shader_ballot: ::std::os::raw::c_uint = 1; pub const VK_AMD_SHADER_BALLOT_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_AMD_SHADER_BALLOT_EXTENSION_NAME: &'static [u8; 21usize] = - b"VK_AMD_shader_ballot\x00"; +pub const VK_AMD_SHADER_BALLOT_EXTENSION_NAME: &'static [u8; 21usize] = b"VK_AMD_shader_ballot\x00"; pub const VK_KHX_multiview: ::std::os::raw::c_uint = 1; pub const VK_KHX_MULTIVIEW_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_KHX_MULTIVIEW_EXTENSION_NAME: &'static [u8; 17usize] = - b"VK_KHX_multiview\x00"; +pub const VK_KHX_MULTIVIEW_EXTENSION_NAME: &'static [u8; 17usize] = b"VK_KHX_multiview\x00"; pub const VK_IMG_format_pvrtc: ::std::os::raw::c_uint = 1; pub const VK_IMG_FORMAT_PVRTC_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_IMG_FORMAT_PVRTC_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_IMG_format_pvrtc\x00"; +pub const VK_IMG_FORMAT_PVRTC_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_IMG_format_pvrtc\x00"; pub const VK_NV_external_memory_capabilities: ::std::os::raw::c_uint = 1; -pub const VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME: - &'static [u8; 35usize] = +pub const VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME: &'static [u8; 35usize] = b"VK_NV_external_memory_capabilities\x00"; pub const VK_NV_external_memory: ::std::os::raw::c_uint = 1; pub const VK_NV_EXTERNAL_MEMORY_SPEC_VERSION: ::std::os::raw::c_uint = 1; @@ -411,36 +376,27 @@ pub const VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME: &'static [u8; 22usize] = pub const VK_KHX_device_group: ::std::os::raw::c_uint = 1; pub const VK_MAX_DEVICE_GROUP_SIZE_KHX: ::std::os::raw::c_uint = 32; pub const VK_KHX_DEVICE_GROUP_SPEC_VERSION: ::std::os::raw::c_uint = 1; -pub const VK_KHX_DEVICE_GROUP_EXTENSION_NAME: &'static [u8; 20usize] = - b"VK_KHX_device_group\x00"; +pub const VK_KHX_DEVICE_GROUP_EXTENSION_NAME: &'static [u8; 20usize] = b"VK_KHX_device_group\x00"; pub const VK_EXT_validation_flags: ::std::os::raw::c_uint = 1; pub const VK_EXT_VALIDATION_FLAGS_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME: &'static [u8; 24usize] = b"VK_EXT_validation_flags\x00"; pub const VK_EXT_shader_subgroup_ballot: ::std::os::raw::c_uint = 1; -pub const VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME: &'static [u8; 30usize] - = +pub const VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME: &'static [u8; 30usize] = b"VK_EXT_shader_subgroup_ballot\x00"; pub const VK_EXT_shader_subgroup_vote: ::std::os::raw::c_uint = 1; -pub const VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION: ::std::os::raw::c_uint = - 1; +pub const VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME: &'static [u8; 28usize] = b"VK_EXT_shader_subgroup_vote\x00"; pub const VK_KHX_device_group_creation: ::std::os::raw::c_uint = 1; -pub const VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME: &'static [u8; 29usize] - = +pub const VK_KHX_DEVICE_GROUP_CREATION_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME: &'static [u8; 29usize] = b"VK_KHX_device_group_creation\x00"; pub const VK_KHX_external_memory_capabilities: ::std::os::raw::c_uint = 1; pub const VK_LUID_SIZE_KHX: ::std::os::raw::c_uint = 8; -pub const VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME: - &'static [u8; 36usize] = +pub const VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME: &'static [u8; 36usize] = b"VK_KHX_external_memory_capabilities\x00"; pub const VK_KHX_external_memory: ::std::os::raw::c_uint = 1; pub const VK_KHX_EXTERNAL_MEMORY_SPEC_VERSION: ::std::os::raw::c_uint = 1; @@ -452,28 +408,20 @@ pub const VK_KHX_EXTERNAL_MEMORY_FD_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME: &'static [u8; 26usize] = b"VK_KHX_external_memory_fd\x00"; pub const VK_KHX_external_semaphore_capabilities: ::std::os::raw::c_uint = 1; -pub const VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME: - &'static [u8; 39usize] = +pub const VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME: &'static [u8; 39usize] = b"VK_KHX_external_semaphore_capabilities\x00"; pub const VK_KHX_external_semaphore: ::std::os::raw::c_uint = 1; pub const VK_KHX_EXTERNAL_SEMAPHORE_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME: &'static [u8; 26usize] = b"VK_KHX_external_semaphore\x00"; pub const VK_KHX_external_semaphore_fd: ::std::os::raw::c_uint = 1; -pub const VK_KHX_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION: ::std::os::raw::c_uint = - 1; -pub const VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME: &'static [u8; 29usize] - = +pub const VK_KHX_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME: &'static [u8; 29usize] = b"VK_KHX_external_semaphore_fd\x00"; pub const VK_NVX_device_generated_commands: ::std::os::raw::c_uint = 1; -pub const VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME: - &'static [u8; 33usize] = +pub const VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME: &'static [u8; 33usize] = b"VK_NVX_device_generated_commands\x00"; pub const VK_NV_clip_space_w_scaling: ::std::os::raw::c_uint = 1; pub const VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION: ::std::os::raw::c_uint = 1; @@ -484,40 +432,28 @@ pub const VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME: &'static [u8; 27usize] = b"VK_EXT_direct_mode_display\x00"; pub const VK_EXT_display_surface_counter: ::std::os::raw::c_uint = 1; -pub const VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION: ::std::os::raw::c_uint - = - 1; -pub const VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME: - &'static [u8; 31usize] = +pub const VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME: &'static [u8; 31usize] = b"VK_EXT_display_surface_counter\x00"; pub const VK_EXT_display_control: ::std::os::raw::c_uint = 1; pub const VK_EXT_DISPLAY_CONTROL_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME: &'static [u8; 23usize] = b"VK_EXT_display_control\x00"; pub const VK_NV_sample_mask_override_coverage: ::std::os::raw::c_uint = 1; -pub const VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME: - &'static [u8; 36usize] = +pub const VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME: &'static [u8; 36usize] = b"VK_NV_sample_mask_override_coverage\x00"; pub const VK_NV_geometry_shader_passthrough: ::std::os::raw::c_uint = 1; -pub const VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME: - &'static [u8; 34usize] = +pub const VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME: &'static [u8; 34usize] = b"VK_NV_geometry_shader_passthrough\x00"; pub const VK_NV_viewport_array2: ::std::os::raw::c_uint = 1; pub const VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME: &'static [u8; 22usize] = b"VK_NV_viewport_array2\x00"; pub const VK_NVX_multiview_per_view_attributes: ::std::os::raw::c_uint = 1; -pub const VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME: - &'static [u8; 37usize] = +pub const VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME: &'static [u8; 37usize] = b"VK_NVX_multiview_per_view_attributes\x00"; pub const VK_NV_viewport_swizzle: ::std::os::raw::c_uint = 1; pub const VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION: ::std::os::raw::c_uint = 1; @@ -528,14 +464,10 @@ pub const VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION: ::std::os::raw::c_uint = 1; pub const VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME: &'static [u8; 26usize] = b"VK_EXT_discard_rectangles\x00"; pub const VK_EXTX_portability_subset: ::std::os::raw::c_uint = 1; -pub const VK_EXTX_PORTABILITY_SUBSET_SPEC_VERSION: - ::std::os::raw::c_uint = - 1; -pub const VK_EXTX_PORTABILITY_SUBSET_EXTENSION_NAME: - &'static [u8; 27usize] = +pub const VK_EXTX_PORTABILITY_SUBSET_SPEC_VERSION: ::std::os::raw::c_uint = 1; +pub const VK_EXTX_PORTABILITY_SUBSET_EXTENSION_NAME: &'static [u8; 27usize] = b"VK_EXTX_portability_subset\x00"; - pub type wchar_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy)] @@ -545,7 +477,9 @@ pub struct max_align_t { pub __clang_max_align_nonce2: f64, } impl Clone for max_align_t { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; @@ -579,7 +513,9 @@ pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } impl Clone for __fsid_t { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub type __clock_t = ::std::os::raw::c_long; pub type __rlim_t = ::std::os::raw::c_ulong; @@ -632,13 +568,13 @@ pub type VkDeviceSize = u64; pub type VkSampleMask = u32; pub const VkPipelineCacheHeaderVersion_VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE: - VkPipelineCacheHeaderVersion = + VkPipelineCacheHeaderVersion = VkPipelineCacheHeaderVersion::VK_PIPELINE_CACHE_HEADER_VERSION_ONE; pub const VkPipelineCacheHeaderVersion_VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE: - VkPipelineCacheHeaderVersion = + VkPipelineCacheHeaderVersion = VkPipelineCacheHeaderVersion::VK_PIPELINE_CACHE_HEADER_VERSION_ONE; pub const VkPipelineCacheHeaderVersion_VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE: - VkPipelineCacheHeaderVersion = + VkPipelineCacheHeaderVersion = VkPipelineCacheHeaderVersion::VK_PIPELINE_CACHE_HEADER_VERSION_ONE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -646,8 +582,7 @@ pub enum VkPipelineCacheHeaderVersion { VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 2147483647, } -pub const VkResult_VK_RESULT_BEGIN_RANGE: VkResult = - VkResult::VK_ERROR_FRAGMENTED_POOL; +pub const VkResult_VK_RESULT_BEGIN_RANGE: VkResult = VkResult::VK_ERROR_FRAGMENTED_POOL; pub const VkResult_VK_RESULT_END_RANGE: VkResult = VkResult::VK_INCOMPLETE; #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -751,15 +686,13 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = - 1000018000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, - VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = - 1000026002, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX = 1000053000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX = 1000053001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHX = 1000053002, @@ -776,8 +709,7 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = - 1000059008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHX = 1000060000, VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX = 1000060001, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX = 1000060002, @@ -795,8 +727,7 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHX = 1000070000, VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHX = 1000070001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX = - 1000071000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHX = 1000071000, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHX = 1000071001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHX = 1000071002, VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHX = 1000071003, @@ -813,16 +744,14 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHX = 1000074000, VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHX = 1000074001, VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHX = 1000075000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX = - 1000076000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHX = 1000076000, VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHX = 1000076001, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHX = 1000077000, VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078000, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHX = 1000078001, VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHX = 1000078002, VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX = 1000079000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = - 1000080000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, @@ -830,21 +759,16 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = - 1000087000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002, VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX - = 1000097000, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = - 1000098000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = - 1000099000, - VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = - 1000099001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = 1000097000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000, VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000248000, @@ -853,11 +777,9 @@ pub enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_SUPPORT_EXTX = 100163002, VK_STRUCTURE_TYPE_MAX_ENUM = 2147483647, } -pub const VkSystemAllocationScope_VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE: - VkSystemAllocationScope = +pub const VkSystemAllocationScope_VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE: VkSystemAllocationScope = VkSystemAllocationScope::VK_SYSTEM_ALLOCATION_SCOPE_COMMAND; -pub const VkSystemAllocationScope_VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE: - VkSystemAllocationScope = +pub const VkSystemAllocationScope_VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE: VkSystemAllocationScope = VkSystemAllocationScope::VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -871,10 +793,8 @@ pub enum VkSystemAllocationScope { VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 2147483647, } pub const VkInternalAllocationType_VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE: - VkInternalAllocationType = - VkInternalAllocationType::VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE; -pub const VkInternalAllocationType_VK_INTERNAL_ALLOCATION_TYPE_END_RANGE: - VkInternalAllocationType = + VkInternalAllocationType = VkInternalAllocationType::VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE; +pub const VkInternalAllocationType_VK_INTERNAL_ALLOCATION_TYPE_END_RANGE: VkInternalAllocationType = VkInternalAllocationType::VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -883,10 +803,8 @@ pub enum VkInternalAllocationType { VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = 1, VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 2147483647, } -pub const VkFormat_VK_FORMAT_BEGIN_RANGE: VkFormat = - VkFormat::VK_FORMAT_UNDEFINED; -pub const VkFormat_VK_FORMAT_END_RANGE: VkFormat = - VkFormat::VK_FORMAT_ASTC_12x12_SRGB_BLOCK; +pub const VkFormat_VK_FORMAT_BEGIN_RANGE: VkFormat = VkFormat::VK_FORMAT_UNDEFINED; +pub const VkFormat_VK_FORMAT_END_RANGE: VkFormat = VkFormat::VK_FORMAT_ASTC_12x12_SRGB_BLOCK; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkFormat { @@ -1086,10 +1004,8 @@ pub enum VkFormat { VK_FORMAT_RANGE_SIZE = 185, VK_FORMAT_MAX_ENUM = 2147483647, } -pub const VkImageType_VK_IMAGE_TYPE_BEGIN_RANGE: VkImageType = - VkImageType::VK_IMAGE_TYPE_1D; -pub const VkImageType_VK_IMAGE_TYPE_END_RANGE: VkImageType = - VkImageType::VK_IMAGE_TYPE_3D; +pub const VkImageType_VK_IMAGE_TYPE_BEGIN_RANGE: VkImageType = VkImageType::VK_IMAGE_TYPE_1D; +pub const VkImageType_VK_IMAGE_TYPE_END_RANGE: VkImageType = VkImageType::VK_IMAGE_TYPE_3D; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkImageType { @@ -1111,11 +1027,9 @@ pub enum VkImageTiling { VK_IMAGE_TILING_RANGE_SIZE = 2, VK_IMAGE_TILING_MAX_ENUM = 2147483647, } -pub const VkPhysicalDeviceType_VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE: - VkPhysicalDeviceType = +pub const VkPhysicalDeviceType_VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE: VkPhysicalDeviceType = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_OTHER; -pub const VkPhysicalDeviceType_VK_PHYSICAL_DEVICE_TYPE_END_RANGE: - VkPhysicalDeviceType = +pub const VkPhysicalDeviceType_VK_PHYSICAL_DEVICE_TYPE_END_RANGE: VkPhysicalDeviceType = VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_CPU; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1128,10 +1042,8 @@ pub enum VkPhysicalDeviceType { VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = 5, VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 2147483647, } -pub const VkQueryType_VK_QUERY_TYPE_BEGIN_RANGE: VkQueryType = - VkQueryType::VK_QUERY_TYPE_OCCLUSION; -pub const VkQueryType_VK_QUERY_TYPE_END_RANGE: VkQueryType = - VkQueryType::VK_QUERY_TYPE_TIMESTAMP; +pub const VkQueryType_VK_QUERY_TYPE_BEGIN_RANGE: VkQueryType = VkQueryType::VK_QUERY_TYPE_OCCLUSION; +pub const VkQueryType_VK_QUERY_TYPE_END_RANGE: VkQueryType = VkQueryType::VK_QUERY_TYPE_TIMESTAMP; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkQueryType { @@ -1190,11 +1102,9 @@ pub enum VkImageViewType { VK_IMAGE_VIEW_TYPE_RANGE_SIZE = 7, VK_IMAGE_VIEW_TYPE_MAX_ENUM = 2147483647, } -pub const VkComponentSwizzle_VK_COMPONENT_SWIZZLE_BEGIN_RANGE: - VkComponentSwizzle = +pub const VkComponentSwizzle_VK_COMPONENT_SWIZZLE_BEGIN_RANGE: VkComponentSwizzle = VkComponentSwizzle::VK_COMPONENT_SWIZZLE_IDENTITY; -pub const VkComponentSwizzle_VK_COMPONENT_SWIZZLE_END_RANGE: - VkComponentSwizzle = +pub const VkComponentSwizzle_VK_COMPONENT_SWIZZLE_END_RANGE: VkComponentSwizzle = VkComponentSwizzle::VK_COMPONENT_SWIZZLE_A; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1209,11 +1119,9 @@ pub enum VkComponentSwizzle { VK_COMPONENT_SWIZZLE_RANGE_SIZE = 7, VK_COMPONENT_SWIZZLE_MAX_ENUM = 2147483647, } -pub const VkVertexInputRate_VK_VERTEX_INPUT_RATE_BEGIN_RANGE: - VkVertexInputRate = +pub const VkVertexInputRate_VK_VERTEX_INPUT_RATE_BEGIN_RANGE: VkVertexInputRate = VkVertexInputRate::VK_VERTEX_INPUT_RATE_VERTEX; -pub const VkVertexInputRate_VK_VERTEX_INPUT_RATE_END_RANGE: VkVertexInputRate - = +pub const VkVertexInputRate_VK_VERTEX_INPUT_RATE_END_RANGE: VkVertexInputRate = VkVertexInputRate::VK_VERTEX_INPUT_RATE_INSTANCE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1223,11 +1131,9 @@ pub enum VkVertexInputRate { VK_VERTEX_INPUT_RATE_RANGE_SIZE = 2, VK_VERTEX_INPUT_RATE_MAX_ENUM = 2147483647, } -pub const VkPrimitiveTopology_VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE: - VkPrimitiveTopology = +pub const VkPrimitiveTopology_VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE: VkPrimitiveTopology = VkPrimitiveTopology::VK_PRIMITIVE_TOPOLOGY_POINT_LIST; -pub const VkPrimitiveTopology_VK_PRIMITIVE_TOPOLOGY_END_RANGE: - VkPrimitiveTopology = +pub const VkPrimitiveTopology_VK_PRIMITIVE_TOPOLOGY_END_RANGE: VkPrimitiveTopology = VkPrimitiveTopology::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1261,8 +1167,7 @@ pub enum VkPolygonMode { } pub const VkFrontFace_VK_FRONT_FACE_BEGIN_RANGE: VkFrontFace = VkFrontFace::VK_FRONT_FACE_COUNTER_CLOCKWISE; -pub const VkFrontFace_VK_FRONT_FACE_END_RANGE: VkFrontFace = - VkFrontFace::VK_FRONT_FACE_CLOCKWISE; +pub const VkFrontFace_VK_FRONT_FACE_END_RANGE: VkFrontFace = VkFrontFace::VK_FRONT_FACE_CLOCKWISE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkFrontFace { @@ -1271,10 +1176,8 @@ pub enum VkFrontFace { VK_FRONT_FACE_RANGE_SIZE = 2, VK_FRONT_FACE_MAX_ENUM = 2147483647, } -pub const VkCompareOp_VK_COMPARE_OP_BEGIN_RANGE: VkCompareOp = - VkCompareOp::VK_COMPARE_OP_NEVER; -pub const VkCompareOp_VK_COMPARE_OP_END_RANGE: VkCompareOp = - VkCompareOp::VK_COMPARE_OP_ALWAYS; +pub const VkCompareOp_VK_COMPARE_OP_BEGIN_RANGE: VkCompareOp = VkCompareOp::VK_COMPARE_OP_NEVER; +pub const VkCompareOp_VK_COMPARE_OP_END_RANGE: VkCompareOp = VkCompareOp::VK_COMPARE_OP_ALWAYS; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkCompareOp { @@ -1289,8 +1192,7 @@ pub enum VkCompareOp { VK_COMPARE_OP_RANGE_SIZE = 8, VK_COMPARE_OP_MAX_ENUM = 2147483647, } -pub const VkStencilOp_VK_STENCIL_OP_BEGIN_RANGE: VkStencilOp = - VkStencilOp::VK_STENCIL_OP_KEEP; +pub const VkStencilOp_VK_STENCIL_OP_BEGIN_RANGE: VkStencilOp = VkStencilOp::VK_STENCIL_OP_KEEP; pub const VkStencilOp_VK_STENCIL_OP_END_RANGE: VkStencilOp = VkStencilOp::VK_STENCIL_OP_DECREMENT_AND_WRAP; #[repr(u32)] @@ -1307,10 +1209,8 @@ pub enum VkStencilOp { VK_STENCIL_OP_RANGE_SIZE = 8, VK_STENCIL_OP_MAX_ENUM = 2147483647, } -pub const VkLogicOp_VK_LOGIC_OP_BEGIN_RANGE: VkLogicOp = - VkLogicOp::VK_LOGIC_OP_CLEAR; -pub const VkLogicOp_VK_LOGIC_OP_END_RANGE: VkLogicOp = - VkLogicOp::VK_LOGIC_OP_SET; +pub const VkLogicOp_VK_LOGIC_OP_BEGIN_RANGE: VkLogicOp = VkLogicOp::VK_LOGIC_OP_CLEAR; +pub const VkLogicOp_VK_LOGIC_OP_END_RANGE: VkLogicOp = VkLogicOp::VK_LOGIC_OP_SET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkLogicOp { @@ -1362,10 +1262,8 @@ pub enum VkBlendFactor { VK_BLEND_FACTOR_RANGE_SIZE = 19, VK_BLEND_FACTOR_MAX_ENUM = 2147483647, } -pub const VkBlendOp_VK_BLEND_OP_BEGIN_RANGE: VkBlendOp = - VkBlendOp::VK_BLEND_OP_ADD; -pub const VkBlendOp_VK_BLEND_OP_END_RANGE: VkBlendOp = - VkBlendOp::VK_BLEND_OP_MAX; +pub const VkBlendOp_VK_BLEND_OP_BEGIN_RANGE: VkBlendOp = VkBlendOp::VK_BLEND_OP_ADD; +pub const VkBlendOp_VK_BLEND_OP_END_RANGE: VkBlendOp = VkBlendOp::VK_BLEND_OP_MAX; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkBlendOp { @@ -1398,8 +1296,7 @@ pub enum VkDynamicState { VK_DYNAMIC_STATE_RANGE_SIZE = 9, VK_DYNAMIC_STATE_MAX_ENUM = 2147483647, } -pub const VkFilter_VK_FILTER_BEGIN_RANGE: VkFilter = - VkFilter::VK_FILTER_NEAREST; +pub const VkFilter_VK_FILTER_BEGIN_RANGE: VkFilter = VkFilter::VK_FILTER_NEAREST; pub const VkFilter_VK_FILTER_END_RANGE: VkFilter = VkFilter::VK_FILTER_LINEAR; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1410,11 +1307,9 @@ pub enum VkFilter { VK_FILTER_RANGE_SIZE = 2, VK_FILTER_MAX_ENUM = 2147483647, } -pub const VkSamplerMipmapMode_VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE: - VkSamplerMipmapMode = +pub const VkSamplerMipmapMode_VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE: VkSamplerMipmapMode = VkSamplerMipmapMode::VK_SAMPLER_MIPMAP_MODE_NEAREST; -pub const VkSamplerMipmapMode_VK_SAMPLER_MIPMAP_MODE_END_RANGE: - VkSamplerMipmapMode = +pub const VkSamplerMipmapMode_VK_SAMPLER_MIPMAP_MODE_END_RANGE: VkSamplerMipmapMode = VkSamplerMipmapMode::VK_SAMPLER_MIPMAP_MODE_LINEAR; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1424,14 +1319,11 @@ pub enum VkSamplerMipmapMode { VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = 2, VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 2147483647, } -pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE: - VkSamplerAddressMode = +pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE: VkSamplerAddressMode = VkSamplerAddressMode::VK_SAMPLER_ADDRESS_MODE_REPEAT; -pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_END_RANGE: - VkSamplerAddressMode = +pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_END_RANGE: VkSamplerAddressMode = VkSamplerAddressMode::VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; -pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE: - VkSamplerAddressMode = +pub const VkSamplerAddressMode_VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE: VkSamplerAddressMode = VkSamplerAddressMode::VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1480,11 +1372,9 @@ pub enum VkDescriptorType { VK_DESCRIPTOR_TYPE_RANGE_SIZE = 11, VK_DESCRIPTOR_TYPE_MAX_ENUM = 2147483647, } -pub const VkAttachmentLoadOp_VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE: - VkAttachmentLoadOp = +pub const VkAttachmentLoadOp_VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE: VkAttachmentLoadOp = VkAttachmentLoadOp::VK_ATTACHMENT_LOAD_OP_LOAD; -pub const VkAttachmentLoadOp_VK_ATTACHMENT_LOAD_OP_END_RANGE: - VkAttachmentLoadOp = +pub const VkAttachmentLoadOp_VK_ATTACHMENT_LOAD_OP_END_RANGE: VkAttachmentLoadOp = VkAttachmentLoadOp::VK_ATTACHMENT_LOAD_OP_DONT_CARE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1495,11 +1385,9 @@ pub enum VkAttachmentLoadOp { VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = 3, VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 2147483647, } -pub const VkAttachmentStoreOp_VK_ATTACHMENT_STORE_OP_BEGIN_RANGE: - VkAttachmentStoreOp = +pub const VkAttachmentStoreOp_VK_ATTACHMENT_STORE_OP_BEGIN_RANGE: VkAttachmentStoreOp = VkAttachmentStoreOp::VK_ATTACHMENT_STORE_OP_STORE; -pub const VkAttachmentStoreOp_VK_ATTACHMENT_STORE_OP_END_RANGE: - VkAttachmentStoreOp = +pub const VkAttachmentStoreOp_VK_ATTACHMENT_STORE_OP_END_RANGE: VkAttachmentStoreOp = VkAttachmentStoreOp::VK_ATTACHMENT_STORE_OP_DONT_CARE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1509,11 +1397,9 @@ pub enum VkAttachmentStoreOp { VK_ATTACHMENT_STORE_OP_RANGE_SIZE = 2, VK_ATTACHMENT_STORE_OP_MAX_ENUM = 2147483647, } -pub const VkPipelineBindPoint_VK_PIPELINE_BIND_POINT_BEGIN_RANGE: - VkPipelineBindPoint = +pub const VkPipelineBindPoint_VK_PIPELINE_BIND_POINT_BEGIN_RANGE: VkPipelineBindPoint = VkPipelineBindPoint::VK_PIPELINE_BIND_POINT_GRAPHICS; -pub const VkPipelineBindPoint_VK_PIPELINE_BIND_POINT_END_RANGE: - VkPipelineBindPoint = +pub const VkPipelineBindPoint_VK_PIPELINE_BIND_POINT_END_RANGE: VkPipelineBindPoint = VkPipelineBindPoint::VK_PIPELINE_BIND_POINT_COMPUTE; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1523,11 +1409,9 @@ pub enum VkPipelineBindPoint { VK_PIPELINE_BIND_POINT_RANGE_SIZE = 2, VK_PIPELINE_BIND_POINT_MAX_ENUM = 2147483647, } -pub const VkCommandBufferLevel_VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE: - VkCommandBufferLevel = +pub const VkCommandBufferLevel_VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE: VkCommandBufferLevel = VkCommandBufferLevel::VK_COMMAND_BUFFER_LEVEL_PRIMARY; -pub const VkCommandBufferLevel_VK_COMMAND_BUFFER_LEVEL_END_RANGE: - VkCommandBufferLevel = +pub const VkCommandBufferLevel_VK_COMMAND_BUFFER_LEVEL_END_RANGE: VkCommandBufferLevel = VkCommandBufferLevel::VK_COMMAND_BUFFER_LEVEL_SECONDARY; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1537,10 +1421,8 @@ pub enum VkCommandBufferLevel { VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = 2, VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 2147483647, } -pub const VkIndexType_VK_INDEX_TYPE_BEGIN_RANGE: VkIndexType = - VkIndexType::VK_INDEX_TYPE_UINT16; -pub const VkIndexType_VK_INDEX_TYPE_END_RANGE: VkIndexType = - VkIndexType::VK_INDEX_TYPE_UINT32; +pub const VkIndexType_VK_INDEX_TYPE_BEGIN_RANGE: VkIndexType = VkIndexType::VK_INDEX_TYPE_UINT16; +pub const VkIndexType_VK_INDEX_TYPE_END_RANGE: VkIndexType = VkIndexType::VK_INDEX_TYPE_UINT32; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkIndexType { @@ -1549,8 +1431,7 @@ pub enum VkIndexType { VK_INDEX_TYPE_RANGE_SIZE = 2, VK_INDEX_TYPE_MAX_ENUM = 2147483647, } -pub const VkSubpassContents_VK_SUBPASS_CONTENTS_BEGIN_RANGE: VkSubpassContents - = +pub const VkSubpassContents_VK_SUBPASS_CONTENTS_BEGIN_RANGE: VkSubpassContents = VkSubpassContents::VK_SUBPASS_CONTENTS_INLINE; pub const VkSubpassContents_VK_SUBPASS_CONTENTS_END_RANGE: VkSubpassContents = VkSubpassContents::VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS; @@ -1729,8 +1610,7 @@ pub enum VkQueryPipelineStatisticFlagBits { VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 64, VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 128, VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 256, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT - = 512, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 512, VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 1024, VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 2147483647, } @@ -1785,8 +1665,7 @@ pub enum VkPipelineCreateFlagBits { } pub type VkPipelineCreateFlags = VkFlags; pub type VkPipelineShaderStageCreateFlags = VkFlags; -pub const VkShaderStageFlagBits_VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM: - VkShaderStageFlagBits = +pub const VkShaderStageFlagBits_VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM: VkShaderStageFlagBits = VkShaderStageFlagBits::VK_SHADER_STAGE_ALL; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1947,43 +1826,45 @@ pub enum VkStencilFaceFlagBits { pub type VkStencilFaceFlags = VkFlags; pub type VkMetalSurfaceCreateFlagsEXT = VkFlags; -pub type PFN_vkAllocationFunction = - ::std::option::Option *mut ::std::os::raw::c_void>; -pub type PFN_vkReallocationFunction = - ::std::option::Option *mut ::std::os::raw::c_void>; -pub type PFN_vkFreeFunction = - ::std::option::Option; -pub type PFN_vkInternalAllocationNotification = - ::std::option::Option; -pub type PFN_vkInternalFreeNotification = - ::std::option::Option; +pub type PFN_vkAllocationFunction = ::std::option::Option< + unsafe extern "C" fn( + pUserData: *mut ::std::os::raw::c_void, + size: usize, + alignment: usize, + allocationScope: VkSystemAllocationScope, + ) -> *mut ::std::os::raw::c_void, +>; +pub type PFN_vkReallocationFunction = ::std::option::Option< + unsafe extern "C" fn( + pUserData: *mut ::std::os::raw::c_void, + pOriginal: *mut ::std::os::raw::c_void, + size: usize, + alignment: usize, + allocationScope: VkSystemAllocationScope, + ) -> *mut ::std::os::raw::c_void, +>; +pub type PFN_vkFreeFunction = ::std::option::Option< + unsafe extern "C" fn( + pUserData: *mut ::std::os::raw::c_void, + pMemory: *mut ::std::os::raw::c_void, + ), +>; +pub type PFN_vkInternalAllocationNotification = ::std::option::Option< + unsafe extern "C" fn( + pUserData: *mut ::std::os::raw::c_void, + size: usize, + allocationType: VkInternalAllocationType, + allocationScope: VkSystemAllocationScope, + ), +>; +pub type PFN_vkInternalFreeNotification = ::std::option::Option< + unsafe extern "C" fn( + pUserData: *mut ::std::os::raw::c_void, + size: usize, + allocationType: VkInternalAllocationType, + allocationScope: VkSystemAllocationScope, + ), +>; pub type PFN_vkVoidFunction = ::std::option::Option; #[repr(C)] #[derive(Debug, Copy)] @@ -1997,7 +1878,9 @@ pub struct VkApplicationInfo { pub apiVersion: u32, } impl Clone for VkApplicationInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2012,7 +1895,9 @@ pub struct VkInstanceCreateInfo { pub ppEnabledExtensionNames: *const *const ::std::os::raw::c_char, } impl Clone for VkInstanceCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2025,7 +1910,9 @@ pub struct VkAllocationCallbacks { pub pfnInternalFree: PFN_vkInternalFreeNotification, } impl Clone for VkAllocationCallbacks { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2087,7 +1974,9 @@ pub struct VkPhysicalDeviceFeatures { pub inheritedQueries: VkBool32, } impl Clone for VkPhysicalDeviceFeatures { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2097,7 +1986,9 @@ pub struct VkFormatProperties { pub bufferFeatures: VkFormatFeatureFlags, } impl Clone for VkFormatProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2107,7 +1998,9 @@ pub struct VkExtent3D { pub depth: u32, } impl Clone for VkExtent3D { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2119,7 +2012,9 @@ pub struct VkImageFormatProperties { pub maxResourceSize: VkDeviceSize, } impl Clone for VkImageFormatProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2232,7 +2127,9 @@ pub struct VkPhysicalDeviceLimits { pub nonCoherentAtomSize: VkDeviceSize, } impl Clone for VkPhysicalDeviceLimits { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2244,7 +2141,9 @@ pub struct VkPhysicalDeviceSparseProperties { pub residencyNonResidentStrict: VkBool32, } impl Clone for VkPhysicalDeviceSparseProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -2260,7 +2159,9 @@ pub struct VkPhysicalDeviceProperties { pub sparseProperties: VkPhysicalDeviceSparseProperties, } impl Clone for VkPhysicalDeviceProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2271,7 +2172,9 @@ pub struct VkQueueFamilyProperties { pub minImageTransferGranularity: VkExtent3D, } impl Clone for VkQueueFamilyProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2280,7 +2183,9 @@ pub struct VkMemoryType { pub heapIndex: u32, } impl Clone for VkMemoryType { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2289,7 +2194,9 @@ pub struct VkMemoryHeap { pub flags: VkMemoryHeapFlags, } impl Clone for VkMemoryHeap { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2300,7 +2207,9 @@ pub struct VkPhysicalDeviceMemoryProperties { pub memoryHeaps: [VkMemoryHeap; 16usize], } impl Clone for VkPhysicalDeviceMemoryProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2313,7 +2222,9 @@ pub struct VkDeviceQueueCreateInfo { pub pQueuePriorities: *const f32, } impl Clone for VkDeviceQueueCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2330,7 +2241,9 @@ pub struct VkDeviceCreateInfo { pub pEnabledFeatures: *const VkPhysicalDeviceFeatures, } impl Clone for VkDeviceCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -2339,7 +2252,9 @@ pub struct VkExtensionProperties { pub specVersion: u32, } impl Clone for VkExtensionProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -2350,7 +2265,9 @@ pub struct VkLayerProperties { pub description: [::std::os::raw::c_char; 256usize], } impl Clone for VkLayerProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2366,7 +2283,9 @@ pub struct VkSubmitInfo { pub pSignalSemaphores: *const VkSemaphore, } impl Clone for VkSubmitInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2377,7 +2296,9 @@ pub struct VkMemoryAllocateInfo { pub memoryTypeIndex: u32, } impl Clone for VkMemoryAllocateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2389,7 +2310,9 @@ pub struct VkMappedMemoryRange { pub size: VkDeviceSize, } impl Clone for VkMappedMemoryRange { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2399,7 +2322,9 @@ pub struct VkMemoryRequirements { pub memoryTypeBits: u32, } impl Clone for VkMemoryRequirements { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2409,7 +2334,9 @@ pub struct VkSparseImageFormatProperties { pub flags: VkSparseImageFormatFlags, } impl Clone for VkSparseImageFormatProperties { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2421,7 +2348,9 @@ pub struct VkSparseImageMemoryRequirements { pub imageMipTailStride: VkDeviceSize, } impl Clone for VkSparseImageMemoryRequirements { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2433,7 +2362,9 @@ pub struct VkSparseMemoryBind { pub flags: VkSparseMemoryBindFlags, } impl Clone for VkSparseMemoryBind { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2443,7 +2374,9 @@ pub struct VkSparseBufferMemoryBindInfo { pub pBinds: *const VkSparseMemoryBind, } impl Clone for VkSparseBufferMemoryBindInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2453,7 +2386,9 @@ pub struct VkSparseImageOpaqueMemoryBindInfo { pub pBinds: *const VkSparseMemoryBind, } impl Clone for VkSparseImageOpaqueMemoryBindInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2463,7 +2398,9 @@ pub struct VkImageSubresource { pub arrayLayer: u32, } impl Clone for VkImageSubresource { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2473,7 +2410,9 @@ pub struct VkOffset3D { pub z: i32, } impl Clone for VkOffset3D { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2486,7 +2425,9 @@ pub struct VkSparseImageMemoryBind { pub flags: VkSparseMemoryBindFlags, } impl Clone for VkSparseImageMemoryBind { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2496,7 +2437,9 @@ pub struct VkSparseImageMemoryBindInfo { pub pBinds: *const VkSparseImageMemoryBind, } impl Clone for VkSparseImageMemoryBindInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2515,7 +2458,9 @@ pub struct VkBindSparseInfo { pub pSignalSemaphores: *const VkSemaphore, } impl Clone for VkBindSparseInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2525,7 +2470,9 @@ pub struct VkFenceCreateInfo { pub flags: VkFenceCreateFlags, } impl Clone for VkFenceCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2535,7 +2482,9 @@ pub struct VkSemaphoreCreateInfo { pub flags: VkSemaphoreCreateFlags, } impl Clone for VkSemaphoreCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2545,7 +2494,9 @@ pub struct VkEventCreateInfo { pub flags: VkEventCreateFlags, } impl Clone for VkEventCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2558,7 +2509,9 @@ pub struct VkQueryPoolCreateInfo { pub pipelineStatistics: VkQueryPipelineStatisticFlags, } impl Clone for VkQueryPoolCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2573,7 +2526,9 @@ pub struct VkBufferCreateInfo { pub pQueueFamilyIndices: *const u32, } impl Clone for VkBufferCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2587,7 +2542,9 @@ pub struct VkBufferViewCreateInfo { pub range: VkDeviceSize, } impl Clone for VkBufferViewCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2609,7 +2566,9 @@ pub struct VkImageCreateInfo { pub initialLayout: VkImageLayout, } impl Clone for VkImageCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2621,7 +2580,9 @@ pub struct VkSubresourceLayout { pub depthPitch: VkDeviceSize, } impl Clone for VkSubresourceLayout { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy, PartialEq)] @@ -2632,7 +2593,9 @@ pub struct VkComponentMapping { pub a: VkComponentSwizzle, } impl Clone for VkComponentMapping { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2644,7 +2607,9 @@ pub struct VkImageSubresourceRange { pub layerCount: u32, } impl Clone for VkImageSubresourceRange { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2659,7 +2624,9 @@ pub struct VkImageViewCreateInfo { pub subresourceRange: VkImageSubresourceRange, } impl Clone for VkImageViewCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2671,7 +2638,9 @@ pub struct VkShaderModuleCreateInfo { pub pCode: *const u32, } impl Clone for VkShaderModuleCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2683,7 +2652,9 @@ pub struct VkPipelineCacheCreateInfo { pub pInitialData: *const ::std::os::raw::c_void, } impl Clone for VkPipelineCacheCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2693,7 +2664,9 @@ pub struct VkSpecializationMapEntry { pub size: usize, } impl Clone for VkSpecializationMapEntry { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2704,7 +2677,9 @@ pub struct VkSpecializationInfo { pub pData: *const ::std::os::raw::c_void, } impl Clone for VkSpecializationInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2718,7 +2693,9 @@ pub struct VkPipelineShaderStageCreateInfo { pub pSpecializationInfo: *const VkSpecializationInfo, } impl Clone for VkPipelineShaderStageCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2728,7 +2705,9 @@ pub struct VkVertexInputBindingDescription { pub inputRate: VkVertexInputRate, } impl Clone for VkVertexInputBindingDescription { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2739,7 +2718,9 @@ pub struct VkVertexInputAttributeDescription { pub offset: u32, } impl Clone for VkVertexInputAttributeDescription { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2753,7 +2734,9 @@ pub struct VkPipelineVertexInputStateCreateInfo { pub pVertexAttributeDescriptions: *const VkVertexInputAttributeDescription, } impl Clone for VkPipelineVertexInputStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2765,7 +2748,9 @@ pub struct VkPipelineInputAssemblyStateCreateInfo { pub primitiveRestartEnable: VkBool32, } impl Clone for VkPipelineInputAssemblyStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2776,7 +2761,9 @@ pub struct VkPipelineTessellationStateCreateInfo { pub patchControlPoints: u32, } impl Clone for VkPipelineTessellationStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2789,7 +2776,9 @@ pub struct VkViewport { pub maxDepth: f32, } impl Clone for VkViewport { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2798,7 +2787,9 @@ pub struct VkOffset2D { pub y: i32, } impl Clone for VkOffset2D { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2807,7 +2798,9 @@ pub struct VkExtent2D { pub height: u32, } impl Clone for VkExtent2D { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2816,7 +2809,9 @@ pub struct VkRect2D { pub extent: VkExtent2D, } impl Clone for VkRect2D { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2830,7 +2825,9 @@ pub struct VkPipelineViewportStateCreateInfo { pub pScissors: *const VkRect2D, } impl Clone for VkPipelineViewportStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2850,7 +2847,9 @@ pub struct VkPipelineRasterizationStateCreateInfo { pub lineWidth: f32, } impl Clone for VkPipelineRasterizationStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2866,7 +2865,9 @@ pub struct VkPipelineMultisampleStateCreateInfo { pub alphaToOneEnable: VkBool32, } impl Clone for VkPipelineMultisampleStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2880,7 +2881,9 @@ pub struct VkStencilOpState { pub reference: u32, } impl Clone for VkStencilOpState { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2899,7 +2902,9 @@ pub struct VkPipelineDepthStencilStateCreateInfo { pub maxDepthBounds: f32, } impl Clone for VkPipelineDepthStencilStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2914,7 +2919,9 @@ pub struct VkPipelineColorBlendAttachmentState { pub colorWriteMask: VkColorComponentFlags, } impl Clone for VkPipelineColorBlendAttachmentState { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2929,7 +2936,9 @@ pub struct VkPipelineColorBlendStateCreateInfo { pub blendConstants: [f32; 4usize], } impl Clone for VkPipelineColorBlendStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2941,7 +2950,9 @@ pub struct VkPipelineDynamicStateCreateInfo { pub pDynamicStates: *const VkDynamicState, } impl Clone for VkPipelineDynamicStateCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2967,7 +2978,9 @@ pub struct VkGraphicsPipelineCreateInfo { pub basePipelineIndex: i32, } impl Clone for VkGraphicsPipelineCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2981,7 +2994,9 @@ pub struct VkComputePipelineCreateInfo { pub basePipelineIndex: i32, } impl Clone for VkComputePipelineCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -2991,7 +3006,9 @@ pub struct VkPushConstantRange { pub size: u32, } impl Clone for VkPushConstantRange { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3005,7 +3022,9 @@ pub struct VkPipelineLayoutCreateInfo { pub pPushConstantRanges: *const VkPushConstantRange, } impl Clone for VkPipelineLayoutCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3030,7 +3049,9 @@ pub struct VkSamplerCreateInfo { pub unnormalizedCoordinates: VkBool32, } impl Clone for VkSamplerCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3042,7 +3063,9 @@ pub struct VkDescriptorSetLayoutBinding { pub pImmutableSamplers: *const VkSampler, } impl Clone for VkDescriptorSetLayoutBinding { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3054,7 +3077,9 @@ pub struct VkDescriptorSetLayoutCreateInfo { pub pBindings: *const VkDescriptorSetLayoutBinding, } impl Clone for VkDescriptorSetLayoutCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3063,7 +3088,9 @@ pub struct VkDescriptorPoolSize { pub descriptorCount: u32, } impl Clone for VkDescriptorPoolSize { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3076,7 +3103,9 @@ pub struct VkDescriptorPoolCreateInfo { pub pPoolSizes: *const VkDescriptorPoolSize, } impl Clone for VkDescriptorPoolCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3088,7 +3117,9 @@ pub struct VkDescriptorSetAllocateInfo { pub pSetLayouts: *const VkDescriptorSetLayout, } impl Clone for VkDescriptorSetAllocateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3098,7 +3129,9 @@ pub struct VkDescriptorImageInfo { pub imageLayout: VkImageLayout, } impl Clone for VkDescriptorImageInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3108,7 +3141,9 @@ pub struct VkDescriptorBufferInfo { pub range: VkDeviceSize, } impl Clone for VkDescriptorBufferInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3125,7 +3160,9 @@ pub struct VkWriteDescriptorSet { pub pTexelBufferView: *const VkBufferView, } impl Clone for VkWriteDescriptorSet { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3141,7 +3178,9 @@ pub struct VkCopyDescriptorSet { pub descriptorCount: u32, } impl Clone for VkCopyDescriptorSet { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3157,7 +3196,9 @@ pub struct VkFramebufferCreateInfo { pub layers: u32, } impl Clone for VkFramebufferCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3173,7 +3214,9 @@ pub struct VkAttachmentDescription { pub finalLayout: VkImageLayout, } impl Clone for VkAttachmentDescription { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3182,7 +3225,9 @@ pub struct VkAttachmentReference { pub layout: VkImageLayout, } impl Clone for VkAttachmentReference { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3199,7 +3244,9 @@ pub struct VkSubpassDescription { pub pPreserveAttachments: *const u32, } impl Clone for VkSubpassDescription { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3213,7 +3260,9 @@ pub struct VkSubpassDependency { pub dependencyFlags: VkDependencyFlags, } impl Clone for VkSubpassDependency { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3229,7 +3278,9 @@ pub struct VkRenderPassCreateInfo { pub pDependencies: *const VkSubpassDependency, } impl Clone for VkRenderPassCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3240,7 +3291,9 @@ pub struct VkCommandPoolCreateInfo { pub queueFamilyIndex: u32, } impl Clone for VkCommandPoolCreateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3252,7 +3305,9 @@ pub struct VkCommandBufferAllocateInfo { pub commandBufferCount: u32, } impl Clone for VkCommandBufferAllocateInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3267,7 +3322,9 @@ pub struct VkCommandBufferInheritanceInfo { pub pipelineStatistics: VkQueryPipelineStatisticFlags, } impl Clone for VkCommandBufferInheritanceInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3278,7 +3335,9 @@ pub struct VkCommandBufferBeginInfo { pub pInheritanceInfo: *const VkCommandBufferInheritanceInfo, } impl Clone for VkCommandBufferBeginInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3288,7 +3347,9 @@ pub struct VkBufferCopy { pub size: VkDeviceSize, } impl Clone for VkBufferCopy { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3299,7 +3360,9 @@ pub struct VkImageSubresourceLayers { pub layerCount: u32, } impl Clone for VkImageSubresourceLayers { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3311,7 +3374,9 @@ pub struct VkImageCopy { pub extent: VkExtent3D, } impl Clone for VkImageCopy { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3322,7 +3387,9 @@ pub struct VkImageBlit { pub dstOffsets: [VkOffset3D; 2usize], } impl Clone for VkImageBlit { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3335,7 +3402,9 @@ pub struct VkBufferImageCopy { pub imageExtent: VkExtent3D, } impl Clone for VkBufferImageCopy { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -3346,7 +3415,9 @@ pub union VkClearColorValue { _bindgen_union_align: [u32; 4usize], } impl Clone for VkClearColorValue { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3355,7 +3426,9 @@ pub struct VkClearDepthStencilValue { pub stencil: u32, } impl Clone for VkClearDepthStencilValue { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -3365,7 +3438,9 @@ pub union VkClearValue { _bindgen_union_align: [u32; 4usize], } impl Clone for VkClearValue { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -3375,7 +3450,9 @@ pub struct VkClearAttachment { pub clearValue: VkClearValue, } impl Clone for VkClearAttachment { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3385,7 +3462,9 @@ pub struct VkClearRect { pub layerCount: u32, } impl Clone for VkClearRect { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3397,7 +3476,9 @@ pub struct VkImageResolve { pub extent: VkExtent3D, } impl Clone for VkImageResolve { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3408,7 +3489,9 @@ pub struct VkMemoryBarrier { pub dstAccessMask: VkAccessFlags, } impl Clone for VkMemoryBarrier { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3424,7 +3507,9 @@ pub struct VkBufferMemoryBarrier { pub size: VkDeviceSize, } impl Clone for VkBufferMemoryBarrier { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3441,7 +3526,9 @@ pub struct VkImageMemoryBarrier { pub subresourceRange: VkImageSubresourceRange, } impl Clone for VkImageMemoryBarrier { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3455,7 +3542,9 @@ pub struct VkRenderPassBeginInfo { pub pClearValues: *const VkClearValue, } impl Clone for VkRenderPassBeginInfo { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3465,7 +3554,9 @@ pub struct VkDispatchIndirectCommand { pub z: u32, } impl Clone for VkDispatchIndirectCommand { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3477,7 +3568,9 @@ pub struct VkDrawIndexedIndirectCommand { pub firstInstance: u32, } impl Clone for VkDrawIndexedIndirectCommand { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -3488,858 +3581,993 @@ pub struct VkDrawIndirectCommand { pub firstInstance: u32, } impl Clone for VkDrawIndirectCommand { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceFeatures = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceFormatProperties = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceImageFormatProperties = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceProperties = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceQueueFamilyProperties = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceMemoryProperties = - ::std::option::Option; -pub type PFN_vkGetInstanceProcAddr = - ::std::option::Option PFN_vkVoidFunction>; -pub type PFN_vkGetDeviceProcAddr = - ::std::option::Option PFN_vkVoidFunction>; -pub type PFN_vkCreateDevice = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyDevice = - ::std::option::Option; -pub type PFN_vkEnumerateInstanceExtensionProperties = - ::std::option::Option VkResult>; -pub type PFN_vkEnumerateDeviceExtensionProperties = - ::std::option::Option VkResult>; -pub type PFN_vkEnumerateInstanceLayerProperties = - ::std::option::Option VkResult>; -pub type PFN_vkEnumerateDeviceLayerProperties = - ::std::option::Option VkResult>; -pub type PFN_vkGetDeviceQueue = - ::std::option::Option; -pub type PFN_vkQueueSubmit = - ::std::option::Option VkResult>; +pub type PFN_vkGetPhysicalDeviceFeatures = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkPhysicalDeviceFeatures, + ), +>; +pub type PFN_vkGetPhysicalDeviceFormatProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + pFormatProperties: *mut VkFormatProperties, + ), +>; +pub type PFN_vkGetPhysicalDeviceImageFormatProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + tiling: VkImageTiling, + usage: VkImageUsageFlags, + flags: VkImageCreateFlags, + pImageFormatProperties: *mut VkImageFormatProperties, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties, + ), +>; +pub type PFN_vkGetPhysicalDeviceQueueFamilyProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pQueueFamilyPropertyCount: *mut u32, + pQueueFamilyProperties: *mut VkQueueFamilyProperties, + ), +>; +pub type PFN_vkGetPhysicalDeviceMemoryProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties, + ), +>; +pub type PFN_vkGetInstanceProcAddr = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pName: *const ::std::os::raw::c_char, + ) -> PFN_vkVoidFunction, +>; +pub type PFN_vkGetDeviceProcAddr = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pName: *const ::std::os::raw::c_char, + ) -> PFN_vkVoidFunction, +>; +pub type PFN_vkCreateDevice = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pCreateInfo: *const VkDeviceCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pDevice: *mut VkDevice, + ) -> VkResult, +>; +pub type PFN_vkDestroyDevice = ::std::option::Option< + unsafe extern "C" fn(device: VkDevice, pAllocator: *const VkAllocationCallbacks), +>; +pub type PFN_vkEnumerateInstanceExtensionProperties = ::std::option::Option< + unsafe extern "C" fn( + pLayerName: *const ::std::os::raw::c_char, + pPropertyCount: *mut u32, + pProperties: *mut VkExtensionProperties, + ) -> VkResult, +>; +pub type PFN_vkEnumerateDeviceExtensionProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pLayerName: *const ::std::os::raw::c_char, + pPropertyCount: *mut u32, + pProperties: *mut VkExtensionProperties, + ) -> VkResult, +>; +pub type PFN_vkEnumerateInstanceLayerProperties = ::std::option::Option< + unsafe extern "C" fn(pPropertyCount: *mut u32, pProperties: *mut VkLayerProperties) -> VkResult, +>; +pub type PFN_vkEnumerateDeviceLayerProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkLayerProperties, + ) -> VkResult, +>; +pub type PFN_vkGetDeviceQueue = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + queueFamilyIndex: u32, + queueIndex: u32, + pQueue: *mut VkQueue, + ), +>; +pub type PFN_vkQueueSubmit = ::std::option::Option< + unsafe extern "C" fn( + queue: VkQueue, + submitCount: u32, + pSubmits: *const VkSubmitInfo, + fence: VkFence, + ) -> VkResult, +>; pub type PFN_vkQueueWaitIdle = ::std::option::Option VkResult>; pub type PFN_vkDeviceWaitIdle = ::std::option::Option VkResult>; -pub type PFN_vkAllocateMemory = - ::std::option::Option VkResult>; -pub type PFN_vkFreeMemory = - ::std::option::Option; -pub type PFN_vkMapMemory = - ::std::option::Option VkResult>; +pub type PFN_vkAllocateMemory = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pAllocateInfo: *const VkMemoryAllocateInfo, + pAllocator: *const VkAllocationCallbacks, + pMemory: *mut VkDeviceMemory, + ) -> VkResult, +>; +pub type PFN_vkFreeMemory = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memory: VkDeviceMemory, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkMapMemory = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memory: VkDeviceMemory, + offset: VkDeviceSize, + size: VkDeviceSize, + flags: VkMemoryMapFlags, + ppData: *mut *mut ::std::os::raw::c_void, + ) -> VkResult, +>; pub type PFN_vkUnmapMemory = - ::std::option::Option; -pub type PFN_vkFlushMappedMemoryRanges = - ::std::option::Option VkResult>; -pub type PFN_vkInvalidateMappedMemoryRanges = - ::std::option::Option VkResult>; -pub type PFN_vkGetDeviceMemoryCommitment = - ::std::option::Option; -pub type PFN_vkBindBufferMemory = - ::std::option::Option VkResult>; -pub type PFN_vkBindImageMemory = - ::std::option::Option VkResult>; -pub type PFN_vkGetBufferMemoryRequirements = - ::std::option::Option; -pub type PFN_vkGetImageMemoryRequirements = - ::std::option::Option; -pub type PFN_vkGetImageSparseMemoryRequirements = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceSparseImageFormatProperties = - ::std::option::Option; -pub type PFN_vkQueueBindSparse = - ::std::option::Option VkResult>; -pub type PFN_vkCreateFence = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyFence = - ::std::option::Option; -pub type PFN_vkResetFences = - ::std::option::Option VkResult>; + ::std::option::Option; +pub type PFN_vkFlushMappedMemoryRanges = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, + ) -> VkResult, +>; +pub type PFN_vkInvalidateMappedMemoryRanges = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, + ) -> VkResult, +>; +pub type PFN_vkGetDeviceMemoryCommitment = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memory: VkDeviceMemory, + pCommittedMemoryInBytes: *mut VkDeviceSize, + ), +>; +pub type PFN_vkBindBufferMemory = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + buffer: VkBuffer, + memory: VkDeviceMemory, + memoryOffset: VkDeviceSize, + ) -> VkResult, +>; +pub type PFN_vkBindImageMemory = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + image: VkImage, + memory: VkDeviceMemory, + memoryOffset: VkDeviceSize, + ) -> VkResult, +>; +pub type PFN_vkGetBufferMemoryRequirements = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + buffer: VkBuffer, + pMemoryRequirements: *mut VkMemoryRequirements, + ), +>; +pub type PFN_vkGetImageMemoryRequirements = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + image: VkImage, + pMemoryRequirements: *mut VkMemoryRequirements, + ), +>; +pub type PFN_vkGetImageSparseMemoryRequirements = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + image: VkImage, + pSparseMemoryRequirementCount: *mut u32, + pSparseMemoryRequirements: *mut VkSparseImageMemoryRequirements, + ), +>; +pub type PFN_vkGetPhysicalDeviceSparseImageFormatProperties = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + samples: VkSampleCountFlagBits, + usage: VkImageUsageFlags, + tiling: VkImageTiling, + pPropertyCount: *mut u32, + pProperties: *mut VkSparseImageFormatProperties, + ), +>; +pub type PFN_vkQueueBindSparse = ::std::option::Option< + unsafe extern "C" fn( + queue: VkQueue, + bindInfoCount: u32, + pBindInfo: *const VkBindSparseInfo, + fence: VkFence, + ) -> VkResult, +>; +pub type PFN_vkCreateFence = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkFenceCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, + ) -> VkResult, +>; +pub type PFN_vkDestroyFence = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + fence: VkFence, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkResetFences = ::std::option::Option< + unsafe extern "C" fn(device: VkDevice, fenceCount: u32, pFences: *const VkFence) -> VkResult, +>; pub type PFN_vkGetFenceStatus = - ::std::option::Option VkResult>; -pub type PFN_vkWaitForFences = - ::std::option::Option VkResult>; -pub type PFN_vkCreateSemaphore = - ::std::option::Option VkResult>; -pub type PFN_vkDestroySemaphore = - ::std::option::Option; -pub type PFN_vkCreateEvent = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyEvent = - ::std::option::Option; + ::std::option::Option VkResult>; +pub type PFN_vkWaitForFences = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + fenceCount: u32, + pFences: *const VkFence, + waitAll: VkBool32, + timeout: u64, + ) -> VkResult, +>; +pub type PFN_vkCreateSemaphore = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkSemaphoreCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSemaphore: *mut VkSemaphore, + ) -> VkResult, +>; +pub type PFN_vkDestroySemaphore = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + semaphore: VkSemaphore, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateEvent = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkEventCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pEvent: *mut VkEvent, + ) -> VkResult, +>; +pub type PFN_vkDestroyEvent = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + event: VkEvent, + pAllocator: *const VkAllocationCallbacks, + ), +>; pub type PFN_vkGetEventStatus = - ::std::option::Option VkResult>; + ::std::option::Option VkResult>; pub type PFN_vkSetEvent = - ::std::option::Option VkResult>; + ::std::option::Option VkResult>; pub type PFN_vkResetEvent = - ::std::option::Option VkResult>; -pub type PFN_vkCreateQueryPool = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyQueryPool = - ::std::option::Option; -pub type PFN_vkGetQueryPoolResults = - ::std::option::Option VkResult>; -pub type PFN_vkCreateBuffer = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyBuffer = - ::std::option::Option; -pub type PFN_vkCreateBufferView = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyBufferView = - ::std::option::Option; -pub type PFN_vkCreateImage = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyImage = - ::std::option::Option; -pub type PFN_vkGetImageSubresourceLayout = - ::std::option::Option; -pub type PFN_vkCreateImageView = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyImageView = - ::std::option::Option; -pub type PFN_vkCreateShaderModule = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyShaderModule = - ::std::option::Option; -pub type PFN_vkCreatePipelineCache = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyPipelineCache = - ::std::option::Option; -pub type PFN_vkGetPipelineCacheData = - ::std::option::Option VkResult>; -pub type PFN_vkMergePipelineCaches = - ::std::option::Option VkResult>; -pub type PFN_vkCreateGraphicsPipelines = - ::std::option::Option VkResult>; -pub type PFN_vkCreateComputePipelines = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyPipeline = - ::std::option::Option; -pub type PFN_vkCreatePipelineLayout = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyPipelineLayout = - ::std::option::Option; -pub type PFN_vkCreateSampler = - ::std::option::Option VkResult>; -pub type PFN_vkDestroySampler = - ::std::option::Option; -pub type PFN_vkCreateDescriptorSetLayout = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyDescriptorSetLayout = - ::std::option::Option; -pub type PFN_vkCreateDescriptorPool = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyDescriptorPool = - ::std::option::Option; -pub type PFN_vkResetDescriptorPool = - ::std::option::Option VkResult>; -pub type PFN_vkAllocateDescriptorSets = - ::std::option::Option VkResult>; -pub type PFN_vkFreeDescriptorSets = - ::std::option::Option VkResult>; -pub type PFN_vkUpdateDescriptorSets = - ::std::option::Option; -pub type PFN_vkCreateFramebuffer = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyFramebuffer = - ::std::option::Option; -pub type PFN_vkCreateRenderPass = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyRenderPass = - ::std::option::Option; -pub type PFN_vkGetRenderAreaGranularity = - ::std::option::Option; -pub type PFN_vkCreateCommandPool = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyCommandPool = - ::std::option::Option; -pub type PFN_vkResetCommandPool = - ::std::option::Option VkResult>; -pub type PFN_vkAllocateCommandBuffers = - ::std::option::Option VkResult>; -pub type PFN_vkFreeCommandBuffers = - ::std::option::Option; -pub type PFN_vkBeginCommandBuffer = - ::std::option::Option VkResult>; + ::std::option::Option VkResult>; +pub type PFN_vkCreateQueryPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkQueryPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pQueryPool: *mut VkQueryPool, + ) -> VkResult, +>; +pub type PFN_vkDestroyQueryPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + queryPool: VkQueryPool, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetQueryPoolResults = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dataSize: usize, + pData: *mut ::std::os::raw::c_void, + stride: VkDeviceSize, + flags: VkQueryResultFlags, + ) -> VkResult, +>; +pub type PFN_vkCreateBuffer = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkBufferCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pBuffer: *mut VkBuffer, + ) -> VkResult, +>; +pub type PFN_vkDestroyBuffer = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + buffer: VkBuffer, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateBufferView = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkBufferViewCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pView: *mut VkBufferView, + ) -> VkResult, +>; +pub type PFN_vkDestroyBufferView = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + bufferView: VkBufferView, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateImage = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkImageCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pImage: *mut VkImage, + ) -> VkResult, +>; +pub type PFN_vkDestroyImage = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + image: VkImage, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetImageSubresourceLayout = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + image: VkImage, + pSubresource: *const VkImageSubresource, + pLayout: *mut VkSubresourceLayout, + ), +>; +pub type PFN_vkCreateImageView = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkImageViewCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pView: *mut VkImageView, + ) -> VkResult, +>; +pub type PFN_vkDestroyImageView = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + imageView: VkImageView, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateShaderModule = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkShaderModuleCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pShaderModule: *mut VkShaderModule, + ) -> VkResult, +>; +pub type PFN_vkDestroyShaderModule = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + shaderModule: VkShaderModule, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreatePipelineCache = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkPipelineCacheCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineCache: *mut VkPipelineCache, + ) -> VkResult, +>; +pub type PFN_vkDestroyPipelineCache = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipelineCache: VkPipelineCache, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetPipelineCacheData = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipelineCache: VkPipelineCache, + pDataSize: *mut usize, + pData: *mut ::std::os::raw::c_void, + ) -> VkResult, +>; +pub type PFN_vkMergePipelineCaches = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + dstCache: VkPipelineCache, + srcCacheCount: u32, + pSrcCaches: *const VkPipelineCache, + ) -> VkResult, +>; +pub type PFN_vkCreateGraphicsPipelines = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkGraphicsPipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, + ) -> VkResult, +>; +pub type PFN_vkCreateComputePipelines = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkComputePipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, + ) -> VkResult, +>; +pub type PFN_vkDestroyPipeline = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipeline: VkPipeline, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreatePipelineLayout = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkPipelineLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineLayout: *mut VkPipelineLayout, + ) -> VkResult, +>; +pub type PFN_vkDestroyPipelineLayout = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pipelineLayout: VkPipelineLayout, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateSampler = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkSamplerCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSampler: *mut VkSampler, + ) -> VkResult, +>; +pub type PFN_vkDestroySampler = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + sampler: VkSampler, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateDescriptorSetLayout = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkDescriptorSetLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSetLayout: *mut VkDescriptorSetLayout, + ) -> VkResult, +>; +pub type PFN_vkDestroyDescriptorSetLayout = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorSetLayout: VkDescriptorSetLayout, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateDescriptorPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkDescriptorPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pDescriptorPool: *mut VkDescriptorPool, + ) -> VkResult, +>; +pub type PFN_vkDestroyDescriptorPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorPool: VkDescriptorPool, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkResetDescriptorPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorPool: VkDescriptorPool, + flags: VkDescriptorPoolResetFlags, + ) -> VkResult, +>; +pub type PFN_vkAllocateDescriptorSets = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pAllocateInfo: *const VkDescriptorSetAllocateInfo, + pDescriptorSets: *mut VkDescriptorSet, + ) -> VkResult, +>; +pub type PFN_vkFreeDescriptorSets = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorPool: VkDescriptorPool, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, + ) -> VkResult, +>; +pub type PFN_vkUpdateDescriptorSets = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorWriteCount: u32, + pDescriptorWrites: *const VkWriteDescriptorSet, + descriptorCopyCount: u32, + pDescriptorCopies: *const VkCopyDescriptorSet, + ), +>; +pub type PFN_vkCreateFramebuffer = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkFramebufferCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFramebuffer: *mut VkFramebuffer, + ) -> VkResult, +>; +pub type PFN_vkDestroyFramebuffer = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + framebuffer: VkFramebuffer, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateRenderPass = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkRenderPassCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pRenderPass: *mut VkRenderPass, + ) -> VkResult, +>; +pub type PFN_vkDestroyRenderPass = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + renderPass: VkRenderPass, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetRenderAreaGranularity = ::std::option::Option< + unsafe extern "C" fn(device: VkDevice, renderPass: VkRenderPass, pGranularity: *mut VkExtent2D), +>; +pub type PFN_vkCreateCommandPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkCommandPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pCommandPool: *mut VkCommandPool, + ) -> VkResult, +>; +pub type PFN_vkDestroyCommandPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + commandPool: VkCommandPool, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkResetCommandPool = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + commandPool: VkCommandPool, + flags: VkCommandPoolResetFlags, + ) -> VkResult, +>; +pub type PFN_vkAllocateCommandBuffers = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pAllocateInfo: *const VkCommandBufferAllocateInfo, + pCommandBuffers: *mut VkCommandBuffer, + ) -> VkResult, +>; +pub type PFN_vkFreeCommandBuffers = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + commandPool: VkCommandPool, + commandBufferCount: u32, + pCommandBuffers: *const VkCommandBuffer, + ), +>; +pub type PFN_vkBeginCommandBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pBeginInfo: *const VkCommandBufferBeginInfo, + ) -> VkResult, +>; pub type PFN_vkEndCommandBuffer = - ::std::option::Option VkResult>; -pub type PFN_vkResetCommandBuffer = - ::std::option::Option VkResult>; -pub type PFN_vkCmdBindPipeline = - ::std::option::Option; -pub type PFN_vkCmdSetViewport = - ::std::option::Option; -pub type PFN_vkCmdSetScissor = - ::std::option::Option; + ::std::option::Option VkResult>; +pub type PFN_vkResetCommandBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + flags: VkCommandBufferResetFlags, + ) -> VkResult, +>; +pub type PFN_vkCmdBindPipeline = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + pipeline: VkPipeline, + ), +>; +pub type PFN_vkCmdSetViewport = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + firstViewport: u32, + viewportCount: u32, + pViewports: *const VkViewport, + ), +>; +pub type PFN_vkCmdSetScissor = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + firstScissor: u32, + scissorCount: u32, + pScissors: *const VkRect2D, + ), +>; pub type PFN_vkCmdSetLineWidth = - ::std::option::Option; -pub type PFN_vkCmdSetDepthBias = - ::std::option::Option; -pub type PFN_vkCmdSetBlendConstants = - ::std::option::Option; -pub type PFN_vkCmdSetDepthBounds = - ::std::option::Option; -pub type PFN_vkCmdSetStencilCompareMask = - ::std::option::Option; -pub type PFN_vkCmdSetStencilWriteMask = - ::std::option::Option; -pub type PFN_vkCmdSetStencilReference = - ::std::option::Option; -pub type PFN_vkCmdBindDescriptorSets = - ::std::option::Option; -pub type PFN_vkCmdBindIndexBuffer = - ::std::option::Option; -pub type PFN_vkCmdBindVertexBuffers = - ::std::option::Option; -pub type PFN_vkCmdDraw = - ::std::option::Option; -pub type PFN_vkCmdDrawIndexed = - ::std::option::Option; -pub type PFN_vkCmdDrawIndirect = - ::std::option::Option; -pub type PFN_vkCmdDrawIndexedIndirect = - ::std::option::Option; -pub type PFN_vkCmdDispatch = - ::std::option::Option; -pub type PFN_vkCmdDispatchIndirect = - ::std::option::Option; -pub type PFN_vkCmdCopyBuffer = - ::std::option::Option; -pub type PFN_vkCmdCopyImage = - ::std::option::Option; -pub type PFN_vkCmdBlitImage = - ::std::option::Option; -pub type PFN_vkCmdCopyBufferToImage = - ::std::option::Option; -pub type PFN_vkCmdCopyImageToBuffer = - ::std::option::Option; -pub type PFN_vkCmdUpdateBuffer = - ::std::option::Option; -pub type PFN_vkCmdFillBuffer = - ::std::option::Option; -pub type PFN_vkCmdClearColorImage = - ::std::option::Option; -pub type PFN_vkCmdClearDepthStencilImage = - ::std::option::Option; -pub type PFN_vkCmdClearAttachments = - ::std::option::Option; -pub type PFN_vkCmdResolveImage = - ::std::option::Option; -pub type PFN_vkCmdSetEvent = - ::std::option::Option; -pub type PFN_vkCmdResetEvent = - ::std::option::Option; -pub type PFN_vkCmdWaitEvents = - ::std::option::Option; -pub type PFN_vkCmdPipelineBarrier = - ::std::option::Option; -pub type PFN_vkCmdBeginQuery = - ::std::option::Option; -pub type PFN_vkCmdEndQuery = - ::std::option::Option; -pub type PFN_vkCmdResetQueryPool = - ::std::option::Option; -pub type PFN_vkCmdWriteTimestamp = - ::std::option::Option; -pub type PFN_vkCmdCopyQueryPoolResults = - ::std::option::Option; -pub type PFN_vkCmdPushConstants = - ::std::option::Option; -pub type PFN_vkCmdBeginRenderPass = - ::std::option::Option; -pub type PFN_vkCmdNextSubpass = - ::std::option::Option; + ::std::option::Option; +pub type PFN_vkCmdSetDepthBias = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + depthBiasConstantFactor: f32, + depthBiasClamp: f32, + depthBiasSlopeFactor: f32, + ), +>; +pub type PFN_vkCmdSetBlendConstants = ::std::option::Option< + unsafe extern "C" fn(commandBuffer: VkCommandBuffer, blendConstants: *const f32), +>; +pub type PFN_vkCmdSetDepthBounds = ::std::option::Option< + unsafe extern "C" fn(commandBuffer: VkCommandBuffer, minDepthBounds: f32, maxDepthBounds: f32), +>; +pub type PFN_vkCmdSetStencilCompareMask = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + compareMask: u32, + ), +>; +pub type PFN_vkCmdSetStencilWriteMask = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + writeMask: u32, + ), +>; +pub type PFN_vkCmdSetStencilReference = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + reference: u32, + ), +>; +pub type PFN_vkCmdBindDescriptorSets = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + layout: VkPipelineLayout, + firstSet: u32, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, + dynamicOffsetCount: u32, + pDynamicOffsets: *const u32, + ), +>; +pub type PFN_vkCmdBindIndexBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + indexType: VkIndexType, + ), +>; +pub type PFN_vkCmdBindVertexBuffers = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + firstBinding: u32, + bindingCount: u32, + pBuffers: *const VkBuffer, + pOffsets: *const VkDeviceSize, + ), +>; +pub type PFN_vkCmdDraw = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + vertexCount: u32, + instanceCount: u32, + firstVertex: u32, + firstInstance: u32, + ), +>; +pub type PFN_vkCmdDrawIndexed = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + indexCount: u32, + instanceCount: u32, + firstIndex: u32, + vertexOffset: i32, + firstInstance: u32, + ), +>; +pub type PFN_vkCmdDrawIndirect = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, + ), +>; +pub type PFN_vkCmdDrawIndexedIndirect = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, + ), +>; +pub type PFN_vkCmdDispatch = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + groupCountX: u32, + groupCountY: u32, + groupCountZ: u32, + ), +>; +pub type PFN_vkCmdDispatchIndirect = ::std::option::Option< + unsafe extern "C" fn(commandBuffer: VkCommandBuffer, buffer: VkBuffer, offset: VkDeviceSize), +>; +pub type PFN_vkCmdCopyBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferCopy, + ), +>; +pub type PFN_vkCmdCopyImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageCopy, + ), +>; +pub type PFN_vkCmdBlitImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageBlit, + filter: VkFilter, + ), +>; +pub type PFN_vkCmdCopyBufferToImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkBufferImageCopy, + ), +>; +pub type PFN_vkCmdCopyImageToBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferImageCopy, + ), +>; +pub type PFN_vkCmdUpdateBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + dataSize: VkDeviceSize, + pData: *const ::std::os::raw::c_void, + ), +>; +pub type PFN_vkCmdFillBuffer = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + size: VkDeviceSize, + data: u32, + ), +>; +pub type PFN_vkCmdClearColorImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pColor: *const VkClearColorValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, + ), +>; +pub type PFN_vkCmdClearDepthStencilImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pDepthStencil: *const VkClearDepthStencilValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, + ), +>; +pub type PFN_vkCmdClearAttachments = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + attachmentCount: u32, + pAttachments: *const VkClearAttachment, + rectCount: u32, + pRects: *const VkClearRect, + ), +>; +pub type PFN_vkCmdResolveImage = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageResolve, + ), +>; +pub type PFN_vkCmdSetEvent = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, + ), +>; +pub type PFN_vkCmdResetEvent = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, + ), +>; +pub type PFN_vkCmdWaitEvents = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + eventCount: u32, + pEvents: *const VkEvent, + srcStageMask: VkPipelineStageFlags, + dstStageMask: VkPipelineStageFlags, + memoryBarrierCount: u32, + pMemoryBarriers: *const VkMemoryBarrier, + bufferMemoryBarrierCount: u32, + pBufferMemoryBarriers: *const VkBufferMemoryBarrier, + imageMemoryBarrierCount: u32, + pImageMemoryBarriers: *const VkImageMemoryBarrier, + ), +>; +pub type PFN_vkCmdPipelineBarrier = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + srcStageMask: VkPipelineStageFlags, + dstStageMask: VkPipelineStageFlags, + dependencyFlags: VkDependencyFlags, + memoryBarrierCount: u32, + pMemoryBarriers: *const VkMemoryBarrier, + bufferMemoryBarrierCount: u32, + pBufferMemoryBarriers: *const VkBufferMemoryBarrier, + imageMemoryBarrierCount: u32, + pImageMemoryBarriers: *const VkImageMemoryBarrier, + ), +>; +pub type PFN_vkCmdBeginQuery = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + query: u32, + flags: VkQueryControlFlags, + ), +>; +pub type PFN_vkCmdEndQuery = ::std::option::Option< + unsafe extern "C" fn(commandBuffer: VkCommandBuffer, queryPool: VkQueryPool, query: u32), +>; +pub type PFN_vkCmdResetQueryPool = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + ), +>; +pub type PFN_vkCmdWriteTimestamp = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pipelineStage: VkPipelineStageFlagBits, + queryPool: VkQueryPool, + query: u32, + ), +>; +pub type PFN_vkCmdCopyQueryPoolResults = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + stride: VkDeviceSize, + flags: VkQueryResultFlags, + ), +>; +pub type PFN_vkCmdPushConstants = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + layout: VkPipelineLayout, + stageFlags: VkShaderStageFlags, + offset: u32, + size: u32, + pValues: *const ::std::os::raw::c_void, + ), +>; +pub type PFN_vkCmdBeginRenderPass = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pRenderPassBegin: *const VkRenderPassBeginInfo, + contents: VkSubpassContents, + ), +>; +pub type PFN_vkCmdNextSubpass = ::std::option::Option< + unsafe extern "C" fn(commandBuffer: VkCommandBuffer, contents: VkSubpassContents), +>; pub type PFN_vkCmdEndRenderPass = - ::std::option::Option; -pub type PFN_vkCmdExecuteCommands = - ::std::option::Option; + ::std::option::Option; +pub type PFN_vkCmdExecuteCommands = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + commandBufferCount: u32, + pCommandBuffers: *const VkCommandBuffer, + ), +>; pub const VkColorSpaceKHR_VK_COLOR_SPACE_BEGIN_RANGE_KHR: VkColorSpaceKHR = VkColorSpaceKHR::VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; pub const VkColorSpaceKHR_VK_COLOR_SPACE_END_RANGE_KHR: VkColorSpaceKHR = @@ -4405,7 +4633,9 @@ pub struct VkSurfaceCapabilitiesKHR { pub supportedUsageFlags: VkImageUsageFlags, } impl Clone for VkSurfaceCapabilitiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4414,80 +4644,87 @@ pub struct VkSurfaceFormatKHR { pub colorSpace: VkColorSpaceKHR, } impl Clone for VkSurfaceFormatKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkDestroySurfaceKHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceSurfaceSupportKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceSurfaceFormatsKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceSurfacePresentModesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT = - ::std::option::Option VkResult>; -pub type PFN_vkDisplayPowerControlEXT = - ::std::option::Option VkResult>; -pub type PFN_vkRegisterDeviceEventEXT = - ::std::option::Option VkResult>; -pub type PFN_vkRegisterDisplayEventEXT = - ::std::option::Option VkResult>; -pub type PFN_vkGetSwapchainCounterEXT = - ::std::option::Option VkResult>; +pub type PFN_vkDestroySurfaceKHR = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + surface: VkSurfaceKHR, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetPhysicalDeviceSurfaceSupportKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + queueFamilyIndex: u32, + surface: VkSurfaceKHR, + pSupported: *mut VkBool32, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pSurfaceCapabilities: *mut VkSurfaceCapabilitiesKHR, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceSurfaceFormatsKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pSurfaceFormatCount: *mut u32, + pSurfaceFormats: *mut VkSurfaceFormatKHR, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceSurfacePresentModesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pPresentModeCount: *mut u32, + pPresentModes: *mut VkPresentModeKHR, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pSurfaceCapabilities: *mut VkSurfaceCapabilities2EXT, + ) -> VkResult, +>; +pub type PFN_vkDisplayPowerControlEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + display: VkDisplayKHR, + pDisplayPowerInfo: *const VkDisplayPowerInfoEXT, + ) -> VkResult, +>; +pub type PFN_vkRegisterDeviceEventEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pDeviceEventInfo: *const VkDeviceEventInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, + ) -> VkResult, +>; +pub type PFN_vkRegisterDisplayEventEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + display: VkDisplayKHR, + pDisplayEventInfo: *const VkDisplayEventInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, + ) -> VkResult, +>; +pub type PFN_vkGetSwapchainCounterEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + swapchain: VkSwapchainKHR, + counter: VkSurfaceCounterFlagBitsEXT, + pCounterValue: *mut u64, + ) -> VkResult, +>; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkSwapchainCreateFlagBitsKHR { @@ -4518,7 +4755,9 @@ pub struct VkSwapchainCreateInfoKHR { pub oldSwapchain: VkSwapchainKHR, } impl Clone for VkSwapchainCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4533,51 +4772,58 @@ pub struct VkPresentInfoKHR { pub pResults: *mut VkResult, } impl Clone for VkPresentInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCreateSwapchainKHR = - ::std::option::Option VkResult>; -pub type PFN_vkDestroySwapchainKHR = - ::std::option::Option; -pub type PFN_vkGetSwapchainImagesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkAcquireNextImageKHR = - ::std::option::Option VkResult>; -pub type PFN_vkQueuePresentKHR = - ::std::option::Option VkResult>; +pub type PFN_vkCreateSwapchainKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkSwapchainCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSwapchain: *mut VkSwapchainKHR, + ) -> VkResult, +>; +pub type PFN_vkDestroySwapchainKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + swapchain: VkSwapchainKHR, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkGetSwapchainImagesKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + swapchain: VkSwapchainKHR, + pSwapchainImageCount: *mut u32, + pSwapchainImages: *mut VkImage, + ) -> VkResult, +>; +pub type PFN_vkAcquireNextImageKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + swapchain: VkSwapchainKHR, + timeout: u64, + semaphore: VkSemaphore, + fence: VkFence, + pImageIndex: *mut u32, + ) -> VkResult, +>; +pub type PFN_vkQueuePresentKHR = ::std::option::Option< + unsafe extern "C" fn(queue: VkQueue, pPresentInfo: *const VkPresentInfoKHR) -> VkResult, +>; extern "C" { - pub fn vkAcquireNextImageKHR(device: VkDevice, swapchain: VkSwapchainKHR, - timeout: u64, semaphore: VkSemaphore, - fence: VkFence, pImageIndex: *mut u32) - -> VkResult; + pub fn vkAcquireNextImageKHR( + device: VkDevice, + swapchain: VkSwapchainKHR, + timeout: u64, + semaphore: VkSemaphore, + fence: VkFence, + pImageIndex: *mut u32, + ) -> VkResult; } extern "C" { - pub fn vkQueuePresentKHR(queue: VkQueue, - pPresentInfo: *const VkPresentInfoKHR) - -> VkResult; + pub fn vkQueuePresentKHR(queue: VkQueue, pPresentInfo: *const VkPresentInfoKHR) -> VkResult; } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4615,7 +4861,9 @@ pub struct VkDisplayPropertiesKHR { pub persistentContent: VkBool32, } impl Clone for VkDisplayPropertiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4624,7 +4872,9 @@ pub struct VkDisplayModeParametersKHR { pub refreshRate: u32, } impl Clone for VkDisplayModeParametersKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4633,7 +4883,9 @@ pub struct VkDisplayModePropertiesKHR { pub parameters: VkDisplayModeParametersKHR, } impl Clone for VkDisplayModePropertiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4644,7 +4896,9 @@ pub struct VkDisplayModeCreateInfoKHR { pub parameters: VkDisplayModeParametersKHR, } impl Clone for VkDisplayModeCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4660,7 +4914,9 @@ pub struct VkDisplayPlaneCapabilitiesKHR { pub maxDstExtent: VkExtent2D, } impl Clone for VkDisplayPlaneCapabilitiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4669,7 +4925,9 @@ pub struct VkDisplayPlanePropertiesKHR { pub currentStackIndex: u32, } impl Clone for VkDisplayPlanePropertiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4686,120 +4944,119 @@ pub struct VkDisplaySurfaceCreateInfoKHR { pub imageExtent: VkExtent2D, } impl Clone for VkDisplaySurfaceCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceDisplayPropertiesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetDisplayPlaneSupportedDisplaysKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetDisplayModePropertiesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkCreateDisplayModeKHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetDisplayPlaneCapabilitiesKHR = - ::std::option::Option VkResult>; -pub type PFN_vkCreateDisplayPlaneSurfaceKHR = - ::std::option::Option VkResult>; +pub type PFN_vkGetPhysicalDeviceDisplayPropertiesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayPropertiesKHR, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayPlanePropertiesKHR, + ) -> VkResult, +>; +pub type PFN_vkGetDisplayPlaneSupportedDisplaysKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + planeIndex: u32, + pDisplayCount: *mut u32, + pDisplays: *mut VkDisplayKHR, + ) -> VkResult, +>; +pub type PFN_vkGetDisplayModePropertiesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + display: VkDisplayKHR, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayModePropertiesKHR, + ) -> VkResult, +>; +pub type PFN_vkCreateDisplayModeKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + display: VkDisplayKHR, + pCreateInfo: *const VkDisplayModeCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pMode: *mut VkDisplayModeKHR, + ) -> VkResult, +>; +pub type PFN_vkGetDisplayPlaneCapabilitiesKHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + mode: VkDisplayModeKHR, + planeIndex: u32, + pCapabilities: *mut VkDisplayPlaneCapabilitiesKHR, + ) -> VkResult, +>; +pub type PFN_vkCreateDisplayPlaneSurfaceKHR = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pCreateInfo: *const VkDisplaySurfaceCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSurface: *mut VkSurfaceKHR, + ) -> VkResult, +>; extern "C" { - pub fn vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice: - VkPhysicalDevice, - pPropertyCount: *mut u32, - pProperties: - *mut VkDisplayPropertiesKHR) - -> VkResult; + pub fn vkGetPhysicalDeviceDisplayPropertiesKHR( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayPropertiesKHR, + ) -> VkResult; } extern "C" { - pub fn vkGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice: - VkPhysicalDevice, - pPropertyCount: - *mut u32, - pProperties: - *mut VkDisplayPlanePropertiesKHR) - -> VkResult; + pub fn vkGetPhysicalDeviceDisplayPlanePropertiesKHR( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayPlanePropertiesKHR, + ) -> VkResult; } extern "C" { - pub fn vkGetDisplayPlaneSupportedDisplaysKHR(physicalDevice: - VkPhysicalDevice, - planeIndex: u32, - pDisplayCount: *mut u32, - pDisplays: *mut VkDisplayKHR) - -> VkResult; + pub fn vkGetDisplayPlaneSupportedDisplaysKHR( + physicalDevice: VkPhysicalDevice, + planeIndex: u32, + pDisplayCount: *mut u32, + pDisplays: *mut VkDisplayKHR, + ) -> VkResult; } extern "C" { - pub fn vkGetDisplayModePropertiesKHR(physicalDevice: VkPhysicalDevice, - display: VkDisplayKHR, - pPropertyCount: *mut u32, - pProperties: - *mut VkDisplayModePropertiesKHR) - -> VkResult; + pub fn vkGetDisplayModePropertiesKHR( + physicalDevice: VkPhysicalDevice, + display: VkDisplayKHR, + pPropertyCount: *mut u32, + pProperties: *mut VkDisplayModePropertiesKHR, + ) -> VkResult; } extern "C" { - pub fn vkCreateDisplayModeKHR(physicalDevice: VkPhysicalDevice, - display: VkDisplayKHR, - pCreateInfo: - *const VkDisplayModeCreateInfoKHR, - pAllocator: *const VkAllocationCallbacks, - pMode: *mut VkDisplayModeKHR) -> VkResult; + pub fn vkCreateDisplayModeKHR( + physicalDevice: VkPhysicalDevice, + display: VkDisplayKHR, + pCreateInfo: *const VkDisplayModeCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pMode: *mut VkDisplayModeKHR, + ) -> VkResult; } extern "C" { - pub fn vkGetDisplayPlaneCapabilitiesKHR(physicalDevice: VkPhysicalDevice, - mode: VkDisplayModeKHR, - planeIndex: u32, - pCapabilities: - *mut VkDisplayPlaneCapabilitiesKHR) - -> VkResult; + pub fn vkGetDisplayPlaneCapabilitiesKHR( + physicalDevice: VkPhysicalDevice, + mode: VkDisplayModeKHR, + planeIndex: u32, + pCapabilities: *mut VkDisplayPlaneCapabilitiesKHR, + ) -> VkResult; } extern "C" { - pub fn vkCreateDisplayPlaneSurfaceKHR(instance: VkInstance, - pCreateInfo: - *const VkDisplaySurfaceCreateInfoKHR, - pAllocator: - *const VkAllocationCallbacks, - pSurface: *mut VkSurfaceKHR) - -> VkResult; + pub fn vkCreateDisplayPlaneSurfaceKHR( + instance: VkInstance, + pCreateInfo: *const VkDisplaySurfaceCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSurface: *mut VkSurfaceKHR, + ) -> VkResult; } #[repr(C)] #[derive(Debug, Copy)] @@ -4811,26 +5068,27 @@ pub struct VkDisplayPresentInfoKHR { pub persistent: VkBool32, } impl Clone for VkDisplayPresentInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCreateSharedSwapchainsKHR = - ::std::option::Option VkResult>; +pub type PFN_vkCreateSharedSwapchainsKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + swapchainCount: u32, + pCreateInfos: *const VkSwapchainCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSwapchains: *mut VkSwapchainKHR, + ) -> VkResult, +>; extern "C" { - pub fn vkCreateSharedSwapchainsKHR(device: VkDevice, swapchainCount: u32, - pCreateInfos: - *const VkSwapchainCreateInfoKHR, - pAllocator: - *const VkAllocationCallbacks, - pSwapchains: *mut VkSwapchainKHR) - -> VkResult; + pub fn vkCreateSharedSwapchainsKHR( + device: VkDevice, + swapchainCount: u32, + pCreateInfos: *const VkSwapchainCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSwapchains: *mut VkSwapchainKHR, + ) -> VkResult; } pub type VkWin32SurfaceCreateFlagsKHR = VkFlags; #[repr(C)] @@ -4843,7 +5101,9 @@ pub struct VkWin32SurfaceCreateInfoKHR { pub hwnd: *mut ::std::os::raw::c_void, } impl Clone for VkWin32SurfaceCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub type VkXcbSurfaceCreateFlagsKHR = VkFlags; #[repr(C)] @@ -4856,7 +5116,9 @@ pub struct VkXcbSurfaceCreateInfoKHR { pub window: u32, } impl Clone for VkXcbSurfaceCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub type VkMacOSSurfaceCreateFlagsMVK = VkFlags; #[repr(C)] @@ -4868,7 +5130,9 @@ pub struct VkMacOSSurfaceCreateInfoMVK { pub pView: *mut ::std::os::raw::c_void, } impl Clone for VkMacOSSurfaceCreateInfoMVK { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4878,7 +5142,9 @@ pub struct VkPhysicalDeviceFeatures2KHR { pub features: VkPhysicalDeviceFeatures, } impl Clone for VkPhysicalDeviceFeatures2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -4888,7 +5154,9 @@ pub struct VkPhysicalDeviceProperties2KHR { pub properties: VkPhysicalDeviceProperties, } impl Clone for VkPhysicalDeviceProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4898,7 +5166,9 @@ pub struct VkFormatProperties2KHR { pub formatProperties: VkFormatProperties, } impl Clone for VkFormatProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4908,7 +5178,9 @@ pub struct VkImageFormatProperties2KHR { pub imageFormatProperties: VkImageFormatProperties, } impl Clone for VkImageFormatProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4922,7 +5194,9 @@ pub struct VkPhysicalDeviceImageFormatInfo2KHR { pub flags: VkImageCreateFlags, } impl Clone for VkPhysicalDeviceImageFormatInfo2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4932,7 +5206,9 @@ pub struct VkQueueFamilyProperties2KHR { pub queueFamilyProperties: VkQueueFamilyProperties, } impl Clone for VkQueueFamilyProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4942,7 +5218,9 @@ pub struct VkPhysicalDeviceMemoryProperties2KHR { pub memoryProperties: VkPhysicalDeviceMemoryProperties, } impl Clone for VkPhysicalDeviceMemoryProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4952,7 +5230,9 @@ pub struct VkSparseImageFormatProperties2KHR { pub properties: VkSparseImageFormatProperties, } impl Clone for VkSparseImageFormatProperties2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -4966,111 +5246,118 @@ pub struct VkPhysicalDeviceSparseImageFormatInfo2KHR { pub tiling: VkImageTiling, } impl Clone for VkPhysicalDeviceSparseImageFormatInfo2KHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceFeatures2KHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceProperties2KHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceFormatProperties2KHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceImageFormatProperties2KHR = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceMemoryProperties2KHR = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = - ::std::option::Option; +pub type PFN_vkGetPhysicalDeviceFeatures2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkPhysicalDeviceFeatures2KHR, + ), +>; +pub type PFN_vkGetPhysicalDeviceProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties2KHR, + ), +>; +pub type PFN_vkGetPhysicalDeviceFormatProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + pFormatProperties: *mut VkFormatProperties2KHR, + ), +>; +pub type PFN_vkGetPhysicalDeviceImageFormatProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pImageFormatInfo: *const VkPhysicalDeviceImageFormatInfo2KHR, + pImageFormatProperties: *mut VkImageFormatProperties2KHR, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pQueueFamilyPropertyCount: *mut u32, + pQueueFamilyProperties: *mut VkQueueFamilyProperties2KHR, + ), +>; +pub type PFN_vkGetPhysicalDeviceMemoryProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties2KHR, + ), +>; +pub type PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pFormatInfo: *const VkPhysicalDeviceSparseImageFormatInfo2KHR, + pPropertyCount: *mut u32, + pProperties: *mut VkSparseImageFormatProperties2KHR, + ), +>; extern "C" { - pub fn vkGetPhysicalDeviceFeatures2KHR(physicalDevice: VkPhysicalDevice, - pFeatures: - *mut VkPhysicalDeviceFeatures2KHR); + pub fn vkGetPhysicalDeviceFeatures2KHR( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkPhysicalDeviceFeatures2KHR, + ); } extern "C" { - pub fn vkGetPhysicalDeviceProperties2KHR(physicalDevice: VkPhysicalDevice, - pProperties: - *mut VkPhysicalDeviceProperties2KHR); + pub fn vkGetPhysicalDeviceProperties2KHR( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties2KHR, + ); } extern "C" { - pub fn vkGetPhysicalDeviceFormatProperties2KHR(physicalDevice: - VkPhysicalDevice, - format: VkFormat, - pFormatProperties: - *mut VkFormatProperties2KHR); + pub fn vkGetPhysicalDeviceFormatProperties2KHR( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + pFormatProperties: *mut VkFormatProperties2KHR, + ); } extern "C" { - pub fn vkGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice: - VkPhysicalDevice, - pImageFormatInfo: - *const VkPhysicalDeviceImageFormatInfo2KHR, - pImageFormatProperties: - *mut VkImageFormatProperties2KHR) - -> VkResult; + pub fn vkGetPhysicalDeviceImageFormatProperties2KHR( + physicalDevice: VkPhysicalDevice, + pImageFormatInfo: *const VkPhysicalDeviceImageFormatInfo2KHR, + pImageFormatProperties: *mut VkImageFormatProperties2KHR, + ) -> VkResult; } extern "C" { - pub fn vkGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice: - VkPhysicalDevice, - pQueueFamilyPropertyCount: - *mut u32, - pQueueFamilyProperties: - *mut VkQueueFamilyProperties2KHR); + pub fn vkGetPhysicalDeviceQueueFamilyProperties2KHR( + physicalDevice: VkPhysicalDevice, + pQueueFamilyPropertyCount: *mut u32, + pQueueFamilyProperties: *mut VkQueueFamilyProperties2KHR, + ); } extern "C" { - pub fn vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice: - VkPhysicalDevice, - pMemoryProperties: - *mut VkPhysicalDeviceMemoryProperties2KHR); + pub fn vkGetPhysicalDeviceMemoryProperties2KHR( + physicalDevice: VkPhysicalDevice, + pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties2KHR, + ); } extern "C" { - pub fn vkGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice: - VkPhysicalDevice, - pFormatInfo: - *const VkPhysicalDeviceSparseImageFormatInfo2KHR, - pPropertyCount: - *mut u32, - pProperties: - *mut VkSparseImageFormatProperties2KHR); + pub fn vkGetPhysicalDeviceSparseImageFormatProperties2KHR( + physicalDevice: VkPhysicalDevice, + pFormatInfo: *const VkPhysicalDeviceSparseImageFormatInfo2KHR, + pPropertyCount: *mut u32, + pProperties: *mut VkSparseImageFormatProperties2KHR, + ); } pub type VkCommandPoolTrimFlagsKHR = VkFlags; -pub type PFN_vkTrimCommandPoolKHR = - ::std::option::Option; +pub type PFN_vkTrimCommandPoolKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + commandPool: VkCommandPool, + flags: VkCommandPoolTrimFlagsKHR, + ), +>; extern "C" { - pub fn vkTrimCommandPoolKHR(device: VkDevice, commandPool: VkCommandPool, - flags: VkCommandPoolTrimFlagsKHR); + pub fn vkTrimCommandPoolKHR( + device: VkDevice, + commandPool: VkCommandPool, + flags: VkCommandPoolTrimFlagsKHR, + ); } #[repr(C)] #[derive(Debug, Copy)] @@ -5080,24 +5367,29 @@ pub struct VkPhysicalDevicePushDescriptorPropertiesKHR { pub maxPushDescriptors: u32, } impl Clone for VkPhysicalDevicePushDescriptorPropertiesKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCmdPushDescriptorSetKHR = - ::std::option::Option; +pub type PFN_vkCmdPushDescriptorSetKHR = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + layout: VkPipelineLayout, + set: u32, + descriptorWriteCount: u32, + pDescriptorWrites: *const VkWriteDescriptorSet, + ), +>; extern "C" { - pub fn vkCmdPushDescriptorSetKHR(commandBuffer: VkCommandBuffer, - pipelineBindPoint: VkPipelineBindPoint, - layout: VkPipelineLayout, set: u32, - descriptorWriteCount: u32, - pDescriptorWrites: - *const VkWriteDescriptorSet); + pub fn vkCmdPushDescriptorSetKHR( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + layout: VkPipelineLayout, + set: u32, + descriptorWriteCount: u32, + pDescriptorWrites: *const VkWriteDescriptorSet, + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5106,10 +5398,10 @@ pub struct VkDescriptorUpdateTemplateKHR_T { } pub type VkDescriptorUpdateTemplateKHR = *mut VkDescriptorUpdateTemplateKHR_T; pub const VkDescriptorUpdateTemplateTypeKHR_VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_BEGIN_RANGE_KHR: - VkDescriptorUpdateTemplateTypeKHR = + VkDescriptorUpdateTemplateTypeKHR = VkDescriptorUpdateTemplateTypeKHR::VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR; pub const VkDescriptorUpdateTemplateTypeKHR_VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_END_RANGE_KHR: - VkDescriptorUpdateTemplateTypeKHR = + VkDescriptorUpdateTemplateTypeKHR = VkDescriptorUpdateTemplateTypeKHR::VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5131,7 +5423,9 @@ pub struct VkDescriptorUpdateTemplateEntryKHR { pub stride: usize, } impl Clone for VkDescriptorUpdateTemplateEntryKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5148,73 +5442,73 @@ pub struct VkDescriptorUpdateTemplateCreateInfoKHR { pub set: u32, } impl Clone for VkDescriptorUpdateTemplateCreateInfoKHR { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCreateDescriptorUpdateTemplateKHR = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyDescriptorUpdateTemplateKHR = - ::std::option::Option; -pub type PFN_vkUpdateDescriptorSetWithTemplateKHR = - ::std::option::Option; -pub type PFN_vkCmdPushDescriptorSetWithTemplateKHR = - ::std::option::Option; +pub type PFN_vkCreateDescriptorUpdateTemplateKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkDescriptorUpdateTemplateCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pDescriptorUpdateTemplate: *mut VkDescriptorUpdateTemplateKHR, + ) -> VkResult, +>; +pub type PFN_vkDestroyDescriptorUpdateTemplateKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkUpdateDescriptorSetWithTemplateKHR = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + descriptorSet: VkDescriptorSet, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + pData: *const ::std::os::raw::c_void, + ), +>; +pub type PFN_vkCmdPushDescriptorSetWithTemplateKHR = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + layout: VkPipelineLayout, + set: u32, + pData: *const ::std::os::raw::c_void, + ), +>; extern "C" { - pub fn vkCreateDescriptorUpdateTemplateKHR(device: VkDevice, - pCreateInfo: - *const VkDescriptorUpdateTemplateCreateInfoKHR, - pAllocator: - *const VkAllocationCallbacks, - pDescriptorUpdateTemplate: - *mut VkDescriptorUpdateTemplateKHR) - -> VkResult; + pub fn vkCreateDescriptorUpdateTemplateKHR( + device: VkDevice, + pCreateInfo: *const VkDescriptorUpdateTemplateCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pDescriptorUpdateTemplate: *mut VkDescriptorUpdateTemplateKHR, + ) -> VkResult; } extern "C" { - pub fn vkDestroyDescriptorUpdateTemplateKHR(device: VkDevice, - descriptorUpdateTemplate: - VkDescriptorUpdateTemplateKHR, - pAllocator: - *const VkAllocationCallbacks); + pub fn vkDestroyDescriptorUpdateTemplateKHR( + device: VkDevice, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + pAllocator: *const VkAllocationCallbacks, + ); } extern "C" { - pub fn vkUpdateDescriptorSetWithTemplateKHR(device: VkDevice, - descriptorSet: - VkDescriptorSet, - descriptorUpdateTemplate: - VkDescriptorUpdateTemplateKHR, - pData: - *const ::std::os::raw::c_void); + pub fn vkUpdateDescriptorSetWithTemplateKHR( + device: VkDevice, + descriptorSet: VkDescriptorSet, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + pData: *const ::std::os::raw::c_void, + ); } extern "C" { - pub fn vkCmdPushDescriptorSetWithTemplateKHR(commandBuffer: - VkCommandBuffer, - descriptorUpdateTemplate: - VkDescriptorUpdateTemplateKHR, - layout: VkPipelineLayout, - set: u32, - pData: - *const ::std::os::raw::c_void); + pub fn vkCmdPushDescriptorSetWithTemplateKHR( + commandBuffer: VkCommandBuffer, + descriptorUpdateTemplate: VkDescriptorUpdateTemplateKHR, + layout: VkPipelineLayout, + set: u32, + pData: *const ::std::os::raw::c_void, + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5223,10 +5517,10 @@ pub struct VkDebugReportCallbackEXT_T { } pub type VkDebugReportCallbackEXT = *mut VkDebugReportCallbackEXT_T; pub const VkDebugReportObjectTypeEXT_VK_DEBUG_REPORT_OBJECT_TYPE_BEGIN_RANGE_EXT: - VkDebugReportObjectTypeEXT = + VkDebugReportObjectTypeEXT = VkDebugReportObjectTypeEXT::VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT; pub const VkDebugReportObjectTypeEXT_VK_DEBUG_REPORT_OBJECT_TYPE_END_RANGE_EXT: - VkDebugReportObjectTypeEXT = + VkDebugReportObjectTypeEXT = VkDebugReportObjectTypeEXT::VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5267,11 +5561,9 @@ pub enum VkDebugReportObjectTypeEXT { VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT = 33, VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 2147483647, } -pub const VkDebugReportErrorEXT_VK_DEBUG_REPORT_ERROR_BEGIN_RANGE_EXT: - VkDebugReportErrorEXT = +pub const VkDebugReportErrorEXT_VK_DEBUG_REPORT_ERROR_BEGIN_RANGE_EXT: VkDebugReportErrorEXT = VkDebugReportErrorEXT::VK_DEBUG_REPORT_ERROR_NONE_EXT; -pub const VkDebugReportErrorEXT_VK_DEBUG_REPORT_ERROR_END_RANGE_EXT: - VkDebugReportErrorEXT = +pub const VkDebugReportErrorEXT_VK_DEBUG_REPORT_ERROR_END_RANGE_EXT: VkDebugReportErrorEXT = VkDebugReportErrorEXT::VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5292,19 +5584,18 @@ pub enum VkDebugReportFlagBitsEXT { VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 2147483647, } pub type VkDebugReportFlagsEXT = VkFlags; -pub type PFN_vkDebugReportCallbackEXT = - ::std::option::Option VkBool32>; +pub type PFN_vkDebugReportCallbackEXT = ::std::option::Option< + unsafe extern "C" fn( + flags: VkDebugReportFlagsEXT, + objectType: VkDebugReportObjectTypeEXT, + object: u64, + location: usize, + messageCode: i32, + pLayerPrefix: *const ::std::os::raw::c_char, + pMessage: *const ::std::os::raw::c_char, + pUserData: *mut ::std::os::raw::c_void, + ) -> VkBool32, +>; #[repr(C)] #[derive(Debug, Copy)] pub struct VkDebugReportCallbackCreateInfoEXT { @@ -5315,65 +5606,67 @@ pub struct VkDebugReportCallbackCreateInfoEXT { pub pUserData: *mut ::std::os::raw::c_void, } impl Clone for VkDebugReportCallbackCreateInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCreateDebugReportCallbackEXT = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyDebugReportCallbackEXT = - ::std::option::Option; -pub type PFN_vkDebugReportMessageEXT = - ::std::option::Option; +pub type PFN_vkCreateDebugReportCallbackEXT = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pCreateInfo: *const VkDebugReportCallbackCreateInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pCallback: *mut VkDebugReportCallbackEXT, + ) -> VkResult, +>; +pub type PFN_vkDestroyDebugReportCallbackEXT = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + callback: VkDebugReportCallbackEXT, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkDebugReportMessageEXT = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + flags: VkDebugReportFlagsEXT, + objectType: VkDebugReportObjectTypeEXT, + object: u64, + location: usize, + messageCode: i32, + pLayerPrefix: *const ::std::os::raw::c_char, + pMessage: *const ::std::os::raw::c_char, + ), +>; extern "C" { - pub fn vkCreateDebugReportCallbackEXT(instance: VkInstance, - pCreateInfo: - *const VkDebugReportCallbackCreateInfoEXT, - pAllocator: - *const VkAllocationCallbacks, - pCallback: - *mut VkDebugReportCallbackEXT) - -> VkResult; + pub fn vkCreateDebugReportCallbackEXT( + instance: VkInstance, + pCreateInfo: *const VkDebugReportCallbackCreateInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pCallback: *mut VkDebugReportCallbackEXT, + ) -> VkResult; } extern "C" { - pub fn vkDestroyDebugReportCallbackEXT(instance: VkInstance, - callback: VkDebugReportCallbackEXT, - pAllocator: - *const VkAllocationCallbacks); + pub fn vkDestroyDebugReportCallbackEXT( + instance: VkInstance, + callback: VkDebugReportCallbackEXT, + pAllocator: *const VkAllocationCallbacks, + ); } extern "C" { - pub fn vkDebugReportMessageEXT(instance: VkInstance, - flags: VkDebugReportFlagsEXT, - objectType: VkDebugReportObjectTypeEXT, - object: u64, location: usize, - messageCode: i32, - pLayerPrefix: - *const ::std::os::raw::c_char, - pMessage: *const ::std::os::raw::c_char); + pub fn vkDebugReportMessageEXT( + instance: VkInstance, + flags: VkDebugReportFlagsEXT, + objectType: VkDebugReportObjectTypeEXT, + object: u64, + location: usize, + messageCode: i32, + pLayerPrefix: *const ::std::os::raw::c_char, + pMessage: *const ::std::os::raw::c_char, + ); } -pub const VkRasterizationOrderAMD_VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD: - VkRasterizationOrderAMD = +pub const VkRasterizationOrderAMD_VK_RASTERIZATION_ORDER_BEGIN_RANGE_AMD: VkRasterizationOrderAMD = VkRasterizationOrderAMD::VK_RASTERIZATION_ORDER_STRICT_AMD; -pub const VkRasterizationOrderAMD_VK_RASTERIZATION_ORDER_END_RANGE_AMD: - VkRasterizationOrderAMD = +pub const VkRasterizationOrderAMD_VK_RASTERIZATION_ORDER_END_RANGE_AMD: VkRasterizationOrderAMD = VkRasterizationOrderAMD::VK_RASTERIZATION_ORDER_RELAXED_AMD; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5391,7 +5684,9 @@ pub struct VkPipelineRasterizationStateRasterizationOrderAMD { pub rasterizationOrder: VkRasterizationOrderAMD, } impl Clone for VkPipelineRasterizationStateRasterizationOrderAMD { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5403,7 +5698,9 @@ pub struct VkDebugMarkerObjectNameInfoEXT { pub pObjectName: *const ::std::os::raw::c_char, } impl Clone for VkDebugMarkerObjectNameInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5417,7 +5714,9 @@ pub struct VkDebugMarkerObjectTagInfoEXT { pub pTag: *const ::std::os::raw::c_void, } impl Clone for VkDebugMarkerObjectTagInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5428,53 +5727,62 @@ pub struct VkDebugMarkerMarkerInfoEXT { pub color: [f32; 4usize], } impl Clone for VkDebugMarkerMarkerInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkDebugMarkerSetObjectTagEXT = - ::std::option::Option VkResult>; -pub type PFN_vkDebugMarkerSetObjectNameEXT = - ::std::option::Option VkResult>; -pub type PFN_vkCmdDebugMarkerBeginEXT = - ::std::option::Option; +pub type PFN_vkDebugMarkerSetObjectTagEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pTagInfo: *mut VkDebugMarkerObjectTagInfoEXT, + ) -> VkResult, +>; +pub type PFN_vkDebugMarkerSetObjectNameEXT = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pNameInfo: *mut VkDebugMarkerObjectNameInfoEXT, + ) -> VkResult, +>; +pub type PFN_vkCmdDebugMarkerBeginEXT = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pMarkerInfo: *mut VkDebugMarkerMarkerInfoEXT, + ), +>; pub type PFN_vkCmdDebugMarkerEndEXT = - ::std::option::Option; -pub type PFN_vkCmdDebugMarkerInsertEXT = - ::std::option::Option; + ::std::option::Option; +pub type PFN_vkCmdDebugMarkerInsertEXT = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pMarkerInfo: *mut VkDebugMarkerMarkerInfoEXT, + ), +>; extern "C" { - pub fn vkDebugMarkerSetObjectTagEXT(device: VkDevice, - pTagInfo: - *mut VkDebugMarkerObjectTagInfoEXT) - -> VkResult; + pub fn vkDebugMarkerSetObjectTagEXT( + device: VkDevice, + pTagInfo: *mut VkDebugMarkerObjectTagInfoEXT, + ) -> VkResult; } extern "C" { - pub fn vkDebugMarkerSetObjectNameEXT(device: VkDevice, - pNameInfo: - *mut VkDebugMarkerObjectNameInfoEXT) - -> VkResult; + pub fn vkDebugMarkerSetObjectNameEXT( + device: VkDevice, + pNameInfo: *mut VkDebugMarkerObjectNameInfoEXT, + ) -> VkResult; } extern "C" { - pub fn vkCmdDebugMarkerBeginEXT(commandBuffer: VkCommandBuffer, - pMarkerInfo: - *mut VkDebugMarkerMarkerInfoEXT); + pub fn vkCmdDebugMarkerBeginEXT( + commandBuffer: VkCommandBuffer, + pMarkerInfo: *mut VkDebugMarkerMarkerInfoEXT, + ); } extern "C" { pub fn vkCmdDebugMarkerEndEXT(commandBuffer: VkCommandBuffer); } extern "C" { - pub fn vkCmdDebugMarkerInsertEXT(commandBuffer: VkCommandBuffer, - pMarkerInfo: - *mut VkDebugMarkerMarkerInfoEXT); + pub fn vkCmdDebugMarkerInsertEXT( + commandBuffer: VkCommandBuffer, + pMarkerInfo: *mut VkDebugMarkerMarkerInfoEXT, + ); } #[repr(C)] #[derive(Debug, Copy)] @@ -5484,7 +5792,9 @@ pub struct VkDedicatedAllocationImageCreateInfoNV { pub dedicatedAllocation: VkBool32, } impl Clone for VkDedicatedAllocationImageCreateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5494,7 +5804,9 @@ pub struct VkDedicatedAllocationBufferCreateInfoNV { pub dedicatedAllocation: VkBool32, } impl Clone for VkDedicatedAllocationBufferCreateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5505,40 +5817,53 @@ pub struct VkDedicatedAllocationMemoryAllocateInfoNV { pub buffer: VkBuffer, } impl Clone for VkDedicatedAllocationMemoryAllocateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCmdDrawIndirectCountAMD = - ::std::option::Option; -pub type PFN_vkCmdDrawIndexedIndirectCountAMD = - ::std::option::Option; +pub type PFN_vkCmdDrawIndirectCountAMD = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + countBuffer: VkBuffer, + countBufferOffset: VkDeviceSize, + maxDrawCount: u32, + stride: u32, + ), +>; +pub type PFN_vkCmdDrawIndexedIndirectCountAMD = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + countBuffer: VkBuffer, + countBufferOffset: VkDeviceSize, + maxDrawCount: u32, + stride: u32, + ), +>; extern "C" { - pub fn vkCmdDrawIndirectCountAMD(commandBuffer: VkCommandBuffer, - buffer: VkBuffer, offset: VkDeviceSize, - countBuffer: VkBuffer, - countBufferOffset: VkDeviceSize, - maxDrawCount: u32, stride: u32); + pub fn vkCmdDrawIndirectCountAMD( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + countBuffer: VkBuffer, + countBufferOffset: VkDeviceSize, + maxDrawCount: u32, + stride: u32, + ); } extern "C" { - pub fn vkCmdDrawIndexedIndirectCountAMD(commandBuffer: VkCommandBuffer, - buffer: VkBuffer, - offset: VkDeviceSize, - countBuffer: VkBuffer, - countBufferOffset: VkDeviceSize, - maxDrawCount: u32, stride: u32); + pub fn vkCmdDrawIndexedIndirectCountAMD( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + countBuffer: VkBuffer, + countBufferOffset: VkDeviceSize, + maxDrawCount: u32, + stride: u32, + ); } #[repr(C)] #[derive(Debug, Copy)] @@ -5553,7 +5878,9 @@ pub struct VkRenderPassMultiviewCreateInfoKHX { pub pCorrelationMasks: *const u32, } impl Clone for VkRenderPassMultiviewCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5565,7 +5892,9 @@ pub struct VkPhysicalDeviceMultiviewFeaturesKHX { pub multiviewTessellationShader: VkBool32, } impl Clone for VkPhysicalDeviceMultiviewFeaturesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5576,7 +5905,9 @@ pub struct VkPhysicalDeviceMultiviewPropertiesKHX { pub maxMultiviewInstanceIndex: u32, } impl Clone for VkPhysicalDeviceMultiviewPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5606,39 +5937,33 @@ pub struct VkExternalImageFormatPropertiesNV { pub compatibleHandleTypes: VkExternalMemoryHandleTypeFlagsNV, } impl Clone for VkExternalImageFormatPropertiesNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = - ::std::option::Option VkResult>; +pub type PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + tiling: VkImageTiling, + usage: VkImageUsageFlags, + flags: VkImageCreateFlags, + externalHandleType: VkExternalMemoryHandleTypeFlagsNV, + pExternalImageFormatProperties: *mut VkExternalImageFormatPropertiesNV, + ) -> VkResult, +>; extern "C" { - pub fn vkGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice: - VkPhysicalDevice, - format: - VkFormat, - type_: - VkImageType, - tiling: - VkImageTiling, - usage: - VkImageUsageFlags, - flags: - VkImageCreateFlags, - externalHandleType: - VkExternalMemoryHandleTypeFlagsNV, - pExternalImageFormatProperties: - *mut VkExternalImageFormatPropertiesNV) - -> VkResult; + pub fn vkGetPhysicalDeviceExternalImageFormatPropertiesNV( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + tiling: VkImageTiling, + usage: VkImageUsageFlags, + flags: VkImageCreateFlags, + externalHandleType: VkExternalMemoryHandleTypeFlagsNV, + pExternalImageFormatProperties: *mut VkExternalImageFormatPropertiesNV, + ) -> VkResult; } #[repr(C)] #[derive(Debug, Copy)] @@ -5648,7 +5973,9 @@ pub struct VkExternalMemoryImageCreateInfoNV { pub handleTypes: VkExternalMemoryHandleTypeFlagsNV, } impl Clone for VkExternalMemoryImageCreateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5658,7 +5985,9 @@ pub struct VkExportMemoryAllocateInfoNV { pub handleTypes: VkExternalMemoryHandleTypeFlagsNV, } impl Clone for VkExportMemoryAllocateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5696,7 +6025,9 @@ pub struct VkMemoryAllocateFlagsInfoKHX { pub deviceMask: u32, } impl Clone for VkMemoryAllocateFlagsInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5710,7 +6041,9 @@ pub struct VkBindBufferMemoryInfoKHX { pub pDeviceIndices: *const u32, } impl Clone for VkBindBufferMemoryInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5726,7 +6059,9 @@ pub struct VkBindImageMemoryInfoKHX { pub pSFRRects: *const VkRect2D, } impl Clone for VkBindImageMemoryInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5738,7 +6073,9 @@ pub struct VkDeviceGroupRenderPassBeginInfoKHX { pub pDeviceRenderAreas: *const VkRect2D, } impl Clone for VkDeviceGroupRenderPassBeginInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5748,7 +6085,9 @@ pub struct VkDeviceGroupCommandBufferBeginInfoKHX { pub deviceMask: u32, } impl Clone for VkDeviceGroupCommandBufferBeginInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5763,7 +6102,9 @@ pub struct VkDeviceGroupSubmitInfoKHX { pub pSignalSemaphoreDeviceIndices: *const u32, } impl Clone for VkDeviceGroupSubmitInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5774,7 +6115,9 @@ pub struct VkDeviceGroupBindSparseInfoKHX { pub memoryDeviceIndex: u32, } impl Clone for VkDeviceGroupBindSparseInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5785,7 +6128,9 @@ pub struct VkDeviceGroupPresentCapabilitiesKHX { pub modes: VkDeviceGroupPresentModeFlagsKHX, } impl Clone for VkDeviceGroupPresentCapabilitiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5795,7 +6140,9 @@ pub struct VkImageSwapchainCreateInfoKHX { pub swapchain: VkSwapchainKHR, } impl Clone for VkImageSwapchainCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5806,7 +6153,9 @@ pub struct VkBindImageMemorySwapchainInfoKHX { pub imageIndex: u32, } impl Clone for VkBindImageMemorySwapchainInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5820,7 +6169,9 @@ pub struct VkAcquireNextImageInfoKHX { pub deviceMask: u32, } impl Clone for VkAcquireNextImageInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5832,7 +6183,9 @@ pub struct VkDeviceGroupPresentInfoKHX { pub mode: VkDeviceGroupPresentModeFlagBitsKHX, } impl Clone for VkDeviceGroupPresentInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5842,123 +6195,142 @@ pub struct VkDeviceGroupSwapchainCreateInfoKHX { pub modes: VkDeviceGroupPresentModeFlagsKHX, } impl Clone for VkDeviceGroupSwapchainCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX = - ::std::option::Option; -pub type PFN_vkBindBufferMemory2KHX = - ::std::option::Option VkResult>; -pub type PFN_vkBindImageMemory2KHX = - ::std::option::Option VkResult>; +pub type PFN_vkGetDeviceGroupPeerMemoryFeaturesKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + heapIndex: u32, + localDeviceIndex: u32, + remoteDeviceIndex: u32, + pPeerMemoryFeatures: *mut VkPeerMemoryFeatureFlagsKHX, + ), +>; +pub type PFN_vkBindBufferMemory2KHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + bindInfoCount: u32, + pBindInfos: *const VkBindBufferMemoryInfoKHX, + ) -> VkResult, +>; +pub type PFN_vkBindImageMemory2KHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + bindInfoCount: u32, + pBindInfos: *const VkBindImageMemoryInfoKHX, + ) -> VkResult, +>; pub type PFN_vkCmdSetDeviceMaskKHX = - ::std::option::Option; -pub type PFN_vkGetDeviceGroupPresentCapabilitiesKHX = - ::std::option::Option VkResult>; -pub type PFN_vkGetDeviceGroupSurfacePresentModesKHX = - ::std::option::Option VkResult>; -pub type PFN_vkAcquireNextImage2KHX = - ::std::option::Option VkResult>; -pub type PFN_vkCmdDispatchBaseKHX = - ::std::option::Option; -pub type PFN_vkGetPhysicalDevicePresentRectanglesKHX = - ::std::option::Option VkResult>; + ::std::option::Option; +pub type PFN_vkGetDeviceGroupPresentCapabilitiesKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pDeviceGroupPresentCapabilities: *mut VkDeviceGroupPresentCapabilitiesKHX, + ) -> VkResult, +>; +pub type PFN_vkGetDeviceGroupSurfacePresentModesKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + surface: VkSurfaceKHR, + pModes: *mut VkDeviceGroupPresentModeFlagsKHX, + ) -> VkResult, +>; +pub type PFN_vkAcquireNextImage2KHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pAcquireInfo: *const VkAcquireNextImageInfoKHX, + pImageIndex: *mut u32, + ) -> VkResult, +>; +pub type PFN_vkCmdDispatchBaseKHX = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + baseGroupX: u32, + baseGroupY: u32, + baseGroupZ: u32, + groupCountX: u32, + groupCountY: u32, + groupCountZ: u32, + ), +>; +pub type PFN_vkGetPhysicalDevicePresentRectanglesKHX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pRectCount: *mut u32, + pRects: *mut VkRect2D, + ) -> VkResult, +>; extern "C" { - pub fn vkGetDeviceGroupPeerMemoryFeaturesKHX(device: VkDevice, - heapIndex: u32, - localDeviceIndex: u32, - remoteDeviceIndex: u32, - pPeerMemoryFeatures: - *mut VkPeerMemoryFeatureFlagsKHX); + pub fn vkGetDeviceGroupPeerMemoryFeaturesKHX( + device: VkDevice, + heapIndex: u32, + localDeviceIndex: u32, + remoteDeviceIndex: u32, + pPeerMemoryFeatures: *mut VkPeerMemoryFeatureFlagsKHX, + ); } extern "C" { - pub fn vkBindBufferMemory2KHX(device: VkDevice, bindInfoCount: u32, - pBindInfos: - *const VkBindBufferMemoryInfoKHX) - -> VkResult; + pub fn vkBindBufferMemory2KHX( + device: VkDevice, + bindInfoCount: u32, + pBindInfos: *const VkBindBufferMemoryInfoKHX, + ) -> VkResult; } extern "C" { - pub fn vkBindImageMemory2KHX(device: VkDevice, bindInfoCount: u32, - pBindInfos: *const VkBindImageMemoryInfoKHX) - -> VkResult; + pub fn vkBindImageMemory2KHX( + device: VkDevice, + bindInfoCount: u32, + pBindInfos: *const VkBindImageMemoryInfoKHX, + ) -> VkResult; } extern "C" { - pub fn vkCmdSetDeviceMaskKHX(commandBuffer: VkCommandBuffer, - deviceMask: u32); + pub fn vkCmdSetDeviceMaskKHX(commandBuffer: VkCommandBuffer, deviceMask: u32); } extern "C" { - pub fn vkGetDeviceGroupPresentCapabilitiesKHX(device: VkDevice, - pDeviceGroupPresentCapabilities: - *mut VkDeviceGroupPresentCapabilitiesKHX) - -> VkResult; + pub fn vkGetDeviceGroupPresentCapabilitiesKHX( + device: VkDevice, + pDeviceGroupPresentCapabilities: *mut VkDeviceGroupPresentCapabilitiesKHX, + ) -> VkResult; } extern "C" { - pub fn vkGetDeviceGroupSurfacePresentModesKHX(device: VkDevice, - surface: VkSurfaceKHR, - pModes: - *mut VkDeviceGroupPresentModeFlagsKHX) - -> VkResult; + pub fn vkGetDeviceGroupSurfacePresentModesKHX( + device: VkDevice, + surface: VkSurfaceKHR, + pModes: *mut VkDeviceGroupPresentModeFlagsKHX, + ) -> VkResult; } extern "C" { - pub fn vkAcquireNextImage2KHX(device: VkDevice, - pAcquireInfo: - *const VkAcquireNextImageInfoKHX, - pImageIndex: *mut u32) -> VkResult; + pub fn vkAcquireNextImage2KHX( + device: VkDevice, + pAcquireInfo: *const VkAcquireNextImageInfoKHX, + pImageIndex: *mut u32, + ) -> VkResult; } extern "C" { - pub fn vkCmdDispatchBaseKHX(commandBuffer: VkCommandBuffer, - baseGroupX: u32, baseGroupY: u32, - baseGroupZ: u32, groupCountX: u32, - groupCountY: u32, groupCountZ: u32); + pub fn vkCmdDispatchBaseKHX( + commandBuffer: VkCommandBuffer, + baseGroupX: u32, + baseGroupY: u32, + baseGroupZ: u32, + groupCountX: u32, + groupCountY: u32, + groupCountZ: u32, + ); } extern "C" { - pub fn vkGetPhysicalDevicePresentRectanglesKHX(physicalDevice: - VkPhysicalDevice, - surface: VkSurfaceKHR, - pRectCount: *mut u32, - pRects: *mut VkRect2D) - -> VkResult; + pub fn vkGetPhysicalDevicePresentRectanglesKHX( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pRectCount: *mut u32, + pRects: *mut VkRect2D, + ) -> VkResult; } -pub const VkValidationCheckEXT_VK_VALIDATION_CHECK_BEGIN_RANGE_EXT: - VkValidationCheckEXT = +pub const VkValidationCheckEXT_VK_VALIDATION_CHECK_BEGIN_RANGE_EXT: VkValidationCheckEXT = VkValidationCheckEXT::VK_VALIDATION_CHECK_ALL_EXT; -pub const VkValidationCheckEXT_VK_VALIDATION_CHECK_END_RANGE_EXT: - VkValidationCheckEXT = +pub const VkValidationCheckEXT_VK_VALIDATION_CHECK_END_RANGE_EXT: VkValidationCheckEXT = VkValidationCheckEXT::VK_VALIDATION_CHECK_ALL_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5976,7 +6348,9 @@ pub struct VkValidationFlagsEXT { pub pDisabledValidationChecks: *mut VkValidationCheckEXT, } impl Clone for VkValidationFlagsEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5988,7 +6362,9 @@ pub struct VkPhysicalDeviceGroupPropertiesKHX { pub subsetAllocation: VkBool32, } impl Clone for VkPhysicalDeviceGroupPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -5999,22 +6375,23 @@ pub struct VkDeviceGroupDeviceCreateInfoKHX { pub pPhysicalDevices: *const VkPhysicalDevice, } impl Clone for VkDeviceGroupDeviceCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkEnumeratePhysicalDeviceGroupsKHX = - ::std::option::Option VkResult>; +pub type PFN_vkEnumeratePhysicalDeviceGroupsKHX = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pPhysicalDeviceGroupCount: *mut u32, + pPhysicalDeviceGroupProperties: *mut VkPhysicalDeviceGroupPropertiesKHX, + ) -> VkResult, +>; extern "C" { - pub fn vkEnumeratePhysicalDeviceGroupsKHX(instance: VkInstance, - pPhysicalDeviceGroupCount: - *mut u32, - pPhysicalDeviceGroupProperties: - *mut VkPhysicalDeviceGroupPropertiesKHX) - -> VkResult; + pub fn vkEnumeratePhysicalDeviceGroupsKHX( + instance: VkInstance, + pPhysicalDeviceGroupCount: *mut u32, + pPhysicalDeviceGroupProperties: *mut VkPhysicalDeviceGroupPropertiesKHX, + ) -> VkResult; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6046,7 +6423,9 @@ pub struct VkExternalMemoryPropertiesKHX { pub compatibleHandleTypes: VkExternalMemoryHandleTypeFlagsKHX, } impl Clone for VkExternalMemoryPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6056,7 +6435,9 @@ pub struct VkPhysicalDeviceExternalImageFormatInfoKHX { pub handleType: VkExternalMemoryHandleTypeFlagBitsKHX, } impl Clone for VkPhysicalDeviceExternalImageFormatInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6066,7 +6447,9 @@ pub struct VkExternalImageFormatPropertiesKHX { pub externalMemoryProperties: VkExternalMemoryPropertiesKHX, } impl Clone for VkExternalImageFormatPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6078,7 +6461,9 @@ pub struct VkPhysicalDeviceExternalBufferInfoKHX { pub handleType: VkExternalMemoryHandleTypeFlagBitsKHX, } impl Clone for VkPhysicalDeviceExternalBufferInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6088,7 +6473,9 @@ pub struct VkExternalBufferPropertiesKHX { pub externalMemoryProperties: VkExternalMemoryPropertiesKHX, } impl Clone for VkExternalBufferPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6101,7 +6488,9 @@ pub struct VkPhysicalDeviceIDPropertiesKHX { pub deviceLUIDValid: VkBool32, } impl Clone for VkPhysicalDeviceIDPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Copy)] @@ -6111,7 +6500,9 @@ pub struct VkPhysicalDeviceProperties2KHX { pub properties: VkPhysicalDeviceProperties, } impl Clone for VkPhysicalDeviceProperties2KHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6121,7 +6512,9 @@ pub struct VkImageFormatProperties2KHX { pub imageFormatProperties: VkImageFormatProperties, } impl Clone for VkImageFormatProperties2KHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6135,49 +6528,49 @@ pub struct VkPhysicalDeviceImageFormatInfo2KHX { pub flags: VkImageCreateFlags, } impl Clone for VkPhysicalDeviceImageFormatInfo2KHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceProperties2KHX = - ::std::option::Option; -pub type PFN_vkGetPhysicalDeviceImageFormatProperties2KHX = - ::std::option::Option VkResult>; +pub type PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pExternalBufferInfo: *const VkPhysicalDeviceExternalBufferInfoKHX, + pExternalBufferProperties: *mut VkExternalBufferPropertiesKHX, + ), +>; +pub type PFN_vkGetPhysicalDeviceProperties2KHX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties2KHX, + ), +>; +pub type PFN_vkGetPhysicalDeviceImageFormatProperties2KHX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pImageFormatInfo: *const VkPhysicalDeviceImageFormatInfo2KHX, + pImageFormatProperties: *mut VkImageFormatProperties2KHX, + ) -> VkResult, +>; extern "C" { - pub fn vkGetPhysicalDeviceExternalBufferPropertiesKHX(physicalDevice: - VkPhysicalDevice, - pExternalBufferInfo: - *const VkPhysicalDeviceExternalBufferInfoKHX, - pExternalBufferProperties: - *mut VkExternalBufferPropertiesKHX); + pub fn vkGetPhysicalDeviceExternalBufferPropertiesKHX( + physicalDevice: VkPhysicalDevice, + pExternalBufferInfo: *const VkPhysicalDeviceExternalBufferInfoKHX, + pExternalBufferProperties: *mut VkExternalBufferPropertiesKHX, + ); } extern "C" { - pub fn vkGetPhysicalDeviceProperties2KHX(physicalDevice: VkPhysicalDevice, - pProperties: - *mut VkPhysicalDeviceProperties2KHX); + pub fn vkGetPhysicalDeviceProperties2KHX( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties2KHX, + ); } extern "C" { - pub fn vkGetPhysicalDeviceImageFormatProperties2KHX(physicalDevice: - VkPhysicalDevice, - pImageFormatInfo: - *const VkPhysicalDeviceImageFormatInfo2KHX, - pImageFormatProperties: - *mut VkImageFormatProperties2KHX) - -> VkResult; + pub fn vkGetPhysicalDeviceImageFormatProperties2KHX( + physicalDevice: VkPhysicalDevice, + pImageFormatInfo: *const VkPhysicalDeviceImageFormatInfo2KHX, + pImageFormatProperties: *mut VkImageFormatProperties2KHX, + ) -> VkResult; } #[repr(C)] #[derive(Debug, Copy)] @@ -6187,7 +6580,9 @@ pub struct VkExternalMemoryImageCreateInfoKHX { pub handleTypes: VkExternalMemoryHandleTypeFlagsKHX, } impl Clone for VkExternalMemoryImageCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6197,7 +6592,9 @@ pub struct VkExternalMemoryBufferCreateInfoKHX { pub handleTypes: VkExternalMemoryHandleTypeFlagsKHX, } impl Clone for VkExternalMemoryBufferCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6207,7 +6604,9 @@ pub struct VkExportMemoryAllocateInfoKHX { pub handleTypes: VkExternalMemoryHandleTypeFlagsKHX, } impl Clone for VkExportMemoryAllocateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6218,7 +6617,9 @@ pub struct VkImportMemoryFdInfoKHX { pub fd: ::std::os::raw::c_int, } impl Clone for VkImportMemoryFdInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6228,37 +6629,41 @@ pub struct VkMemoryFdPropertiesKHX { pub memoryTypeBits: u32, } impl Clone for VkMemoryFdPropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetMemoryFdKHX = - ::std::option::Option VkResult>; -pub type PFN_vkGetMemoryFdPropertiesKHX = - ::std::option::Option VkResult>; +pub type PFN_vkGetMemoryFdKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + memory: VkDeviceMemory, + handleType: VkExternalMemoryHandleTypeFlagBitsKHX, + pFd: *mut ::std::os::raw::c_int, + ) -> VkResult, +>; +pub type PFN_vkGetMemoryFdPropertiesKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + handleType: VkExternalMemoryHandleTypeFlagBitsKHX, + fd: ::std::os::raw::c_int, + pMemoryFdProperties: *mut VkMemoryFdPropertiesKHX, + ) -> VkResult, +>; extern "C" { - pub fn vkGetMemoryFdKHX(device: VkDevice, memory: VkDeviceMemory, - handleType: VkExternalMemoryHandleTypeFlagBitsKHX, - pFd: *mut ::std::os::raw::c_int) -> VkResult; + pub fn vkGetMemoryFdKHX( + device: VkDevice, + memory: VkDeviceMemory, + handleType: VkExternalMemoryHandleTypeFlagBitsKHX, + pFd: *mut ::std::os::raw::c_int, + ) -> VkResult; } extern "C" { - pub fn vkGetMemoryFdPropertiesKHX(device: VkDevice, - handleType: - VkExternalMemoryHandleTypeFlagBitsKHX, - fd: ::std::os::raw::c_int, - pMemoryFdProperties: - *mut VkMemoryFdPropertiesKHX) - -> VkResult; + pub fn vkGetMemoryFdPropertiesKHX( + device: VkDevice, + handleType: VkExternalMemoryHandleTypeFlagBitsKHX, + fd: ::std::os::raw::c_int, + pMemoryFdProperties: *mut VkMemoryFdPropertiesKHX, + ) -> VkResult; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6287,7 +6692,9 @@ pub struct VkPhysicalDeviceExternalSemaphoreInfoKHX { pub handleType: VkExternalSemaphoreHandleTypeFlagBitsKHX, } impl Clone for VkPhysicalDeviceExternalSemaphoreInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6299,22 +6706,23 @@ pub struct VkExternalSemaphorePropertiesKHX { pub externalSemaphoreFeatures: VkExternalSemaphoreFeatureFlagsKHX, } impl Clone for VkExternalSemaphorePropertiesKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX = - ::std::option::Option; +pub type PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pExternalSemaphoreInfo: *const VkPhysicalDeviceExternalSemaphoreInfoKHX, + pExternalSemaphoreProperties: *mut VkExternalSemaphorePropertiesKHX, + ), +>; extern "C" { - pub fn vkGetPhysicalDeviceExternalSemaphorePropertiesKHX(physicalDevice: - VkPhysicalDevice, - pExternalSemaphoreInfo: - *const VkPhysicalDeviceExternalSemaphoreInfoKHX, - pExternalSemaphoreProperties: - *mut VkExternalSemaphorePropertiesKHX); + pub fn vkGetPhysicalDeviceExternalSemaphorePropertiesKHX( + physicalDevice: VkPhysicalDevice, + pExternalSemaphoreInfo: *const VkPhysicalDeviceExternalSemaphoreInfoKHX, + pExternalSemaphoreProperties: *mut VkExternalSemaphorePropertiesKHX, + ); } #[repr(C)] #[derive(Debug, Copy)] @@ -6324,7 +6732,9 @@ pub struct VkExportSemaphoreCreateInfoKHX { pub handleTypes: VkExternalSemaphoreHandleTypeFlagsKHX, } impl Clone for VkExportSemaphoreCreateInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6336,32 +6746,37 @@ pub struct VkImportSemaphoreFdInfoKHX { pub fd: ::std::os::raw::c_int, } impl Clone for VkImportSemaphoreFdInfoKHX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkImportSemaphoreFdKHX = - ::std::option::Option VkResult>; -pub type PFN_vkGetSemaphoreFdKHX = - ::std::option::Option VkResult>; +pub type PFN_vkImportSemaphoreFdKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pImportSemaphoreFdInfo: *const VkImportSemaphoreFdInfoKHX, + ) -> VkResult, +>; +pub type PFN_vkGetSemaphoreFdKHX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + semaphore: VkSemaphore, + handleType: VkExternalSemaphoreHandleTypeFlagBitsKHX, + pFd: *mut ::std::os::raw::c_int, + ) -> VkResult, +>; extern "C" { - pub fn vkImportSemaphoreFdKHX(device: VkDevice, - pImportSemaphoreFdInfo: - *const VkImportSemaphoreFdInfoKHX) - -> VkResult; + pub fn vkImportSemaphoreFdKHX( + device: VkDevice, + pImportSemaphoreFdInfo: *const VkImportSemaphoreFdInfoKHX, + ) -> VkResult; } extern "C" { - pub fn vkGetSemaphoreFdKHX(device: VkDevice, semaphore: VkSemaphore, - handleType: - VkExternalSemaphoreHandleTypeFlagBitsKHX, - pFd: *mut ::std::os::raw::c_int) -> VkResult; + pub fn vkGetSemaphoreFdKHX( + device: VkDevice, + semaphore: VkSemaphore, + handleType: VkExternalSemaphoreHandleTypeFlagBitsKHX, + pFd: *mut ::std::os::raw::c_int, + ) -> VkResult; } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6376,10 +6791,10 @@ pub struct VkIndirectCommandsLayoutNVX_T { } pub type VkIndirectCommandsLayoutNVX = *mut VkIndirectCommandsLayoutNVX_T; pub const VkIndirectCommandsTokenTypeNVX_VK_INDIRECT_COMMANDS_TOKEN_TYPE_BEGIN_RANGE_NVX: - VkIndirectCommandsTokenTypeNVX = + VkIndirectCommandsTokenTypeNVX = VkIndirectCommandsTokenTypeNVX::VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX; pub const VkIndirectCommandsTokenTypeNVX_VK_INDIRECT_COMMANDS_TOKEN_TYPE_END_RANGE_NVX: - VkIndirectCommandsTokenTypeNVX = + VkIndirectCommandsTokenTypeNVX = VkIndirectCommandsTokenTypeNVX::VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6395,11 +6810,9 @@ pub enum VkIndirectCommandsTokenTypeNVX { VK_INDIRECT_COMMANDS_TOKEN_TYPE_RANGE_SIZE_NVX = 8, VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NVX = 2147483647, } -pub const VkObjectEntryTypeNVX_VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX: - VkObjectEntryTypeNVX = +pub const VkObjectEntryTypeNVX_VK_OBJECT_ENTRY_TYPE_BEGIN_RANGE_NVX: VkObjectEntryTypeNVX = VkObjectEntryTypeNVX::VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX; -pub const VkObjectEntryTypeNVX_VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX: - VkObjectEntryTypeNVX = +pub const VkObjectEntryTypeNVX_VK_OBJECT_ENTRY_TYPE_END_RANGE_NVX: VkObjectEntryTypeNVX = VkObjectEntryTypeNVX::VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6438,7 +6851,9 @@ pub struct VkDeviceGeneratedCommandsFeaturesNVX { pub computeBindingPointSupport: VkBool32, } impl Clone for VkDeviceGeneratedCommandsFeaturesNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6452,7 +6867,9 @@ pub struct VkDeviceGeneratedCommandsLimitsNVX { pub minCommandsTokenBufferOffsetAlignment: u32, } impl Clone for VkDeviceGeneratedCommandsLimitsNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6462,7 +6879,9 @@ pub struct VkIndirectCommandsTokenNVX { pub offset: VkDeviceSize, } impl Clone for VkIndirectCommandsTokenNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6473,7 +6892,9 @@ pub struct VkIndirectCommandsLayoutTokenNVX { pub divisor: u32, } impl Clone for VkIndirectCommandsLayoutTokenNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6486,7 +6907,9 @@ pub struct VkIndirectCommandsLayoutCreateInfoNVX { pub pTokens: *const VkIndirectCommandsLayoutTokenNVX, } impl Clone for VkIndirectCommandsLayoutCreateInfoNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6505,7 +6928,9 @@ pub struct VkCmdProcessCommandsInfoNVX { pub sequencesIndexOffset: VkDeviceSize, } impl Clone for VkCmdProcessCommandsInfoNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6517,7 +6942,9 @@ pub struct VkCmdReserveSpaceForCommandsInfoNVX { pub maxSequencesCount: u32, } impl Clone for VkCmdReserveSpaceForCommandsInfoNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6535,7 +6962,9 @@ pub struct VkObjectTableCreateInfoNVX { pub maxPipelineLayouts: u32, } impl Clone for VkObjectTableCreateInfoNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6544,7 +6973,9 @@ pub struct VkObjectTableEntryNVX { pub flags: VkObjectEntryUsageFlagsNVX, } impl Clone for VkObjectTableEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6554,7 +6985,9 @@ pub struct VkObjectTablePipelineEntryNVX { pub pipeline: VkPipeline, } impl Clone for VkObjectTablePipelineEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6565,7 +6998,9 @@ pub struct VkObjectTableDescriptorSetEntryNVX { pub descriptorSet: VkDescriptorSet, } impl Clone for VkObjectTableDescriptorSetEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6575,7 +7010,9 @@ pub struct VkObjectTableVertexBufferEntryNVX { pub buffer: VkBuffer, } impl Clone for VkObjectTableVertexBufferEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6586,7 +7023,9 @@ pub struct VkObjectTableIndexBufferEntryNVX { pub indexType: VkIndexType, } impl Clone for VkObjectTableIndexBufferEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6597,68 +7036,77 @@ pub struct VkObjectTablePushConstantEntryNVX { pub stageFlags: VkShaderStageFlags, } impl Clone for VkObjectTablePushConstantEntryNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCmdProcessCommandsNVX = - ::std::option::Option; -pub type PFN_vkCmdReserveSpaceForCommandsNVX = - ::std::option::Option; -pub type PFN_vkCreateIndirectCommandsLayoutNVX = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyIndirectCommandsLayoutNVX = - ::std::option::Option; -pub type PFN_vkCreateObjectTableNVX = - ::std::option::Option VkResult>; -pub type PFN_vkDestroyObjectTableNVX = - ::std::option::Option; -pub type PFN_vkRegisterObjectsNVX = - ::std::option::Option VkResult>; -pub type PFN_vkUnregisterObjectsNVX = - ::std::option::Option VkResult>; -pub type PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = - ::std::option::Option; +pub type PFN_vkCmdProcessCommandsNVX = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pProcessCommandsInfo: *const VkCmdProcessCommandsInfoNVX, + ), +>; +pub type PFN_vkCmdReserveSpaceForCommandsNVX = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + pReserveSpaceInfo: *const VkCmdReserveSpaceForCommandsInfoNVX, + ), +>; +pub type PFN_vkCreateIndirectCommandsLayoutNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkIndirectCommandsLayoutCreateInfoNVX, + pAllocator: *const VkAllocationCallbacks, + pIndirectCommandsLayout: *mut VkIndirectCommandsLayoutNVX, + ) -> VkResult, +>; +pub type PFN_vkDestroyIndirectCommandsLayoutNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + indirectCommandsLayout: VkIndirectCommandsLayoutNVX, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkCreateObjectTableNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + pCreateInfo: *const VkObjectTableCreateInfoNVX, + pAllocator: *const VkAllocationCallbacks, + pObjectTable: *mut VkObjectTableNVX, + ) -> VkResult, +>; +pub type PFN_vkDestroyObjectTableNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + objectTable: VkObjectTableNVX, + pAllocator: *const VkAllocationCallbacks, + ), +>; +pub type PFN_vkRegisterObjectsNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + objectTable: VkObjectTableNVX, + objectCount: u32, + ppObjectTableEntries: *const *const VkObjectTableEntryNVX, + pObjectIndices: *const u32, + ) -> VkResult, +>; +pub type PFN_vkUnregisterObjectsNVX = ::std::option::Option< + unsafe extern "C" fn( + device: VkDevice, + objectTable: VkObjectTableNVX, + objectCount: u32, + pObjectEntryTypes: *const VkObjectEntryTypeNVX, + pObjectIndices: *const u32, + ) -> VkResult, +>; +pub type PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = ::std::option::Option< + unsafe extern "C" fn( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkDeviceGeneratedCommandsFeaturesNVX, + pLimits: *mut VkDeviceGeneratedCommandsLimitsNVX, + ), +>; #[repr(C)] #[derive(Debug, Copy)] pub struct VkViewportWScalingNV { @@ -6666,7 +7114,9 @@ pub struct VkViewportWScalingNV { pub ycoeff: f32, } impl Clone for VkViewportWScalingNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6678,20 +7128,22 @@ pub struct VkPipelineViewportWScalingStateCreateInfoNV { pub pViewportWScalings: *const VkViewportWScalingNV, } impl Clone for VkPipelineViewportWScalingStateCreateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCmdSetViewportWScalingNV = - ::std::option::Option; +pub type PFN_vkCmdSetViewportWScalingNV = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + firstViewport: u32, + viewportCount: u32, + pViewportWScalings: *const VkViewportWScalingNV, + ), +>; -pub type PFN_vkReleaseDisplayEXT = - ::std::option::Option VkResult>; +pub type PFN_vkReleaseDisplayEXT = ::std::option::Option< + unsafe extern "C" fn(physicalDevice: VkPhysicalDevice, display: VkDisplayKHR) -> VkResult, +>; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkSurfaceCounterFlagBitsEXT { @@ -6717,13 +7169,13 @@ pub struct VkSurfaceCapabilities2EXT { pub supportedSurfaceCounters: VkSurfaceCounterFlagsEXT, } impl Clone for VkSurfaceCapabilities2EXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub const VkDisplayPowerStateEXT_VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT: - VkDisplayPowerStateEXT = +pub const VkDisplayPowerStateEXT_VK_DISPLAY_POWER_STATE_BEGIN_RANGE_EXT: VkDisplayPowerStateEXT = VkDisplayPowerStateEXT::VK_DISPLAY_POWER_STATE_OFF_EXT; -pub const VkDisplayPowerStateEXT_VK_DISPLAY_POWER_STATE_END_RANGE_EXT: - VkDisplayPowerStateEXT = +pub const VkDisplayPowerStateEXT_VK_DISPLAY_POWER_STATE_END_RANGE_EXT: VkDisplayPowerStateEXT = VkDisplayPowerStateEXT::VK_DISPLAY_POWER_STATE_ON_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6734,11 +7186,9 @@ pub enum VkDisplayPowerStateEXT { VK_DISPLAY_POWER_STATE_RANGE_SIZE_EXT = 3, VK_DISPLAY_POWER_STATE_MAX_ENUM_EXT = 2147483647, } -pub const VkDeviceEventTypeEXT_VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT: - VkDeviceEventTypeEXT = +pub const VkDeviceEventTypeEXT_VK_DEVICE_EVENT_TYPE_BEGIN_RANGE_EXT: VkDeviceEventTypeEXT = VkDeviceEventTypeEXT::VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT; -pub const VkDeviceEventTypeEXT_VK_DEVICE_EVENT_TYPE_END_RANGE_EXT: - VkDeviceEventTypeEXT = +pub const VkDeviceEventTypeEXT_VK_DEVICE_EVENT_TYPE_END_RANGE_EXT: VkDeviceEventTypeEXT = VkDeviceEventTypeEXT::VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6747,11 +7197,9 @@ pub enum VkDeviceEventTypeEXT { VK_DEVICE_EVENT_TYPE_RANGE_SIZE_EXT = 1, VK_DEVICE_EVENT_TYPE_MAX_ENUM_EXT = 2147483647, } -pub const VkDisplayEventTypeEXT_VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT: - VkDisplayEventTypeEXT = +pub const VkDisplayEventTypeEXT_VK_DISPLAY_EVENT_TYPE_BEGIN_RANGE_EXT: VkDisplayEventTypeEXT = VkDisplayEventTypeEXT::VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT; -pub const VkDisplayEventTypeEXT_VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT: - VkDisplayEventTypeEXT = +pub const VkDisplayEventTypeEXT_VK_DISPLAY_EVENT_TYPE_END_RANGE_EXT: VkDisplayEventTypeEXT = VkDisplayEventTypeEXT::VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6768,7 +7216,9 @@ pub struct VkDisplayPowerInfoEXT { pub powerState: VkDisplayPowerStateEXT, } impl Clone for VkDisplayPowerInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6778,7 +7228,9 @@ pub struct VkDeviceEventInfoEXT { pub deviceEvent: VkDeviceEventTypeEXT, } impl Clone for VkDeviceEventInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6788,7 +7240,9 @@ pub struct VkDisplayEventInfoEXT { pub displayEvent: VkDisplayEventTypeEXT, } impl Clone for VkDisplayEventInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6798,7 +7252,9 @@ pub struct VkSwapchainCounterCreateInfoEXT { pub surfaceCounters: VkSurfaceCounterFlagsEXT, } impl Clone for VkSwapchainCounterCreateInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] @@ -6809,13 +7265,15 @@ pub struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { pub perViewPositionAllComponents: VkBool32, } impl Clone for VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub const VkViewportCoordinateSwizzleNV_VK_VIEWPORT_COORDINATE_SWIZZLE_BEGIN_RANGE_NV: - VkViewportCoordinateSwizzleNV = + VkViewportCoordinateSwizzleNV = VkViewportCoordinateSwizzleNV::VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV; pub const VkViewportCoordinateSwizzleNV_VK_VIEWPORT_COORDINATE_SWIZZLE_END_RANGE_NV: - VkViewportCoordinateSwizzleNV = + VkViewportCoordinateSwizzleNV = VkViewportCoordinateSwizzleNV::VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6841,7 +7299,9 @@ pub struct VkViewportSwizzleNV { pub w: VkViewportCoordinateSwizzleNV, } impl Clone for VkViewportSwizzleNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6853,14 +7313,14 @@ pub struct VkPipelineViewportSwizzleStateCreateInfoNV { pub pViewportSwizzles: *const VkViewportSwizzleNV, } impl Clone for VkPipelineViewportSwizzleStateCreateInfoNV { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } pub const VkDiscardRectangleModeEXT_VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT: - VkDiscardRectangleModeEXT = - VkDiscardRectangleModeEXT::VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT; + VkDiscardRectangleModeEXT = VkDiscardRectangleModeEXT::VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT; pub const VkDiscardRectangleModeEXT_VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT: - VkDiscardRectangleModeEXT = - VkDiscardRectangleModeEXT::VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT; + VkDiscardRectangleModeEXT = VkDiscardRectangleModeEXT::VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum VkDiscardRectangleModeEXT { @@ -6878,7 +7338,9 @@ pub struct VkPhysicalDeviceDiscardRectanglePropertiesEXT { pub maxDiscardRectangles: u32, } impl Clone for VkPhysicalDeviceDiscardRectanglePropertiesEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6891,57 +7353,69 @@ pub struct VkPipelineDiscardRectangleStateCreateInfoEXT { pub pDiscardRectangles: *const VkRect2D, } impl Clone for VkPipelineDiscardRectangleStateCreateInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } -pub type PFN_vkCmdSetDiscardRectangleEXT = - ::std::option::Option; +pub type PFN_vkCmdSetDiscardRectangleEXT = ::std::option::Option< + unsafe extern "C" fn( + commandBuffer: VkCommandBuffer, + firstDiscardRectangle: u32, + discardRectangleCount: u32, + pDiscardRectangles: *const VkRect2D, + ), +>; -pub type PFN_vkCreateInstance = ::std::option::Option VkResult>; +pub type PFN_vkCreateInstance = ::std::option::Option< + unsafe extern "C" fn( + pCreateInfo: *const VkInstanceCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pInstance: *mut VkInstance, + ) -> VkResult, +>; -pub type PFN_vkEnumeratePhysicalDevices = ::std::option::Option VkResult>; +pub type PFN_vkEnumeratePhysicalDevices = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pPhysicalDeviceCount: *mut u32, + pPhysicalDevices: *mut VkPhysicalDevice, + ) -> VkResult, +>; -pub type PFN_vkDestroyInstance = ::std::option::Option; +pub type PFN_vkDestroyInstance = ::std::option::Option< + unsafe extern "C" fn(instance: VkInstance, pAllocator: *const VkAllocationCallbacks), +>; -pub type PFN_vkCreateWin32SurfaceKHR = ::std::option::Option VkResult>; +pub type PFN_vkCreateWin32SurfaceKHR = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pCreateInfo: *const VkWin32SurfaceCreateInfoKHR, + pAllocator: *const VkAllocationCallbacks, + pSurface: *mut VkSurfaceKHR, + ) -> VkResult, +>; -pub type PFN_vkCreateMetalSurfaceEXT = ::std::option::Option VkResult>; +pub type PFN_vkCreateMetalSurfaceEXT = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pCreateInfo: *const VkMetalSurfaceCreateInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pSurface: *mut VkSurfaceKHR, + ) -> VkResult, +>; -pub type PFN_vkCreateMacOSSurfaceMVK = ::std::option::Option VkResult>; +pub type PFN_vkCreateMacOSSurfaceMVK = ::std::option::Option< + unsafe extern "C" fn( + instance: VkInstance, + pCreateInfo: *const VkMacOSSurfaceCreateInfoMVK, + pAllocator: *const VkAllocationCallbacks, + pSurface: *mut VkSurfaceKHR, + ) -> VkResult, +>; -pub type PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = ::std::option::Option VkBool32>; +pub type PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = ::std::option::Option< + unsafe extern "C" fn(physicalDevice: VkPhysicalDevice, queueFamilyIndex: u32) -> VkBool32, +>; #[repr(C)] #[derive(Debug, Copy)] @@ -6955,7 +7429,9 @@ pub struct VkPhysicalDevicePortabilitySubsetFeaturesEXTX { pub samplerMipLodBias: VkBool32, } impl Clone for VkPhysicalDevicePortabilitySubsetFeaturesEXTX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6965,7 +7441,9 @@ pub struct VkPhysicalDevicePortabilitySubsetPropertiesEXTX { pub minVertexInputBindingStrideAlignment: u32, } impl Clone for VkPhysicalDevicePortabilitySubsetPropertiesEXTX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6979,7 +7457,9 @@ pub struct VkPhysicalDeviceImageViewSupportEXTX { pub aspectMask: VkImageAspectFlags, } impl Clone for VkPhysicalDeviceImageViewSupportEXTX { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } #[repr(C)] #[derive(Debug, Copy)] @@ -6990,5 +7470,7 @@ pub struct VkMetalSurfaceCreateInfoEXT { pub pLayer: *const ::std::os::raw::c_void, } impl Clone for VkMetalSurfaceCreateInfoEXT { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { + *self + } } diff --git a/libportability-icd/src/lib.rs b/libportability-icd/src/lib.rs index 6a40578..b1e8bb8 100644 --- a/libportability-icd/src/lib.rs +++ b/libportability-icd/src/lib.rs @@ -7,7 +7,6 @@ use portability_gfx::*; use std::ffi::CStr; use std::mem; - const ICD_VERSION: u32 = 5; #[no_mangle] @@ -41,7 +40,7 @@ pub extern "C" fn vk_icdGetPhysicalDeviceProcAddr( Err(_) => return None, }; - proc_addr!{ name, + proc_addr! { name, vkGetPhysicalDeviceFeatures, PFN_vkGetPhysicalDeviceFeatures => gfxGetPhysicalDeviceFeatures, vkGetPhysicalDeviceFeatures2KHR, PFN_vkGetPhysicalDeviceFeatures2KHR => gfxGetPhysicalDeviceFeatures2KHR, vkGetPhysicalDeviceProperties, PFN_vkGetPhysicalDeviceProperties => gfxGetPhysicalDeviceProperties, diff --git a/libportability/src/lib.rs b/libportability/src/lib.rs index 9af511e..93f94dd 100644 --- a/libportability/src/lib.rs +++ b/libportability/src/lib.rs @@ -638,14 +638,7 @@ pub extern "C" fn vkGetQueryPoolResults( flags: VkQueryResultFlags, ) -> VkResult { gfxGetQueryPoolResults( - device, - queryPool, - firstQuery, - queryCount, - dataSize, - pData, - stride, - flags, + device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags, ) } #[no_mangle] @@ -1078,7 +1071,13 @@ pub extern "C" fn vkCmdDraw( firstVertex: u32, firstInstance: u32, ) { - gfxCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance) + gfxCmdDraw( + commandBuffer, + vertexCount, + instanceCount, + firstVertex, + firstInstance, + ) } #[no_mangle] pub extern "C" fn vkCmdDrawIndexed( @@ -1231,13 +1230,7 @@ pub extern "C" fn vkCmdUpdateBuffer( dataSize: VkDeviceSize, pData: *const ::std::os::raw::c_void, ) { - gfxCmdUpdateBuffer( - commandBuffer, - dstBuffer, - dstOffset, - dataSize, - pData, - ) + gfxCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData) } #[no_mangle] pub extern "C" fn vkCmdFillBuffer( @@ -1327,11 +1320,7 @@ pub extern "C" fn vkCmdSetEvent( event: VkEvent, stageMask: VkPipelineStageFlags, ) { - gfxCmdSetEvent( - commandBuffer, - event, - stageMask, - ) + gfxCmdSetEvent(commandBuffer, event, stageMask) } #[no_mangle] pub extern "C" fn vkCmdResetEvent( @@ -1339,11 +1328,7 @@ pub extern "C" fn vkCmdResetEvent( event: VkEvent, stageMask: VkPipelineStageFlags, ) { - gfxCmdResetEvent( - commandBuffer, - event, - stageMask, - ) + gfxCmdResetEvent(commandBuffer, event, stageMask) } #[no_mangle] pub extern "C" fn vkCmdWaitEvents( @@ -1500,14 +1485,7 @@ pub extern "C" fn vkAcquireNextImageKHR( fence: VkFence, pImageIndex: *mut u32, ) -> VkResult { - gfxAcquireNextImageKHR( - device, - swapchain, - timeout, - semaphore, - fence, - pImageIndex, - ) + gfxAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex) } #[no_mangle] pub extern "C" fn vkQueuePresentKHR(