diff --git a/libportability-gfx/src/conv.rs b/libportability-gfx/src/conv.rs index 26b3c08..bb82f4e 100644 --- a/libportability-gfx/src/conv.rs +++ b/libportability-gfx/src/conv.rs @@ -1,4 +1,3 @@ - use hal::{adapter, buffer, format, image, memory, window}; use std::mem; @@ -117,8 +116,10 @@ fn map_swizzle_component( pub fn map_subresource_range(subresource: VkImageSubresourceRange) -> image::SubresourceRange { image::SubresourceRange { aspects: map_aspect(subresource.aspectMask), - levels: subresource.baseMipLevel as _ .. (subresource.baseMipLevel+subresource.levelCount) as _, - layers: subresource.baseArrayLayer as _ .. (subresource.baseArrayLayer+subresource.layerCount) as _, + levels: subresource.baseMipLevel as _ + ..(subresource.baseMipLevel + subresource.levelCount) as _, + layers: subresource.baseArrayLayer as _ + ..(subresource.baseArrayLayer + subresource.layerCount) as _, } } @@ -151,12 +152,8 @@ pub fn map_image_kind( assert!(!is_cube || array_layers % 6 == 0); match ty { - VkImageType::VK_IMAGE_TYPE_1D => { - image::Kind::D1(extent.width as _) - } - VkImageType::VK_IMAGE_TYPE_1D => { - image::Kind::D1Array(extent.width as _, array_layers as _) - } + VkImageType::VK_IMAGE_TYPE_1D => image::Kind::D1(extent.width as _), + VkImageType::VK_IMAGE_TYPE_1D => image::Kind::D1Array(extent.width as _, array_layers as _), VkImageType::VK_IMAGE_TYPE_2D if array_layers == 1 => { image::Kind::D2(extent.width as _, extent.height as _, map_aa_mode(samples)) } @@ -166,14 +163,12 @@ pub fn map_image_kind( VkImageType::VK_IMAGE_TYPE_2D if is_cube => { image::Kind::CubeArray(extent.width as _, (array_layers / 6) as _) } - VkImageType::VK_IMAGE_TYPE_2D => { - image::Kind::D2Array( - extent.width as _, - extent.height as _, - array_layers as _, - map_aa_mode(samples), - ) - } + VkImageType::VK_IMAGE_TYPE_2D => image::Kind::D2Array( + extent.width as _, + extent.height as _, + array_layers as _, + map_aa_mode(samples), + ), VkImageType::VK_IMAGE_TYPE_3D => { image::Kind::D3(extent.width as _, extent.height as _, extent.depth as _) } diff --git a/libportability-gfx/src/handle.rs b/libportability-gfx/src/handle.rs index d2fa56f..b38bb79 100644 --- a/libportability-gfx/src/handle.rs +++ b/libportability-gfx/src/handle.rs @@ -1,7 +1,6 @@ use VK_NULL_HANDLE; use std::{fmt, ops}; - #[repr(C)] pub struct Handle(*mut T); @@ -31,7 +30,7 @@ impl Copy for Handle {} impl ops::Deref for Handle { type Target = T; fn deref(&self) -> &T { - unsafe { & *self.0 } + unsafe { &*self.0 } } } diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index fca7c46..e728807 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -1,4 +1,3 @@ - use hal::{Device, Instance, PhysicalDevice, QueueFamily, Surface}; use std::mem; @@ -7,7 +6,7 @@ use std::ops::Deref; use super::*; #[inline] -pub extern fn gfxCreateInstance( +pub extern "C" fn gfxCreateInstance( _pCreateInfo: *const VkInstanceCreateInfo, _pAllocator: *const VkAllocationCallbacks, pInstance: *mut VkInstance, @@ -18,7 +17,7 @@ pub extern fn gfxCreateInstance( } #[inline] -pub extern fn gfxDestroyInstance( +pub extern "C" fn gfxDestroyInstance( instance: VkInstance, _pAllocator: *const VkAllocationCallbacks, ) { @@ -27,7 +26,7 @@ pub extern fn gfxDestroyInstance( } #[inline] -pub extern fn gfxEnumeratePhysicalDevices( +pub extern "C" fn gfxEnumeratePhysicalDevices( instance: VkInstance, pPhysicalDeviceCount: *mut u32, pPhysicalDevices: *mut VkPhysicalDevice, @@ -45,7 +44,7 @@ pub extern fn gfxEnumeratePhysicalDevices( } #[inline] -pub extern fn gfxGetPhysicalDeviceQueueFamilyProperties( +pub extern "C" fn gfxGetPhysicalDeviceQueueFamilyProperties( adapter: VkPhysicalDevice, pQueueFamilyPropertyCount: *mut u32, pQueueFamilyProperties: *mut VkQueueFamilyProperties, @@ -60,25 +59,34 @@ pub extern fn gfxGetPhysicalDeviceQueueFamilyProperties( for (ref mut out, ref family) in output.iter_mut().zip(families.iter()) { **out = VkQueueFamilyProperties { queueFlags: match family.queue_type() { - hal::QueueType::General => VkQueueFlagBits::VK_QUEUE_GRAPHICS_BIT as u32 | VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32, + hal::QueueType::General => { + VkQueueFlagBits::VK_QUEUE_GRAPHICS_BIT as u32 + | VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32 + } hal::QueueType::Graphics => VkQueueFlagBits::VK_QUEUE_GRAPHICS_BIT as u32, hal::QueueType::Compute => VkQueueFlagBits::VK_QUEUE_COMPUTE_BIT as u32, hal::QueueType::Transfer => VkQueueFlagBits::VK_QUEUE_TRANSFER_BIT as u32, }, queueCount: family.max_queues() as _, timestampValidBits: 0, //TODO - minImageTransferGranularity: VkExtent3D { width: 0, height: 0, depth: 0 }, //TODO + minImageTransferGranularity: VkExtent3D { + width: 0, + height: 0, + depth: 0, + }, //TODO } } } -extern "C" { - pub fn vkGetPhysicalDeviceFeatures(physicalDevice: VkPhysicalDevice, - pFeatures: - *mut VkPhysicalDeviceFeatures); +#[inline] +pub extern "C" fn gfxGetPhysicalDeviceFeatures( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkPhysicalDeviceFeatures, +) { + unimplemented!() } #[inline] -pub extern fn gfxGetPhysicalDeviceFormatProperties( +pub extern "C" fn gfxGetPhysicalDeviceFormatProperties( adapter: VkPhysicalDevice, format: VkFormat, pFormatProperties: *mut VkFormatProperties, @@ -89,27 +97,31 @@ pub extern fn gfxGetPhysicalDeviceFormatProperties( }; let properties = adapter.physical_device.format_properties(format); - unsafe { *pFormatProperties = conv::format_properties_from_hal(properties); } -} -extern "C" { - pub fn vkGetPhysicalDeviceImageFormatProperties(physicalDevice: - VkPhysicalDevice, - format: VkFormat, - type_: VkImageType, - tiling: VkImageTiling, - usage: VkImageUsageFlags, - flags: VkImageCreateFlags, - pImageFormatProperties: - *mut VkImageFormatProperties) - -> VkResult; -} -extern "C" { - pub fn vkGetPhysicalDeviceProperties(physicalDevice: VkPhysicalDevice, - pProperties: - *mut VkPhysicalDeviceProperties); + unsafe { + *pFormatProperties = conv::format_properties_from_hal(properties); + } } #[inline] -pub extern fn gfxGetPhysicalDeviceMemoryProperties( +pub extern "C" fn gfxGetPhysicalDeviceImageFormatProperties( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + tiling: VkImageTiling, + usage: VkImageUsageFlags, + flags: VkImageCreateFlags, + pImageFormatProperties: *mut VkImageFormatProperties, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetPhysicalDeviceProperties( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetPhysicalDeviceMemoryProperties( adapter: VkPhysicalDevice, pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties, ) { @@ -135,19 +147,24 @@ pub extern fn gfxGetPhysicalDeviceMemoryProperties( }; } } -extern "C" { - pub fn vkGetInstanceProcAddr(instance: VkInstance, - pName: *const ::std::os::raw::c_char) - -> PFN_vkVoidFunction; -} -extern "C" { - pub fn vkGetDeviceProcAddr(device: VkDevice, - pName: *const ::std::os::raw::c_char) - -> PFN_vkVoidFunction; +#[inline] +pub extern "C" fn gfxGetInstanceProcAddr( + instance: VkInstance, + pName: *const ::std::os::raw::c_char, +) -> PFN_vkVoidFunction { + unimplemented!() } #[inline] -pub extern fn gfxCreateDevice( +pub extern "C" fn gfxGetDeviceProcAddr( + device: VkDevice, + pName: *const ::std::os::raw::c_char, +) -> PFN_vkVoidFunction { + unimplemented!() +} + +#[inline] +pub extern "C" fn gfxCreateDevice( adapter: VkPhysicalDevice, pCreateInfo: *const VkDeviceCreateInfo, _pAllocator: *const VkAllocationCallbacks, @@ -155,20 +172,26 @@ pub extern fn gfxCreateDevice( ) -> VkResult { let dev_info = unsafe { &*pCreateInfo }; let queue_infos = unsafe { - slice::from_raw_parts(dev_info.pQueueCreateInfos, dev_info.queueCreateInfoCount as _) + slice::from_raw_parts( + dev_info.pQueueCreateInfos, + dev_info.queueCreateInfoCount as _, + ) }; - let request_infos = queue_infos.iter().map(|info| { - let family = adapter - .queue_families[info.queueFamilyIndex as usize] - .clone(); - (family, vec![1.0; info.queueCount as usize]) - }).collect::>(); + let request_infos = queue_infos + .iter() + .map(|info| { + let family = adapter.queue_families[info.queueFamilyIndex as usize].clone(); + (family, vec![1.0; info.queueCount as usize]) + }) + .collect::>(); let gpu = adapter.physical_device.open(request_infos); match gpu { Ok(device) => { - unsafe { *pDevice = Handle::new(device); } + unsafe { + *pDevice = Handle::new(device); + } VkResult::VK_SUCCESS } Err(err) => conv::map_err_device_creation(err), @@ -176,10 +199,7 @@ pub extern fn gfxCreateDevice( } #[inline] -pub extern fn gfxDestroyDevice( - device: VkDevice, - _pAllocator: *const VkAllocationCallbacks, -) { +pub extern "C" fn gfxDestroyDevice(device: VkDevice, _pAllocator: *const VkAllocationCallbacks) { let _ = device.unwrap(); //TODO? } @@ -203,7 +223,7 @@ lazy_static! { } #[inline] -pub extern fn gfxEnumerateInstanceExtensionProperties( +pub extern "C" fn gfxEnumerateInstanceExtensionProperties( pLayerName: *const ::std::os::raw::c_char, pPropertyCount: *mut u32, pProperties: *mut VkExtensionProperties, @@ -217,7 +237,8 @@ pub extern fn gfxEnumerateInstanceExtensionProperties( if *property_count > num_extensions { *property_count = num_extensions; } - let properties = unsafe { slice::from_raw_parts_mut(pProperties, *property_count as usize) }; + let properties = + unsafe { slice::from_raw_parts_mut(pProperties, *property_count as usize) }; for i in 0..*property_count as usize { properties[i] = INSTANCE_EXTENSIONS[i]; } @@ -230,65 +251,78 @@ pub extern fn gfxEnumerateInstanceExtensionProperties( VkResult::VK_SUCCESS } -extern "C" { - pub fn vkEnumerateDeviceExtensionProperties(physicalDevice: - VkPhysicalDevice, - pLayerName: - *const ::std::os::raw::c_char, - pPropertyCount: *mut u32, - pProperties: - *mut VkExtensionProperties) - -> VkResult; -} -extern "C" { - pub fn vkEnumerateInstanceLayerProperties(pPropertyCount: *mut u32, - pProperties: - *mut VkLayerProperties) - -> VkResult; -} -extern "C" { - pub fn vkEnumerateDeviceLayerProperties(physicalDevice: VkPhysicalDevice, - pPropertyCount: *mut u32, - pProperties: - *mut VkLayerProperties) - -> VkResult; -} -extern "C" { - pub fn vkGetDeviceQueue(device: VkDevice, queueFamilyIndex: u32, - queueIndex: u32, pQueue: *mut VkQueue); -} -extern "C" { - pub fn vkQueueSubmit(queue: VkQueue, submitCount: u32, - pSubmits: *const VkSubmitInfo, fence: VkFence) - -> VkResult; -} -extern "C" { - pub fn vkQueueWaitIdle(queue: VkQueue) -> VkResult; -} -extern "C" { - pub fn vkDeviceWaitIdle(device: VkDevice) -> VkResult; +#[inline] +pub extern "C" fn gfxEnumerateDeviceExtensionProperties( + physicalDevice: VkPhysicalDevice, + pLayerName: *const ::std::os::raw::c_char, + pPropertyCount: *mut u32, + pProperties: *mut VkExtensionProperties, +) -> VkResult { + unimplemented!() } #[inline] -pub extern fn gfxAllocateMemory( +pub extern "C" fn gfxEnumerateInstanceLayerProperties( + pPropertyCount: *mut u32, + pProperties: *mut VkLayerProperties, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxEnumerateDeviceLayerProperties( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkLayerProperties, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetDeviceQueue( + device: VkDevice, + queueFamilyIndex: u32, + queueIndex: u32, + pQueue: *mut VkQueue, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxQueueSubmit( + queue: VkQueue, + submitCount: u32, + pSubmits: *const VkSubmitInfo, + fence: VkFence, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxQueueWaitIdle(queue: VkQueue) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxDeviceWaitIdle(device: VkDevice) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxAllocateMemory( gpu: VkDevice, pAllocateInfo: *const VkMemoryAllocateInfo, _pAllocator: *const VkAllocationCallbacks, pMemory: *mut VkDeviceMemory, ) -> VkResult { let info = unsafe { &*pAllocateInfo }; - let memory = gpu - .device + let memory = gpu.device .allocate_memory( hal::MemoryTypeId(info.memoryTypeIndex as _), info.allocationSize, ) .unwrap(); // TODO: - unsafe { *pMemory = Handle::new(memory); } + unsafe { + *pMemory = Handle::new(memory); + } VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxFreeMemory( +pub extern "C" fn gfxFreeMemory( gpu: VkDevice, memory: VkDeviceMemory, pAllocator: *const VkAllocationCallbacks, @@ -296,7 +330,7 @@ pub extern fn gfxFreeMemory( gpu.device.free_memory(*memory.unwrap()); } #[inline] -pub extern fn gfxMapMemory( +pub extern "C" fn gfxMapMemory( gpu: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, @@ -309,39 +343,43 @@ pub extern fn gfxMapMemory( } unsafe { - *ppData = gpu - .device - .map_memory(&memory, offset..offset+size) + *ppData = gpu.device + .map_memory(&memory, offset..offset + size) .unwrap() as *mut _; // TODO } VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxUnmapMemory(gpu: VkDevice, memory: VkDeviceMemory) { +pub extern "C" fn gfxUnmapMemory(gpu: VkDevice, memory: VkDeviceMemory) { gpu.device.unmap_memory(&memory); } -extern "C" { - pub fn vkFlushMappedMemoryRanges(device: VkDevice, memoryRangeCount: u32, - pMemoryRanges: - *const VkMappedMemoryRange) - -> VkResult; -} -extern "C" { - pub fn vkInvalidateMappedMemoryRanges(device: VkDevice, - memoryRangeCount: u32, - pMemoryRanges: - *const VkMappedMemoryRange) - -> VkResult; -} -extern "C" { - pub fn vkGetDeviceMemoryCommitment(device: VkDevice, - memory: VkDeviceMemory, - pCommittedMemoryInBytes: - *mut VkDeviceSize); +#[inline] +pub extern "C" fn gfxFlushMappedMemoryRanges( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, +) -> VkResult { + unimplemented!() } #[inline] -pub extern fn gfxBindBufferMemory( +pub extern "C" fn gfxInvalidateMappedMemoryRanges( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetDeviceMemoryCommitment( + device: VkDevice, + memory: VkDeviceMemory, + pCommittedMemoryInBytes: *mut VkDeviceSize, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxBindBufferMemory( gpu: VkDevice, mut buffer: VkBuffer, memory: VkDeviceMemory, @@ -351,11 +389,9 @@ pub extern fn gfxBindBufferMemory( Buffer::Buffer(_) => panic!("An Buffer can only be bound once!"), Buffer::Unbound(unbound) => { Buffer::Buffer( - gpu.device.bind_buffer_memory( - &memory, - memoryOffset, - unbound, - ).unwrap() // TODO + gpu.device + .bind_buffer_memory(&memory, memoryOffset, unbound) + .unwrap(), // TODO ) } }; @@ -363,7 +399,7 @@ pub extern fn gfxBindBufferMemory( VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxBindImageMemory( +pub extern "C" fn gfxBindImageMemory( gpu: VkDevice, mut image: VkImage, memory: VkDeviceMemory, @@ -373,11 +409,9 @@ pub extern fn gfxBindImageMemory( Image::Image(_) => panic!("An Image can only be bound once!"), Image::Unbound(unbound) => { Image::Image( - gpu.device.bind_image_memory( - &memory, - memoryOffset, - unbound, - ).unwrap() // TODO + gpu.device + .bind_image_memory(&memory, memoryOffset, unbound) + .unwrap(), // TODO ) } }; @@ -385,16 +419,14 @@ pub extern fn gfxBindImageMemory( VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxGetBufferMemoryRequirements( +pub extern "C" fn gfxGetBufferMemoryRequirements( gpu: VkDevice, buffer: VkBuffer, pMemoryRequirements: *mut VkMemoryRequirements, ) { let req = match *buffer.deref() { Buffer::Buffer(ref buffer) => unimplemented!(), - Buffer::Unbound(ref buffer) => { - gpu.device.get_buffer_requirements(buffer) - } + Buffer::Unbound(ref buffer) => gpu.device.get_buffer_requirements(buffer), }; *unsafe { &mut *pMemoryRequirements } = VkMemoryRequirements { @@ -404,16 +436,14 @@ pub extern fn gfxGetBufferMemoryRequirements( }; } #[inline] -pub extern fn gfxGetImageMemoryRequirements( +pub extern "C" fn gfxGetImageMemoryRequirements( gpu: VkDevice, image: VkImage, pMemoryRequirements: *mut VkMemoryRequirements, ) { let req = match *image.deref() { Image::Image(ref image) => unimplemented!(), - Image::Unbound(ref image) => { - gpu.device.get_image_requirements(image) - } + Image::Unbound(ref image) => gpu.device.get_image_requirements(image), }; *unsafe { &mut *pMemoryRequirements } = VkMemoryRequirements { @@ -423,106 +453,154 @@ pub extern fn gfxGetImageMemoryRequirements( }; } -extern "C" { - pub fn vkGetImageSparseMemoryRequirements(device: VkDevice, - image: VkImage, - pSparseMemoryRequirementCount: - *mut u32, - pSparseMemoryRequirements: - *mut VkSparseImageMemoryRequirements); -} -extern "C" { - pub fn vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice: - VkPhysicalDevice, - format: VkFormat, - type_: VkImageType, - samples: - VkSampleCountFlagBits, - usage: - VkImageUsageFlags, - tiling: - VkImageTiling, - pPropertyCount: - *mut u32, - pProperties: - *mut VkSparseImageFormatProperties); -} -extern "C" { - pub fn vkQueueBindSparse(queue: VkQueue, bindInfoCount: u32, - pBindInfo: *const VkBindSparseInfo, - fence: VkFence) -> VkResult; -} -extern "C" { - pub fn vkCreateFence(device: VkDevice, - pCreateInfo: *const VkFenceCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pFence: *mut VkFence) -> VkResult; -} -extern "C" { - pub fn vkDestroyFence(device: VkDevice, fence: VkFence, - pAllocator: *const VkAllocationCallbacks); -} -extern "C" { - pub fn vkResetFences(device: VkDevice, fenceCount: u32, - pFences: *const VkFence) -> VkResult; -} -extern "C" { - pub fn vkGetFenceStatus(device: VkDevice, fence: VkFence) -> VkResult; -} -extern "C" { - pub fn vkWaitForFences(device: VkDevice, fenceCount: u32, - pFences: *const VkFence, waitAll: VkBool32, - timeout: u64) -> VkResult; -} -extern "C" { - pub fn vkCreateSemaphore(device: VkDevice, - pCreateInfo: *const VkSemaphoreCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pSemaphore: *mut VkSemaphore) -> VkResult; -} -extern "C" { - pub fn vkDestroySemaphore(device: VkDevice, semaphore: VkSemaphore, - pAllocator: *const VkAllocationCallbacks); -} -extern "C" { - pub fn vkCreateEvent(device: VkDevice, - pCreateInfo: *const VkEventCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pEvent: *mut VkEvent) -> VkResult; -} -extern "C" { - pub fn vkDestroyEvent(device: VkDevice, event: VkEvent, - pAllocator: *const VkAllocationCallbacks); -} -extern "C" { - pub fn vkGetEventStatus(device: VkDevice, event: VkEvent) -> VkResult; -} -extern "C" { - pub fn vkSetEvent(device: VkDevice, event: VkEvent) -> VkResult; -} -extern "C" { - pub fn vkResetEvent(device: VkDevice, event: VkEvent) -> VkResult; -} -extern "C" { - pub fn vkCreateQueryPool(device: VkDevice, - pCreateInfo: *const VkQueryPoolCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pQueryPool: *mut VkQueryPool) -> VkResult; -} -extern "C" { - pub fn vkDestroyQueryPool(device: VkDevice, queryPool: VkQueryPool, - pAllocator: *const VkAllocationCallbacks); -} -extern "C" { - pub fn vkGetQueryPoolResults(device: VkDevice, queryPool: VkQueryPool, - firstQuery: u32, queryCount: u32, - dataSize: usize, - pData: *mut ::std::os::raw::c_void, - stride: VkDeviceSize, - flags: VkQueryResultFlags) -> VkResult; +#[inline] +pub extern "C" fn gfxGetImageSparseMemoryRequirements( + device: VkDevice, + image: VkImage, + pSparseMemoryRequirementCount: *mut u32, + pSparseMemoryRequirements: *mut VkSparseImageMemoryRequirements, +) { + unimplemented!() } #[inline] -pub extern fn gfxCreateBuffer( +pub extern "C" fn gfxGetPhysicalDeviceSparseImageFormatProperties( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + samples: VkSampleCountFlagBits, + usage: VkImageUsageFlags, + tiling: VkImageTiling, + pPropertyCount: *mut u32, + pProperties: *mut VkSparseImageFormatProperties, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxQueueBindSparse( + queue: VkQueue, + bindInfoCount: u32, + pBindInfo: *const VkBindSparseInfo, + fence: VkFence, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateFence( + device: VkDevice, + pCreateInfo: *const VkFenceCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxDestroyFence( + device: VkDevice, + fence: VkFence, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxResetFences( + device: VkDevice, + fenceCount: u32, + pFences: *const VkFence, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetFenceStatus(device: VkDevice, fence: VkFence) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxWaitForFences( + device: VkDevice, + fenceCount: u32, + pFences: *const VkFence, + waitAll: VkBool32, + timeout: u64, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateSemaphore( + device: VkDevice, + pCreateInfo: *const VkSemaphoreCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSemaphore: *mut VkSemaphore, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxDestroySemaphore( + device: VkDevice, + semaphore: VkSemaphore, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateEvent( + device: VkDevice, + pCreateInfo: *const VkEventCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pEvent: *mut VkEvent, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxDestroyEvent( + device: VkDevice, + event: VkEvent, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetEventStatus(device: VkDevice, event: VkEvent) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxSetEvent(device: VkDevice, event: VkEvent) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxResetEvent(device: VkDevice, event: VkEvent) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateQueryPool( + device: VkDevice, + pCreateInfo: *const VkQueryPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pQueryPool: *mut VkQueryPool, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxDestroyQueryPool( + device: VkDevice, + queryPool: VkQueryPool, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxGetQueryPoolResults( + device: VkDevice, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dataSize: usize, + pData: *mut ::std::os::raw::c_void, + stride: VkDeviceSize, + flags: VkQueryResultFlags, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateBuffer( gpu: VkDevice, pCreateInfo: *const VkBufferCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -532,16 +610,17 @@ pub extern fn gfxCreateBuffer( assert_eq!(info.sharingMode, VkSharingMode::VK_SHARING_MODE_EXCLUSIVE); // TODO assert_eq!(info.flags, 0); // TODO - let buffer = gpu.device.create_buffer( - info.size, - conv::map_buffer_usage(info.usage), - ).expect("Error on creating buffer"); + let buffer = gpu.device + .create_buffer(info.size, conv::map_buffer_usage(info.usage)) + .expect("Error on creating buffer"); - unsafe { *pBuffer = Handle::new(Buffer::Unbound(buffer)); } + unsafe { + *pBuffer = Handle::new(Buffer::Unbound(buffer)); + } VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxDestroyBuffer( +pub extern "C" fn gfxDestroyBuffer( gpu: VkDevice, buffer: VkBuffer, pAllocator: *const VkAllocationCallbacks, @@ -553,18 +632,25 @@ pub extern fn gfxDestroyBuffer( } } } -extern "C" { - pub fn vkCreateBufferView(device: VkDevice, - pCreateInfo: *const VkBufferViewCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pView: *mut VkBufferView) -> VkResult; -} -extern "C" { - pub fn vkDestroyBufferView(device: VkDevice, bufferView: VkBufferView, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxCreateBufferView( + device: VkDevice, + pCreateInfo: *const VkBufferViewCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pView: *mut VkBufferView, +) -> VkResult { + unimplemented!() } #[inline] -pub extern fn gfxCreateImage( +pub extern "C" fn gfxDestroyBufferView( + device: VkDevice, + bufferView: VkBufferView, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxCreateImage( gpu: VkDevice, pCreateInfo: *const VkImageCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -575,18 +661,28 @@ pub extern fn gfxCreateImage( assert_eq!(info.tiling, VkImageTiling::VK_IMAGE_TILING_OPTIMAL); // TODO assert_eq!(info.initialLayout, VkImageLayout::VK_IMAGE_LAYOUT_UNDEFINED); // TODO - let image = gpu.device.create_image( - conv::map_image_kind(info.imageType, info.flags, info.extent, info.arrayLayers, info.samples), - info.mipLevels as _, - conv::map_format(info.format), - conv::map_image_usage(info.usage), - ).expect("Error on creating image"); + let image = gpu.device + .create_image( + conv::map_image_kind( + info.imageType, + info.flags, + info.extent, + info.arrayLayers, + info.samples, + ), + info.mipLevels as _, + conv::map_format(info.format), + conv::map_image_usage(info.usage), + ) + .expect("Error on creating image"); - unsafe { *pImage = Handle::new(Image::Unbound(image)); } + unsafe { + *pImage = Handle::new(Image::Unbound(image)); + } VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxDestroyImage( +pub extern "C" fn gfxDestroyImage( gpu: VkDevice, image: VkImage, pAllocator: *const VkAllocationCallbacks, @@ -598,14 +694,17 @@ pub extern fn gfxDestroyImage( } } } -extern "C" { - pub fn vkGetImageSubresourceLayout(device: VkDevice, image: VkImage, - pSubresource: - *const VkImageSubresource, - pLayout: *mut VkSubresourceLayout); +#[inline] +pub extern "C" fn gfxGetImageSubresourceLayout( + device: VkDevice, + image: VkImage, + pSubresource: *const VkImageSubresource, + pLayout: *mut VkSubresourceLayout, +) { + unimplemented!() } #[inline] -pub extern fn gfxCreateImageView( +pub extern "C" fn gfxCreateImageView( gpu: VkDevice, pCreateInfo: *const VkImageViewCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -621,201 +720,259 @@ pub extern fn gfxCreateImageView( Image::Unbound(_) => panic!("Can't create view for unbound image"), }; - let view = gpu - .device - .create_image_view( - image, - conv::map_format(info.format), - conv::map_swizzle(info.components), - conv::map_subresource_range(info.subresourceRange), - ); + let view = gpu.device.create_image_view( + image, + conv::map_format(info.format), + conv::map_swizzle(info.components), + conv::map_subresource_range(info.subresourceRange), + ); match view { Ok(view) => { unsafe { *pView = Handle::new(view) }; VkResult::VK_SUCCESS - }, - Err(err) => { - panic!("Unexpected image view creation error: {:?}", err) - }, + } + Err(err) => panic!("Unexpected image view creation error: {:?}", err), } } #[inline] -pub extern fn gfxDestroyImageView( +pub extern "C" fn gfxDestroyImageView( gpu: VkDevice, imageView: VkImageView, pAllocator: *const VkAllocationCallbacks, ) { gpu.device.destroy_image_view(*imageView.unwrap()) } -extern "C" { - pub fn vkCreateShaderModule(device: VkDevice, - pCreateInfo: *const VkShaderModuleCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pShaderModule: *mut VkShaderModule) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreateShaderModule( + device: VkDevice, + pCreateInfo: *const VkShaderModuleCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pShaderModule: *mut VkShaderModule, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyShaderModule(device: VkDevice, - shaderModule: VkShaderModule, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyShaderModule( + device: VkDevice, + shaderModule: VkShaderModule, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreatePipelineCache(device: VkDevice, - pCreateInfo: - *const VkPipelineCacheCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pPipelineCache: *mut VkPipelineCache) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreatePipelineCache( + device: VkDevice, + pCreateInfo: *const VkPipelineCacheCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineCache: *mut VkPipelineCache, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyPipelineCache(device: VkDevice, - pipelineCache: VkPipelineCache, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyPipelineCache( + device: VkDevice, + pipelineCache: VkPipelineCache, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkGetPipelineCacheData(device: VkDevice, - pipelineCache: VkPipelineCache, - pDataSize: *mut usize, - pData: *mut ::std::os::raw::c_void) - -> VkResult; +#[inline] +pub extern "C" fn gfxGetPipelineCacheData( + device: VkDevice, + pipelineCache: VkPipelineCache, + pDataSize: *mut usize, + pData: *mut ::std::os::raw::c_void, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkMergePipelineCaches(device: VkDevice, dstCache: VkPipelineCache, - srcCacheCount: u32, - pSrcCaches: *const VkPipelineCache) - -> VkResult; +#[inline] +pub extern "C" fn gfxMergePipelineCaches( + device: VkDevice, + dstCache: VkPipelineCache, + srcCacheCount: u32, + pSrcCaches: *const VkPipelineCache, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkCreateGraphicsPipelines(device: VkDevice, - pipelineCache: VkPipelineCache, - createInfoCount: u32, - pCreateInfos: - *const VkGraphicsPipelineCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pPipelines: *mut VkPipeline) -> VkResult; +#[inline] +pub extern "C" fn gfxCreateGraphicsPipelines( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkGraphicsPipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkCreateComputePipelines(device: VkDevice, - pipelineCache: VkPipelineCache, - createInfoCount: u32, - pCreateInfos: - *const VkComputePipelineCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pPipelines: *mut VkPipeline) -> VkResult; +#[inline] +pub extern "C" fn gfxCreateComputePipelines( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkComputePipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyPipeline(device: VkDevice, pipeline: VkPipeline, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyPipeline( + device: VkDevice, + pipeline: VkPipeline, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreatePipelineLayout(device: VkDevice, - pCreateInfo: - *const VkPipelineLayoutCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pPipelineLayout: *mut VkPipelineLayout) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreatePipelineLayout( + device: VkDevice, + pCreateInfo: *const VkPipelineLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineLayout: *mut VkPipelineLayout, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyPipelineLayout(device: VkDevice, - pipelineLayout: VkPipelineLayout, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyPipelineLayout( + device: VkDevice, + pipelineLayout: VkPipelineLayout, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateSampler(device: VkDevice, - pCreateInfo: *const VkSamplerCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pSampler: *mut VkSampler) -> VkResult; +#[inline] +pub extern "C" fn gfxCreateSampler( + device: VkDevice, + pCreateInfo: *const VkSamplerCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSampler: *mut VkSampler, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroySampler(device: VkDevice, sampler: VkSampler, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroySampler( + device: VkDevice, + sampler: VkSampler, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateDescriptorSetLayout(device: VkDevice, - pCreateInfo: - *const VkDescriptorSetLayoutCreateInfo, - pAllocator: - *const VkAllocationCallbacks, - pSetLayout: *mut VkDescriptorSetLayout) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreateDescriptorSetLayout( + device: VkDevice, + pCreateInfo: *const VkDescriptorSetLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSetLayout: *mut VkDescriptorSetLayout, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyDescriptorSetLayout(device: VkDevice, - descriptorSetLayout: - VkDescriptorSetLayout, - pAllocator: - *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyDescriptorSetLayout( + device: VkDevice, + descriptorSetLayout: VkDescriptorSetLayout, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateDescriptorPool(device: VkDevice, - pCreateInfo: - *const VkDescriptorPoolCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pDescriptorPool: *mut VkDescriptorPool) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreateDescriptorPool( + device: VkDevice, + pCreateInfo: *const VkDescriptorPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pDescriptorPool: *mut VkDescriptorPool, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyDescriptorPool(device: VkDevice, - descriptorPool: VkDescriptorPool, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyDescriptorPool( + device: VkDevice, + descriptorPool: VkDescriptorPool, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkResetDescriptorPool(device: VkDevice, - descriptorPool: VkDescriptorPool, - flags: VkDescriptorPoolResetFlags) - -> VkResult; +#[inline] +pub extern "C" fn gfxResetDescriptorPool( + device: VkDevice, + descriptorPool: VkDescriptorPool, + flags: VkDescriptorPoolResetFlags, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkAllocateDescriptorSets(device: VkDevice, - pAllocateInfo: - *const VkDescriptorSetAllocateInfo, - pDescriptorSets: *mut VkDescriptorSet) - -> VkResult; +#[inline] +pub extern "C" fn gfxAllocateDescriptorSets( + device: VkDevice, + pAllocateInfo: *const VkDescriptorSetAllocateInfo, + pDescriptorSets: *mut VkDescriptorSet, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkFreeDescriptorSets(device: VkDevice, - descriptorPool: VkDescriptorPool, - descriptorSetCount: u32, - pDescriptorSets: *const VkDescriptorSet) - -> VkResult; +#[inline] +pub extern "C" fn gfxFreeDescriptorSets( + device: VkDevice, + descriptorPool: VkDescriptorPool, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkUpdateDescriptorSets(device: VkDevice, descriptorWriteCount: u32, - pDescriptorWrites: - *const VkWriteDescriptorSet, - descriptorCopyCount: u32, - pDescriptorCopies: - *const VkCopyDescriptorSet); +#[inline] +pub extern "C" fn gfxUpdateDescriptorSets( + device: VkDevice, + descriptorWriteCount: u32, + pDescriptorWrites: *const VkWriteDescriptorSet, + descriptorCopyCount: u32, + pDescriptorCopies: *const VkCopyDescriptorSet, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateFramebuffer(device: VkDevice, - pCreateInfo: *const VkFramebufferCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pFramebuffer: *mut VkFramebuffer) -> VkResult; +#[inline] +pub extern "C" fn gfxCreateFramebuffer( + device: VkDevice, + pCreateInfo: *const VkFramebufferCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFramebuffer: *mut VkFramebuffer, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyFramebuffer(device: VkDevice, framebuffer: VkFramebuffer, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyFramebuffer( + device: VkDevice, + framebuffer: VkFramebuffer, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateRenderPass(device: VkDevice, - pCreateInfo: *const VkRenderPassCreateInfo, - pAllocator: *const VkAllocationCallbacks, - pRenderPass: *mut VkRenderPass) -> VkResult; +#[inline] +pub extern "C" fn gfxCreateRenderPass( + device: VkDevice, + pCreateInfo: *const VkRenderPassCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pRenderPass: *mut VkRenderPass, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyRenderPass(device: VkDevice, renderPass: VkRenderPass, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyRenderPass( + device: VkDevice, + renderPass: VkRenderPass, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkGetRenderAreaGranularity(device: VkDevice, - renderPass: VkRenderPass, - pGranularity: *mut VkExtent2D); +#[inline] +pub extern "C" fn gfxGetRenderAreaGranularity( + device: VkDevice, + renderPass: VkRenderPass, + pGranularity: *mut VkExtent2D, +) { + unimplemented!() } #[inline] -pub extern fn gfxCreateCommandPool( +pub extern "C" fn gfxCreateCommandPool( gpu: VkDevice, pCreateInfo: *const VkCommandPoolCreateInfo, _pAllocator: *const VkAllocationCallbacks, @@ -831,7 +988,10 @@ pub extern fn gfxCreateCommandPool( if info.flags & VkCommandPoolCreateFlagBits::VK_COMMAND_POOL_CREATE_TRANSIENT_BIT as u32 != 0 { flags |= CommandPoolCreateFlags::TRANSIENT; } - if info.flags & VkCommandPoolCreateFlagBits::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT as u32 != 0 { + if info.flags + & VkCommandPoolCreateFlagBits::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT as u32 + != 0 + { flags |= CommandPoolCreateFlags::RESET_INDIVIDUAL; } @@ -841,7 +1001,7 @@ pub extern fn gfxCreateCommandPool( } #[inline] -pub extern fn gfxDestroyCommandPool( +pub extern "C" fn gfxDestroyCommandPool( gpu: VkDevice, commandPool: VkCommandPool, _pAllocator: *const VkAllocationCallbacks, @@ -850,7 +1010,7 @@ pub extern fn gfxDestroyCommandPool( } #[inline] -pub extern fn gfxResetCommandPool( +pub extern "C" fn gfxResetCommandPool( _gpu: VkDevice, mut commandPool: VkCommandPool, _flags: VkCommandPoolResetFlags, @@ -860,20 +1020,21 @@ pub extern fn gfxResetCommandPool( } #[inline] -pub extern fn gfxAllocateCommandBuffers( +pub extern "C" fn gfxAllocateCommandBuffers( _gpu: VkDevice, pAllocateInfo: *const VkCommandBufferAllocateInfo, pCommandBuffers: *mut VkCommandBuffer, ) -> VkResult { let info = unsafe { &mut *(pAllocateInfo as *mut VkCommandBufferAllocateInfo) }; - assert_eq!(info.level, VkCommandBufferLevel::VK_COMMAND_BUFFER_LEVEL_PRIMARY); //TODO + assert_eq!( + info.level, + VkCommandBufferLevel::VK_COMMAND_BUFFER_LEVEL_PRIMARY + ); //TODO let count = info.commandBufferCount as usize; let cmd_bufs = info.commandPool.allocate(count); - let output = unsafe { - slice::from_raw_parts_mut(pCommandBuffers, count) - }; + let output = unsafe { slice::from_raw_parts_mut(pCommandBuffers, count) }; for (out, cmd_buf) in output.iter_mut().zip(cmd_bufs) { *out = Handle::new(cmd_buf); } @@ -882,290 +1043,458 @@ pub extern fn gfxAllocateCommandBuffers( } #[inline] -pub extern fn gfxFreeCommandBuffers( +pub extern "C" fn gfxFreeCommandBuffers( _gpu: VkDevice, mut commandPool: VkCommandPool, commandBufferCount: u32, pCommandBuffers: *const VkCommandBuffer, ) { - let buffer_slice = unsafe { - slice::from_raw_parts(pCommandBuffers, commandBufferCount as _) - }; - let buffers = buffer_slice - .iter() - .map(|buffer| *buffer.unwrap()) - .collect(); + let buffer_slice = unsafe { slice::from_raw_parts(pCommandBuffers, commandBufferCount as _) }; + let buffers = buffer_slice.iter().map(|buffer| *buffer.unwrap()).collect(); unsafe { commandPool.free(buffers) }; } -extern "C" { - pub fn vkBeginCommandBuffer(commandBuffer: VkCommandBuffer, - pBeginInfo: *const VkCommandBufferBeginInfo) - -> VkResult; +#[inline] +pub extern "C" fn gfxBeginCommandBuffer( + commandBuffer: VkCommandBuffer, + pBeginInfo: *const VkCommandBufferBeginInfo, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkEndCommandBuffer(commandBuffer: VkCommandBuffer) -> VkResult; +#[inline] +pub extern "C" fn gfxEndCommandBuffer(commandBuffer: VkCommandBuffer) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkResetCommandBuffer(commandBuffer: VkCommandBuffer, - flags: VkCommandBufferResetFlags) -> VkResult; +#[inline] +pub extern "C" fn gfxResetCommandBuffer( + commandBuffer: VkCommandBuffer, + flags: VkCommandBufferResetFlags, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkCmdBindPipeline(commandBuffer: VkCommandBuffer, - pipelineBindPoint: VkPipelineBindPoint, - pipeline: VkPipeline); +#[inline] +pub extern "C" fn gfxCmdBindPipeline( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + pipeline: VkPipeline, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetViewport(commandBuffer: VkCommandBuffer, - firstViewport: u32, viewportCount: u32, - pViewports: *const VkViewport); +#[inline] +pub extern "C" fn gfxCmdSetViewport( + commandBuffer: VkCommandBuffer, + firstViewport: u32, + viewportCount: u32, + pViewports: *const VkViewport, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetScissor(commandBuffer: VkCommandBuffer, firstScissor: u32, - scissorCount: u32, pScissors: *const VkRect2D); +#[inline] +pub extern "C" fn gfxCmdSetScissor( + commandBuffer: VkCommandBuffer, + firstScissor: u32, + scissorCount: u32, + pScissors: *const VkRect2D, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetLineWidth(commandBuffer: VkCommandBuffer, lineWidth: f32); +#[inline] +pub extern "C" fn gfxCmdSetLineWidth(commandBuffer: VkCommandBuffer, lineWidth: f32) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetDepthBias(commandBuffer: VkCommandBuffer, - depthBiasConstantFactor: f32, - depthBiasClamp: f32, depthBiasSlopeFactor: f32); +#[inline] +pub extern "C" fn gfxCmdSetDepthBias( + commandBuffer: VkCommandBuffer, + depthBiasConstantFactor: f32, + depthBiasClamp: f32, + depthBiasSlopeFactor: f32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetBlendConstants(commandBuffer: VkCommandBuffer, - blendConstants: *const f32); +#[inline] +pub extern "C" fn gfxCmdSetBlendConstants( + commandBuffer: VkCommandBuffer, + blendConstants: *const f32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetDepthBounds(commandBuffer: VkCommandBuffer, - minDepthBounds: f32, maxDepthBounds: f32); +#[inline] +pub extern "C" fn gfxCmdSetDepthBounds( + commandBuffer: VkCommandBuffer, + minDepthBounds: f32, + maxDepthBounds: f32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetStencilCompareMask(commandBuffer: VkCommandBuffer, - faceMask: VkStencilFaceFlags, - compareMask: u32); +#[inline] +pub extern "C" fn gfxCmdSetStencilCompareMask( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + compareMask: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetStencilWriteMask(commandBuffer: VkCommandBuffer, - faceMask: VkStencilFaceFlags, - writeMask: u32); +#[inline] +pub extern "C" fn gfxCmdSetStencilWriteMask( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + writeMask: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetStencilReference(commandBuffer: VkCommandBuffer, - faceMask: VkStencilFaceFlags, - reference: u32); +#[inline] +pub extern "C" fn gfxCmdSetStencilReference( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + reference: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBindDescriptorSets(commandBuffer: VkCommandBuffer, - pipelineBindPoint: VkPipelineBindPoint, - layout: VkPipelineLayout, firstSet: u32, - descriptorSetCount: u32, - pDescriptorSets: *const VkDescriptorSet, - dynamicOffsetCount: u32, - pDynamicOffsets: *const u32); +#[inline] +pub extern "C" fn gfxCmdBindDescriptorSets( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + layout: VkPipelineLayout, + firstSet: u32, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, + dynamicOffsetCount: u32, + pDynamicOffsets: *const u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBindIndexBuffer(commandBuffer: VkCommandBuffer, - buffer: VkBuffer, offset: VkDeviceSize, - indexType: VkIndexType); +#[inline] +pub extern "C" fn gfxCmdBindIndexBuffer( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + indexType: VkIndexType, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBindVertexBuffers(commandBuffer: VkCommandBuffer, - firstBinding: u32, bindingCount: u32, - pBuffers: *const VkBuffer, - pOffsets: *const VkDeviceSize); +#[inline] +pub extern "C" fn gfxCmdBindVertexBuffers( + commandBuffer: VkCommandBuffer, + firstBinding: u32, + bindingCount: u32, + pBuffers: *const VkBuffer, + pOffsets: *const VkDeviceSize, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDraw(commandBuffer: VkCommandBuffer, vertexCount: u32, - instanceCount: u32, firstVertex: u32, - firstInstance: u32); +#[inline] +pub extern "C" fn gfxCmdDraw( + commandBuffer: VkCommandBuffer, + vertexCount: u32, + instanceCount: u32, + firstVertex: u32, + firstInstance: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDrawIndexed(commandBuffer: VkCommandBuffer, indexCount: u32, - instanceCount: u32, firstIndex: u32, - vertexOffset: i32, firstInstance: u32); +#[inline] +pub extern "C" fn gfxCmdDrawIndexed( + commandBuffer: VkCommandBuffer, + indexCount: u32, + instanceCount: u32, + firstIndex: u32, + vertexOffset: i32, + firstInstance: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDrawIndirect(commandBuffer: VkCommandBuffer, buffer: VkBuffer, - offset: VkDeviceSize, drawCount: u32, - stride: u32); +#[inline] +pub extern "C" fn gfxCmdDrawIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDrawIndexedIndirect(commandBuffer: VkCommandBuffer, - buffer: VkBuffer, offset: VkDeviceSize, - drawCount: u32, stride: u32); +#[inline] +pub extern "C" fn gfxCmdDrawIndexedIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDispatch(commandBuffer: VkCommandBuffer, groupCountX: u32, - groupCountY: u32, groupCountZ: u32); +#[inline] +pub extern "C" fn gfxCmdDispatch( + commandBuffer: VkCommandBuffer, + groupCountX: u32, + groupCountY: u32, + groupCountZ: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdDispatchIndirect(commandBuffer: VkCommandBuffer, - buffer: VkBuffer, offset: VkDeviceSize); +#[inline] +pub extern "C" fn gfxCmdDispatchIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdCopyBuffer(commandBuffer: VkCommandBuffer, - srcBuffer: VkBuffer, dstBuffer: VkBuffer, - regionCount: u32, pRegions: *const VkBufferCopy); +#[inline] +pub extern "C" fn gfxCmdCopyBuffer( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferCopy, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdCopyImage(commandBuffer: VkCommandBuffer, srcImage: VkImage, - srcImageLayout: VkImageLayout, dstImage: VkImage, - dstImageLayout: VkImageLayout, regionCount: u32, - pRegions: *const VkImageCopy); +#[inline] +pub extern "C" fn gfxCmdCopyImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageCopy, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBlitImage(commandBuffer: VkCommandBuffer, srcImage: VkImage, - srcImageLayout: VkImageLayout, dstImage: VkImage, - dstImageLayout: VkImageLayout, regionCount: u32, - pRegions: *const VkImageBlit, filter: VkFilter); +#[inline] +pub extern "C" fn gfxCmdBlitImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageBlit, + filter: VkFilter, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdCopyBufferToImage(commandBuffer: VkCommandBuffer, - srcBuffer: VkBuffer, dstImage: VkImage, - dstImageLayout: VkImageLayout, - regionCount: u32, - pRegions: *const VkBufferImageCopy); +#[inline] +pub extern "C" fn gfxCmdCopyBufferToImage( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkBufferImageCopy, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdCopyImageToBuffer(commandBuffer: VkCommandBuffer, - srcImage: VkImage, - srcImageLayout: VkImageLayout, - dstBuffer: VkBuffer, regionCount: u32, - pRegions: *const VkBufferImageCopy); +#[inline] +pub extern "C" fn gfxCmdCopyImageToBuffer( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferImageCopy, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdUpdateBuffer(commandBuffer: VkCommandBuffer, - dstBuffer: VkBuffer, dstOffset: VkDeviceSize, - dataSize: VkDeviceSize, - pData: *const ::std::os::raw::c_void); +#[inline] +pub extern "C" fn gfxCmdUpdateBuffer( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + dataSize: VkDeviceSize, + pData: *const ::std::os::raw::c_void, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdFillBuffer(commandBuffer: VkCommandBuffer, - dstBuffer: VkBuffer, dstOffset: VkDeviceSize, - size: VkDeviceSize, data: u32); +#[inline] +pub extern "C" fn gfxCmdFillBuffer( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + size: VkDeviceSize, + data: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdClearColorImage(commandBuffer: VkCommandBuffer, - image: VkImage, imageLayout: VkImageLayout, - pColor: *const VkClearColorValue, - rangeCount: u32, - pRanges: *const VkImageSubresourceRange); +#[inline] +pub extern "C" fn gfxCmdClearColorImage( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pColor: *const VkClearColorValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdClearDepthStencilImage(commandBuffer: VkCommandBuffer, - image: VkImage, - imageLayout: VkImageLayout, - pDepthStencil: - *const VkClearDepthStencilValue, - rangeCount: u32, - pRanges: - *const VkImageSubresourceRange); +#[inline] +pub extern "C" fn gfxCmdClearDepthStencilImage( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pDepthStencil: *const VkClearDepthStencilValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdClearAttachments(commandBuffer: VkCommandBuffer, - attachmentCount: u32, - pAttachments: *const VkClearAttachment, - rectCount: u32, pRects: *const VkClearRect); +#[inline] +pub extern "C" fn gfxCmdClearAttachments( + commandBuffer: VkCommandBuffer, + attachmentCount: u32, + pAttachments: *const VkClearAttachment, + rectCount: u32, + pRects: *const VkClearRect, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdResolveImage(commandBuffer: VkCommandBuffer, - srcImage: VkImage, srcImageLayout: VkImageLayout, - dstImage: VkImage, dstImageLayout: VkImageLayout, - regionCount: u32, - pRegions: *const VkImageResolve); +#[inline] +pub extern "C" fn gfxCmdResolveImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageResolve, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetEvent(commandBuffer: VkCommandBuffer, event: VkEvent, - stageMask: VkPipelineStageFlags); +#[inline] +pub extern "C" fn gfxCmdSetEvent( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdResetEvent(commandBuffer: VkCommandBuffer, event: VkEvent, - stageMask: VkPipelineStageFlags); +#[inline] +pub extern "C" fn gfxCmdResetEvent( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdWaitEvents(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); +#[inline] +pub extern "C" fn gfxCmdWaitEvents( + 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, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdPipelineBarrier(commandBuffer: VkCommandBuffer, - srcStageMask: VkPipelineStageFlags, - dstStageMask: VkPipelineStageFlags, - dependencyFlags: VkDependencyFlags, - memoryBarrierCount: u32, - pMemoryBarriers: *const VkMemoryBarrier, - bufferMemoryBarrierCount: u32, - pBufferMemoryBarriers: - *const VkBufferMemoryBarrier, - imageMemoryBarrierCount: u32, - pImageMemoryBarriers: - *const VkImageMemoryBarrier); +#[inline] +pub extern "C" fn gfxCmdPipelineBarrier( + commandBuffer: VkCommandBuffer, + srcStageMask: VkPipelineStageFlags, + dstStageMask: VkPipelineStageFlags, + dependencyFlags: VkDependencyFlags, + memoryBarrierCount: u32, + pMemoryBarriers: *const VkMemoryBarrier, + bufferMemoryBarrierCount: u32, + pBufferMemoryBarriers: *const VkBufferMemoryBarrier, + imageMemoryBarrierCount: u32, + pImageMemoryBarriers: *const VkImageMemoryBarrier, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBeginQuery(commandBuffer: VkCommandBuffer, - queryPool: VkQueryPool, query: u32, - flags: VkQueryControlFlags); +#[inline] +pub extern "C" fn gfxCmdBeginQuery( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + query: u32, + flags: VkQueryControlFlags, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdEndQuery(commandBuffer: VkCommandBuffer, - queryPool: VkQueryPool, query: u32); +#[inline] +pub extern "C" fn gfxCmdEndQuery( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + query: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdResetQueryPool(commandBuffer: VkCommandBuffer, - queryPool: VkQueryPool, firstQuery: u32, - queryCount: u32); +#[inline] +pub extern "C" fn gfxCmdResetQueryPool( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdWriteTimestamp(commandBuffer: VkCommandBuffer, - pipelineStage: VkPipelineStageFlagBits, - queryPool: VkQueryPool, query: u32); +#[inline] +pub extern "C" fn gfxCmdWriteTimestamp( + commandBuffer: VkCommandBuffer, + pipelineStage: VkPipelineStageFlagBits, + queryPool: VkQueryPool, + query: u32, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdCopyQueryPoolResults(commandBuffer: VkCommandBuffer, - queryPool: VkQueryPool, firstQuery: u32, - queryCount: u32, dstBuffer: VkBuffer, - dstOffset: VkDeviceSize, - stride: VkDeviceSize, - flags: VkQueryResultFlags); +#[inline] +pub extern "C" fn gfxCmdCopyQueryPoolResults( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + stride: VkDeviceSize, + flags: VkQueryResultFlags, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdPushConstants(commandBuffer: VkCommandBuffer, - layout: VkPipelineLayout, - stageFlags: VkShaderStageFlags, offset: u32, - size: u32, - pValues: *const ::std::os::raw::c_void); +#[inline] +pub extern "C" fn gfxCmdPushConstants( + commandBuffer: VkCommandBuffer, + layout: VkPipelineLayout, + stageFlags: VkShaderStageFlags, + offset: u32, + size: u32, + pValues: *const ::std::os::raw::c_void, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdBeginRenderPass(commandBuffer: VkCommandBuffer, - pRenderPassBegin: - *const VkRenderPassBeginInfo, - contents: VkSubpassContents); +#[inline] +pub extern "C" fn gfxCmdBeginRenderPass( + commandBuffer: VkCommandBuffer, + pRenderPassBegin: *const VkRenderPassBeginInfo, + contents: VkSubpassContents, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdNextSubpass(commandBuffer: VkCommandBuffer, - contents: VkSubpassContents); +#[inline] +pub extern "C" fn gfxCmdNextSubpass(commandBuffer: VkCommandBuffer, contents: VkSubpassContents) { + unimplemented!() } -extern "C" { - pub fn vkCmdEndRenderPass(commandBuffer: VkCommandBuffer); +#[inline] +pub extern "C" fn gfxCmdEndRenderPass(commandBuffer: VkCommandBuffer) { + unimplemented!() } -extern "C" { - pub fn vkCmdExecuteCommands(commandBuffer: VkCommandBuffer, - commandBufferCount: u32, - pCommandBuffers: *const VkCommandBuffer); +#[inline] +pub extern "C" fn gfxCmdExecuteCommands( + commandBuffer: VkCommandBuffer, + commandBufferCount: u32, + pCommandBuffers: *const VkCommandBuffer, +) { + unimplemented!() } #[inline] -pub extern fn gfxDestroySurfaceKHR( +pub extern "C" fn gfxDestroySurfaceKHR( _instance: VkInstance, surface: VkSurfaceKHR, _: *const VkAllocationCallbacks, @@ -1174,7 +1503,7 @@ pub extern fn gfxDestroySurfaceKHR( } #[inline] -pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR( +pub extern "C" fn gfxGetPhysicalDeviceSurfaceSupportKHR( adapter: VkPhysicalDevice, queueFamilyIndex: u32, surface: VkSurfaceKHR, @@ -1187,7 +1516,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceSupportKHR( } #[inline] -pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR( +pub extern "C" fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR( adapter: VkPhysicalDevice, surface: VkSurfaceKHR, pSurfaceCapabilities: *mut VkSurfaceCapabilitiesKHR, @@ -1207,9 +1536,11 @@ pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR( minImageExtent: conv::extent2d_from_hal(caps.extents.start), maxImageExtent: conv::extent2d_from_hal(caps.extents.end), maxImageArrayLayers: caps.max_image_layers, - supportedTransforms: VkSurfaceTransformFlagBitsKHR::VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR as _, + supportedTransforms: VkSurfaceTransformFlagBitsKHR::VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR + as _, currentTransform: VkSurfaceTransformFlagBitsKHR::VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, - supportedCompositeAlpha: VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR as _, + supportedCompositeAlpha: VkCompositeAlphaFlagBitsKHR::VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR + as _, supportedUsageFlags: 0, }; @@ -1218,7 +1549,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceCapabilitiesKHR( } #[inline] -pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR( +pub extern "C" fn gfxGetPhysicalDeviceSurfaceFormatsKHR( adapter: VkPhysicalDevice, surface: VkSurfaceKHR, pSurfaceFormatCount: *mut u32, @@ -1227,19 +1558,15 @@ pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR( let formats = surface .capabilities_and_formats(&adapter.physical_device) .1 - .map(|formats| - formats - .into_iter() - .map(conv::format_from_hal) - .collect() - ) + .map(|formats| formats.into_iter().map(conv::format_from_hal).collect()) .unwrap_or(vec![VkFormat::VK_FORMAT_UNDEFINED]); if pSurfaceFormats.is_null() { // Return only the number of formats unsafe { *pSurfaceFormatCount = formats.len() as u32 }; } else { - let output = unsafe { slice::from_raw_parts_mut(pSurfaceFormats, *pSurfaceFormatCount as usize) }; + let output = + unsafe { slice::from_raw_parts_mut(pSurfaceFormats, *pSurfaceFormatCount as usize) }; if output.len() > formats.len() { unsafe { *pSurfaceFormatCount = formats.len() as u32 }; } @@ -1255,7 +1582,7 @@ pub extern fn gfxGetPhysicalDeviceSurfaceFormatsKHR( } #[inline] -pub extern fn gfxGetPhysicalDeviceSurfacePresentModesKHR( +pub extern "C" fn gfxGetPhysicalDeviceSurfacePresentModesKHR( _adapter: VkPhysicalDevice, _surface: VkSurfaceKHR, pPresentModeCount: *mut u32, @@ -1275,7 +1602,7 @@ pub extern fn gfxGetPhysicalDeviceSurfacePresentModesKHR( } #[inline] -pub extern fn gfxCreateSwapchainKHR( +pub extern "C" fn gfxCreateSwapchainKHR( gpu: VkDevice, pCreateInfo: *const VkSwapchainCreateInfoKHR, _pAllocator: *const VkAllocationCallbacks, @@ -1284,22 +1611,27 @@ pub extern fn gfxCreateSwapchainKHR( let info = unsafe { &*pCreateInfo }; // TODO: more checks assert_eq!(info.clipped, VK_TRUE); // TODO - assert_eq!(info.imageSharingMode, VkSharingMode::VK_SHARING_MODE_EXCLUSIVE); // TODO + assert_eq!( + info.imageSharingMode, + VkSharingMode::VK_SHARING_MODE_EXCLUSIVE + ); // TODO let config = hal::SwapchainConfig { color_format: conv::map_format(info.imageFormat), depth_stencil_format: None, image_count: info.minImageCount, }; - let (swapchain, backbuffers) = gpu.device.create_swapchain(&mut info.surface.clone(), config); + let (swapchain, backbuffers) = gpu.device + .create_swapchain(&mut info.surface.clone(), config); let images = match backbuffers { - hal::Backbuffer::Images(images) => { - images.into_iter().map(|image| Handle::new(Image::Image(image))).collect() - }, - hal::Backbuffer::Framebuffer(_) => { - panic!("Expected backbuffer images. Backends returning only framebuffers are not supported!") - }, + hal::Backbuffer::Images(images) => images + .into_iter() + .map(|image| Handle::new(Image::Image(image))) + .collect(), + hal::Backbuffer::Framebuffer(_) => panic!( + "Expected backbuffer images. Backends returning only framebuffers are not supported!" + ), }; let swapchain = Swapchain { @@ -1311,7 +1643,7 @@ pub extern fn gfxCreateSwapchainKHR( VkResult::VK_SUCCESS } #[inline] -pub extern fn gfxDestroySwapchainKHR( +pub extern "C" fn gfxDestroySwapchainKHR( device: VkDevice, mut swapchain: VkSwapchainKHR, pAllocator: *const VkAllocationCallbacks, @@ -1322,7 +1654,7 @@ pub extern fn gfxDestroySwapchainKHR( let _ = swapchain.unwrap(); } #[inline] -pub extern fn gfxGetSwapchainImagesKHR( +pub extern "C" fn gfxGetSwapchainImagesKHR( device: VkDevice, swapchain: VkSwapchainKHR, pSwapchainImageCount: *mut u32, @@ -1330,7 +1662,7 @@ pub extern fn gfxGetSwapchainImagesKHR( ) -> VkResult { debug_assert!(!pSwapchainImageCount.is_null()); - let swapchain_image_count = unsafe { &mut*pSwapchainImageCount }; + let swapchain_image_count = unsafe { &mut *pSwapchainImageCount }; let available_images = swapchain.images.len() as u32; if pSwapchainImages.is_null() { @@ -1338,9 +1670,8 @@ pub extern fn gfxGetSwapchainImagesKHR( *swapchain_image_count = available_images; } else { *swapchain_image_count = available_images.min(*swapchain_image_count); - let swapchain_images = unsafe { - slice::from_raw_parts_mut(pSwapchainImages, *swapchain_image_count as _) - }; + let swapchain_images = + unsafe { slice::from_raw_parts_mut(pSwapchainImages, *swapchain_image_count as _) }; for i in 0..*swapchain_image_count as _ { swapchain_images[i] = swapchain.images[i]; @@ -1354,122 +1685,153 @@ pub extern fn gfxGetSwapchainImagesKHR( VkResult::VK_SUCCESS } -extern "C" { - pub fn vkCmdProcessCommandsNVX(commandBuffer: VkCommandBuffer, - pProcessCommandsInfo: - *const VkCmdProcessCommandsInfoNVX); +#[inline] +pub extern "C" fn gfxCmdProcessCommandsNVX( + commandBuffer: VkCommandBuffer, + pProcessCommandsInfo: *const VkCmdProcessCommandsInfoNVX, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdReserveSpaceForCommandsNVX(commandBuffer: VkCommandBuffer, - pReserveSpaceInfo: - *const VkCmdReserveSpaceForCommandsInfoNVX); +#[inline] +pub extern "C" fn gfxCmdReserveSpaceForCommandsNVX( + commandBuffer: VkCommandBuffer, + pReserveSpaceInfo: *const VkCmdReserveSpaceForCommandsInfoNVX, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateIndirectCommandsLayoutNVX(device: VkDevice, - pCreateInfo: - *const VkIndirectCommandsLayoutCreateInfoNVX, - pAllocator: - *const VkAllocationCallbacks, - pIndirectCommandsLayout: - *mut VkIndirectCommandsLayoutNVX) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreateIndirectCommandsLayoutNVX( + device: VkDevice, + pCreateInfo: *const VkIndirectCommandsLayoutCreateInfoNVX, + pAllocator: *const VkAllocationCallbacks, + pIndirectCommandsLayout: *mut VkIndirectCommandsLayoutNVX, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyIndirectCommandsLayoutNVX(device: VkDevice, - indirectCommandsLayout: - VkIndirectCommandsLayoutNVX, - pAllocator: - *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyIndirectCommandsLayoutNVX( + device: VkDevice, + indirectCommandsLayout: VkIndirectCommandsLayoutNVX, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkCreateObjectTableNVX(device: VkDevice, - pCreateInfo: - *const VkObjectTableCreateInfoNVX, - pAllocator: *const VkAllocationCallbacks, - pObjectTable: *mut VkObjectTableNVX) - -> VkResult; +#[inline] +pub extern "C" fn gfxCreateObjectTableNVX( + device: VkDevice, + pCreateInfo: *const VkObjectTableCreateInfoNVX, + pAllocator: *const VkAllocationCallbacks, + pObjectTable: *mut VkObjectTableNVX, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDestroyObjectTableNVX(device: VkDevice, - objectTable: VkObjectTableNVX, - pAllocator: *const VkAllocationCallbacks); +#[inline] +pub extern "C" fn gfxDestroyObjectTableNVX( + device: VkDevice, + objectTable: VkObjectTableNVX, + pAllocator: *const VkAllocationCallbacks, +) { + unimplemented!() } -extern "C" { - pub fn vkRegisterObjectsNVX(device: VkDevice, - objectTable: VkObjectTableNVX, - objectCount: u32, - ppObjectTableEntries: - *const *const VkObjectTableEntryNVX, - pObjectIndices: *const u32) -> VkResult; +#[inline] +pub extern "C" fn gfxRegisterObjectsNVX( + device: VkDevice, + objectTable: VkObjectTableNVX, + objectCount: u32, + ppObjectTableEntries: *const *const VkObjectTableEntryNVX, + pObjectIndices: *const u32, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkUnregisterObjectsNVX(device: VkDevice, - objectTable: VkObjectTableNVX, - objectCount: u32, - pObjectEntryTypes: - *const VkObjectEntryTypeNVX, - pObjectIndices: *const u32) -> VkResult; +#[inline] +pub extern "C" fn gfxUnregisterObjectsNVX( + device: VkDevice, + objectTable: VkObjectTableNVX, + objectCount: u32, + pObjectEntryTypes: *const VkObjectEntryTypeNVX, + pObjectIndices: *const u32, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice: - VkPhysicalDevice, - pFeatures: - *mut VkDeviceGeneratedCommandsFeaturesNVX, - pLimits: - *mut VkDeviceGeneratedCommandsLimitsNVX); +#[inline] +pub extern "C" fn gfxGetPhysicalDeviceGeneratedCommandsPropertiesNVX( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkDeviceGeneratedCommandsFeaturesNVX, + pLimits: *mut VkDeviceGeneratedCommandsLimitsNVX, +) { + unimplemented!() } -extern "C" { - pub fn vkCmdSetViewportWScalingNV(commandBuffer: VkCommandBuffer, - firstViewport: u32, viewportCount: u32, - pViewportWScalings: - *const VkViewportWScalingNV); +#[inline] +pub extern "C" fn gfxCmdSetViewportWScalingNV( + commandBuffer: VkCommandBuffer, + firstViewport: u32, + viewportCount: u32, + pViewportWScalings: *const VkViewportWScalingNV, +) { + unimplemented!() } -extern "C" { - pub fn vkReleaseDisplayEXT(physicalDevice: VkPhysicalDevice, - display: VkDisplayKHR) -> VkResult; +#[inline] +pub extern "C" fn gfxReleaseDisplayEXT( + physicalDevice: VkPhysicalDevice, + display: VkDisplayKHR, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice: - VkPhysicalDevice, - surface: VkSurfaceKHR, - pSurfaceCapabilities: - *mut VkSurfaceCapabilities2EXT) - -> VkResult; +#[inline] +pub extern "C" fn gfxGetPhysicalDeviceSurfaceCapabilities2EXT( + physicalDevice: VkPhysicalDevice, + surface: VkSurfaceKHR, + pSurfaceCapabilities: *mut VkSurfaceCapabilities2EXT, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkDisplayPowerControlEXT(device: VkDevice, display: VkDisplayKHR, - pDisplayPowerInfo: - *const VkDisplayPowerInfoEXT) - -> VkResult; +#[inline] +pub extern "C" fn gfxDisplayPowerControlEXT( + device: VkDevice, + display: VkDisplayKHR, + pDisplayPowerInfo: *const VkDisplayPowerInfoEXT, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkRegisterDeviceEventEXT(device: VkDevice, - pDeviceEventInfo: - *const VkDeviceEventInfoEXT, - pAllocator: *const VkAllocationCallbacks, - pFence: *mut VkFence) -> VkResult; +#[inline] +pub extern "C" fn gfxRegisterDeviceEventEXT( + device: VkDevice, + pDeviceEventInfo: *const VkDeviceEventInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkRegisterDisplayEventEXT(device: VkDevice, display: VkDisplayKHR, - pDisplayEventInfo: - *const VkDisplayEventInfoEXT, - pAllocator: *const VkAllocationCallbacks, - pFence: *mut VkFence) -> VkResult; +#[inline] +pub extern "C" fn gfxRegisterDisplayEventEXT( + device: VkDevice, + display: VkDisplayKHR, + pDisplayEventInfo: *const VkDisplayEventInfoEXT, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkGetSwapchainCounterEXT(device: VkDevice, - swapchain: VkSwapchainKHR, - counter: VkSurfaceCounterFlagBitsEXT, - pCounterValue: *mut u64) -> VkResult; +#[inline] +pub extern "C" fn gfxGetSwapchainCounterEXT( + device: VkDevice, + swapchain: VkSwapchainKHR, + counter: VkSurfaceCounterFlagBitsEXT, + pCounterValue: *mut u64, +) -> VkResult { + unimplemented!() } -extern "C" { - pub fn vkCmdSetDiscardRectangleEXT(commandBuffer: VkCommandBuffer, - firstDiscardRectangle: u32, - discardRectangleCount: u32, - pDiscardRectangles: *const VkRect2D); +#[inline] +pub extern "C" fn gfxCmdSetDiscardRectangleEXT( + commandBuffer: VkCommandBuffer, + firstDiscardRectangle: u32, + discardRectangleCount: u32, + pDiscardRectangles: *const VkRect2D, +) { + unimplemented!() } - -pub fn gfxCreateWin32SurfaceKHR( +#[inline] +pub extern "C" fn gfxCreateWin32SurfaceKHR( instance: VkInstance, pCreateInfos: *const VkWin32SurfaceCreateInfoKHR, pAllocator: *const VkAllocationCallbacks, @@ -1481,10 +1843,7 @@ pub fn gfxCreateWin32SurfaceKHR( assert_eq!((*pCreateInfos).flags, 0); assert!(pAllocator.is_null()); *pSurface = Handle::new( - instance.create_surface_from_hwnd( - (*pCreateInfos).hinstance, - (*pCreateInfos).hwnd, - ) + instance.create_surface_from_hwnd((*pCreateInfos).hinstance, (*pCreateInfos).hwnd), ); VkResult::VK_SUCCESS } @@ -1494,14 +1853,28 @@ pub fn gfxCreateWin32SurfaceKHR( unsafe { assert_eq!((*pCreateInfos).flags, 0); assert!(pAllocator.is_null()); - *pSurface = Handle::new( - instance.create_surface_from_hwnd( - (*pCreateInfos).hwnd, - ) - ); + *pSurface = Handle::new(instance.create_surface_from_hwnd((*pCreateInfos).hwnd)); VkResult::VK_SUCCESS } } #[cfg(not(target_os = "windows"))] unreachable!() } +#[inline] +pub extern "C" fn gfxAcquireNextImageKHR( + device: VkDevice, + swapchain: VkSwapchainKHR, + timeout: u64, + semaphore: VkSemaphore, + fence: VkFence, + pImageIndex: *mut u32, +) -> VkResult { + unimplemented!() +} +#[inline] +pub extern "C" fn gfxQueuePresentKHR( + queue: VkQueue, + pPresentInfo: *const VkPresentInfoKHR, +) -> VkResult { + unimplemented!() +} diff --git a/libportability-icd/src/lib.rs b/libportability-icd/src/lib.rs index 7bdcd06..9f3e184 100644 --- a/libportability-icd/src/lib.rs +++ b/libportability-icd/src/lib.rs @@ -22,8 +22,9 @@ macro_rules! proc_addr { } #[no_mangle] -pub extern fn vk_icdGetInstanceProcAddr( - instance: VkInstance, pName: *const ::std::os::raw::c_char, +pub extern "C" fn vk_icdGetInstanceProcAddr( + instance: VkInstance, + pName: *const ::std::os::raw::c_char, ) -> PFN_vkVoidFunction { let name = unsafe { CStr::from_ptr(pName) }; let name = match name.to_str() { @@ -38,7 +39,7 @@ pub extern fn vk_icdGetInstanceProcAddr( } #[no_mangle] -pub extern fn vk_icdNegotiateLoaderICDInterfaceVersion( +pub extern "C" fn vk_icdNegotiateLoaderICDInterfaceVersion( pSupportedVersion: *mut ::std::os::raw::c_uint, ) -> VkResult { let supported_version = unsafe { &mut *pSupportedVersion }; @@ -50,9 +51,9 @@ pub extern fn vk_icdNegotiateLoaderICDInterfaceVersion( } #[no_mangle] -pub extern fn vk_icdGetPhysicalDeviceProcAddr( - instance: VkInstance, pName: *const ::std::os::raw::c_char, +pub extern "C" fn vk_icdGetPhysicalDeviceProcAddr( + instance: VkInstance, + pName: *const ::std::os::raw::c_char, ) -> PFN_vkVoidFunction { unimplemented!() } - diff --git a/libportability/src/lib.rs b/libportability/src/lib.rs index 6f5a6a1..a44d35d 100644 --- a/libportability/src/lib.rs +++ b/libportability/src/lib.rs @@ -5,7 +5,7 @@ extern crate portability_gfx; use portability_gfx::*; #[no_mangle] -pub extern fn vkCreateInstance( +pub extern "C" fn vkCreateInstance( pCreateInfo: *const VkInstanceCreateInfo, pAllocator: *const VkAllocationCallbacks, pInstance: *mut VkInstance, @@ -14,7 +14,7 @@ pub extern fn vkCreateInstance( } #[no_mangle] -pub extern fn vkDestroyInstance( +pub extern "C" fn vkDestroyInstance( instance: VkInstance, pAllocator: *const VkAllocationCallbacks, ) { @@ -22,7 +22,7 @@ pub extern fn vkDestroyInstance( } #[no_mangle] -pub extern fn vkEnumeratePhysicalDevices( +pub extern "C" fn vkEnumeratePhysicalDevices( instance: VkInstance, pPhysicalDeviceCount: *mut u32, pPhysicalDevices: *mut VkPhysicalDevice, @@ -31,22 +31,26 @@ pub extern fn vkEnumeratePhysicalDevices( } #[no_mangle] -pub extern fn vkGetPhysicalDeviceQueueFamilyProperties( +pub extern "C" fn vkGetPhysicalDeviceQueueFamilyProperties( adapter: VkPhysicalDevice, pQueueFamilyPropertyCount: *mut u32, pQueueFamilyProperties: *mut VkQueueFamilyProperties, ) { - gfxGetPhysicalDeviceQueueFamilyProperties(adapter, pQueueFamilyPropertyCount, pQueueFamilyProperties) + gfxGetPhysicalDeviceQueueFamilyProperties( + adapter, + pQueueFamilyPropertyCount, + pQueueFamilyProperties, + ) } #[no_mangle] -pub extern fn vkGetPhysicalDeviceMemoryProperties( +pub extern "C" fn vkGetPhysicalDeviceMemoryProperties( physicalDevice: VkPhysicalDevice, pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties, ) { gfxGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties) } #[no_mangle] -pub extern fn vkCreateDevice( +pub extern "C" fn vkCreateDevice( adapter: VkPhysicalDevice, pCreateInfo: *const VkDeviceCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -55,7 +59,7 @@ pub extern fn vkCreateDevice( gfxCreateDevice(adapter, pCreateInfo, pAllocator, pDevice) } #[no_mangle] -pub extern fn vkAllocateMemory( +pub extern "C" fn vkAllocateMemory( device: VkDevice, pAllocateInfo: *const VkMemoryAllocateInfo, pAllocator: *const VkAllocationCallbacks, @@ -64,7 +68,7 @@ pub extern fn vkAllocateMemory( gfxAllocateMemory(device, pAllocateInfo, pAllocator, pMemory) } #[no_mangle] -pub extern fn vkFreeMemory( +pub extern "C" fn vkFreeMemory( device: VkDevice, memory: VkDeviceMemory, pAllocator: *const VkAllocationCallbacks, @@ -72,7 +76,7 @@ pub extern fn vkFreeMemory( gfxFreeMemory(device, memory, pAllocator) } #[no_mangle] -pub extern fn vkBindImageMemory( +pub extern "C" fn vkBindImageMemory( device: VkDevice, image: VkImage, memory: VkDeviceMemory, @@ -81,7 +85,7 @@ pub extern fn vkBindImageMemory( gfxBindImageMemory(device, image, memory, memoryOffset) } #[no_mangle] -pub extern fn vkBindBufferMemory( +pub extern "C" fn vkBindBufferMemory( device: VkDevice, buffer: VkBuffer, memory: VkDeviceMemory, @@ -90,14 +94,11 @@ pub extern fn vkBindBufferMemory( gfxBindBufferMemory(device, buffer, memory, memoryOffset) } #[no_mangle] -pub extern fn vkDestroyDevice( - device: VkDevice, - pAllocator: *const VkAllocationCallbacks, -) { +pub extern "C" fn vkDestroyDevice(device: VkDevice, pAllocator: *const VkAllocationCallbacks) { gfxDestroyDevice(device, pAllocator) } #[no_mangle] -pub extern fn vkCreateImage( +pub extern "C" fn vkCreateImage( device: VkDevice, pCreateInfo: *const VkImageCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -106,7 +107,7 @@ pub extern fn vkCreateImage( gfxCreateImage(device, pCreateInfo, pAllocator, pImage) } #[no_mangle] -pub extern fn vkCreateImageView( +pub extern "C" fn vkCreateImageView( device: VkDevice, pCreateInfo: *const VkImageViewCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -115,7 +116,7 @@ pub extern fn vkCreateImageView( gfxCreateImageView(device, pCreateInfo, pAllocator, pView) } #[no_mangle] -pub extern fn vkGetImageMemoryRequirements( +pub extern "C" fn vkGetImageMemoryRequirements( device: VkDevice, image: VkImage, pMemoryRequirements: *mut VkMemoryRequirements, @@ -123,7 +124,7 @@ pub extern fn vkGetImageMemoryRequirements( gfxGetImageMemoryRequirements(device, image, pMemoryRequirements) } #[no_mangle] -pub extern fn vkDestroyImageView( +pub extern "C" fn vkDestroyImageView( device: VkDevice, imageView: VkImageView, pAllocator: *const VkAllocationCallbacks, @@ -131,7 +132,7 @@ pub extern fn vkDestroyImageView( gfxDestroyImageView(device, imageView, pAllocator) } #[no_mangle] -pub extern fn vkGetPhysicalDeviceFormatProperties( +pub extern "C" fn vkGetPhysicalDeviceFormatProperties( adapter: VkPhysicalDevice, format: VkFormat, pFormatProperties: *mut VkFormatProperties, @@ -140,7 +141,7 @@ pub extern fn vkGetPhysicalDeviceFormatProperties( } #[no_mangle] -pub extern fn vkCreateCommandPool( +pub extern "C" fn vkCreateCommandPool( device: VkDevice, pCreateInfo: *const VkCommandPoolCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -150,7 +151,7 @@ pub extern fn vkCreateCommandPool( } #[no_mangle] -pub extern fn vkDestroyCommandPool( +pub extern "C" fn vkDestroyCommandPool( device: VkDevice, commandPool: VkCommandPool, pAllocator: *const VkAllocationCallbacks, @@ -159,7 +160,7 @@ pub extern fn vkDestroyCommandPool( } #[no_mangle] -pub extern fn vkResetCommandPool( +pub extern "C" fn vkResetCommandPool( device: VkDevice, commandPool: VkCommandPool, flags: VkCommandPoolResetFlags, @@ -168,7 +169,7 @@ pub extern fn vkResetCommandPool( } #[no_mangle] -pub extern fn vkAllocateCommandBuffers( +pub extern "C" fn vkAllocateCommandBuffers( device: VkDevice, pAllocateInfo: *const VkCommandBufferAllocateInfo, pCommandBuffers: *mut VkCommandBuffer, @@ -177,7 +178,7 @@ pub extern fn vkAllocateCommandBuffers( } #[no_mangle] -pub extern fn vkFreeCommandBuffers( +pub extern "C" fn vkFreeCommandBuffers( device: VkDevice, commandPool: VkCommandPool, commandBufferCount: u32, @@ -187,7 +188,7 @@ pub extern fn vkFreeCommandBuffers( } #[no_mangle] -pub extern fn vkDestroySurfaceKHR( +pub extern "C" fn vkDestroySurfaceKHR( instance: VkInstance, surface: VkSurfaceKHR, pAllocator: *const VkAllocationCallbacks, @@ -196,7 +197,7 @@ pub extern fn vkDestroySurfaceKHR( } #[no_mangle] -pub extern fn vkGetPhysicalDeviceSurfaceSupportKHR( +pub extern "C" fn vkGetPhysicalDeviceSurfaceSupportKHR( adapter: VkPhysicalDevice, queueFamilyIndex: u32, surface: VkSurfaceKHR, @@ -206,7 +207,7 @@ pub extern fn vkGetPhysicalDeviceSurfaceSupportKHR( } #[no_mangle] -pub extern fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR( +pub extern "C" fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR( adapter: VkPhysicalDevice, surface: VkSurfaceKHR, pSurfaceCapabilities: *mut VkSurfaceCapabilitiesKHR, @@ -215,7 +216,7 @@ pub extern fn vkGetPhysicalDeviceSurfaceCapabilitiesKHR( } #[no_mangle] -pub extern fn vkGetPhysicalDeviceSurfaceFormatsKHR( +pub extern "C" fn vkGetPhysicalDeviceSurfaceFormatsKHR( adapter: VkPhysicalDevice, surface: VkSurfaceKHR, pSurfaceFormatCount: *mut u32, @@ -225,7 +226,7 @@ pub extern fn vkGetPhysicalDeviceSurfaceFormatsKHR( } #[no_mangle] -pub extern fn vkGetPhysicalDeviceSurfacePresentModesKHR( +pub extern "C" fn vkGetPhysicalDeviceSurfacePresentModesKHR( adapter: VkPhysicalDevice, surface: VkSurfaceKHR, pPresentModeCount: *mut u32, @@ -235,7 +236,7 @@ pub extern fn vkGetPhysicalDeviceSurfacePresentModesKHR( } #[no_mangle] -pub extern fn vkCreateSwapchainKHR( +pub extern "C" fn vkCreateSwapchainKHR( device: VkDevice, pCreateInfo: *const VkSwapchainCreateInfoKHR, pAllocator: *const VkAllocationCallbacks, @@ -244,7 +245,7 @@ pub extern fn vkCreateSwapchainKHR( gfxCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain) } #[no_mangle] -pub extern fn vkDestroySwapchainKHR( +pub extern "C" fn vkDestroySwapchainKHR( device: VkDevice, swapchain: VkSwapchainKHR, pAllocator: *const VkAllocationCallbacks, @@ -252,7 +253,7 @@ pub extern fn vkDestroySwapchainKHR( gfxDestroySwapchainKHR(device, swapchain, pAllocator) } #[no_mangle] -pub extern fn vkGetSwapchainImagesKHR( +pub extern "C" fn vkGetSwapchainImagesKHR( device: VkDevice, swapchain: VkSwapchainKHR, pSwapchainImageCount: *mut u32, @@ -262,7 +263,7 @@ pub extern fn vkGetSwapchainImagesKHR( } #[no_mangle] -pub extern fn vkCreateWin32SurfaceKHR( +pub extern "C" fn vkCreateWin32SurfaceKHR( instance: VkInstance, pCreateInfos: *const VkWin32SurfaceCreateInfoKHR, pAllocator: *const VkAllocationCallbacks, @@ -272,7 +273,7 @@ pub extern fn vkCreateWin32SurfaceKHR( } #[no_mangle] -pub extern fn vkMapMemory( +pub extern "C" fn vkMapMemory( device: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, @@ -280,23 +281,16 @@ pub extern fn vkMapMemory( flags: VkMemoryMapFlags, ppData: *mut *mut ::std::os::raw::c_void, ) -> VkResult { - gfxMapMemory( - device, - memory, - offset, - size, - flags, - ppData, - ) + gfxMapMemory(device, memory, offset, size, flags, ppData) } #[no_mangle] -pub extern fn vkUnmapMemory(device: VkDevice, memory: VkDeviceMemory) { +pub extern "C" fn vkUnmapMemory(device: VkDevice, memory: VkDeviceMemory) { gfxUnmapMemory(device, memory) } #[no_mangle] -pub extern fn vkDestroyImage( +pub extern "C" fn vkDestroyImage( device: VkDevice, image: VkImage, pAllocator: *const VkAllocationCallbacks, @@ -305,7 +299,7 @@ pub extern fn vkDestroyImage( } #[no_mangle] -pub extern fn vkCreateBuffer( +pub extern "C" fn vkCreateBuffer( device: VkDevice, pCreateInfo: *const VkBufferCreateInfo, pAllocator: *const VkAllocationCallbacks, @@ -315,7 +309,7 @@ pub extern fn vkCreateBuffer( } #[no_mangle] -pub extern fn vkDestroyBuffer( +pub extern "C" fn vkDestroyBuffer( device: VkDevice, buffer: VkBuffer, pAllocator: *const VkAllocationCallbacks, @@ -324,10 +318,1038 @@ pub extern fn vkDestroyBuffer( } #[no_mangle] -pub extern fn vkGetBufferMemoryRequirements( +pub extern "C" fn vkGetBufferMemoryRequirements( device: VkDevice, buffer: VkBuffer, pMemoryRequirements: *mut VkMemoryRequirements, ) { gfxGetBufferMemoryRequirements(device, buffer, pMemoryRequirements) } +#[no_mangle] +pub extern "C" fn vkGetInstanceProcAddr( + instance: VkInstance, + pName: *const ::std::os::raw::c_char, +) -> PFN_vkVoidFunction { + gfxGetInstanceProcAddr(instance, pName) +} +#[no_mangle] +pub extern "C" fn vkGetDeviceProcAddr( + device: VkDevice, + pName: *const ::std::os::raw::c_char, +) -> PFN_vkVoidFunction { + gfxGetDeviceProcAddr(device, pName) +} +#[no_mangle] +pub extern "C" fn vkGetPhysicalDeviceFeatures( + physicalDevice: VkPhysicalDevice, + pFeatures: *mut VkPhysicalDeviceFeatures, +) { + gfxGetPhysicalDeviceFeatures(physicalDevice, pFeatures) +} +#[no_mangle] +pub extern "C" fn vkGetPhysicalDeviceImageFormatProperties( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + tiling: VkImageTiling, + usage: VkImageUsageFlags, + flags: VkImageCreateFlags, + pImageFormatProperties: *mut VkImageFormatProperties, +) -> VkResult { + gfxGetPhysicalDeviceImageFormatProperties( + physicalDevice, + format, + type_, + tiling, + usage, + flags, + pImageFormatProperties, + ) +} +#[no_mangle] +pub extern "C" fn vkGetPhysicalDeviceProperties( + physicalDevice: VkPhysicalDevice, + pProperties: *mut VkPhysicalDeviceProperties, +) { + gfxGetPhysicalDeviceProperties(physicalDevice, pProperties) +} +#[no_mangle] +pub extern "C" fn vkEnumerateDeviceExtensionProperties( + physicalDevice: VkPhysicalDevice, + pLayerName: *const ::std::os::raw::c_char, + pPropertyCount: *mut u32, + pProperties: *mut VkExtensionProperties, +) -> VkResult { + gfxEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties) +} +#[no_mangle] +pub extern "C" fn vkEnumerateInstanceLayerProperties( + pPropertyCount: *mut u32, + pProperties: *mut VkLayerProperties, +) -> VkResult { + gfxEnumerateInstanceLayerProperties(pPropertyCount, pProperties) +} +#[no_mangle] +pub extern "C" fn vkEnumerateDeviceLayerProperties( + physicalDevice: VkPhysicalDevice, + pPropertyCount: *mut u32, + pProperties: *mut VkLayerProperties, +) -> VkResult { + gfxEnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties) +} +#[no_mangle] +pub extern "C" fn vkGetDeviceQueue( + device: VkDevice, + queueFamilyIndex: u32, + queueIndex: u32, + pQueue: *mut VkQueue, +) { + gfxGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue) +} +#[no_mangle] +pub extern "C" fn vkQueueSubmit( + queue: VkQueue, + submitCount: u32, + pSubmits: *const VkSubmitInfo, + fence: VkFence, +) -> VkResult { + gfxQueueSubmit(queue, submitCount, pSubmits, fence) +} +#[no_mangle] +pub extern "C" fn vkQueueWaitIdle(queue: VkQueue) -> VkResult { + gfxQueueWaitIdle(queue) +} +#[no_mangle] +pub extern "C" fn vkDeviceWaitIdle(device: VkDevice) -> VkResult { + gfxDeviceWaitIdle(device) +} +#[no_mangle] +pub extern "C" fn vkFlushMappedMemoryRanges( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, +) -> VkResult { + gfxFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges) +} +#[no_mangle] +pub extern "C" fn vkInvalidateMappedMemoryRanges( + device: VkDevice, + memoryRangeCount: u32, + pMemoryRanges: *const VkMappedMemoryRange, +) -> VkResult { + gfxInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges) +} +#[no_mangle] +pub extern "C" fn vkGetDeviceMemoryCommitment( + device: VkDevice, + memory: VkDeviceMemory, + pCommittedMemoryInBytes: *mut VkDeviceSize, +) { + gfxGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes) +} +#[no_mangle] +pub extern "C" fn vkGetImageSparseMemoryRequirements( + device: VkDevice, + image: VkImage, + pSparseMemoryRequirementCount: *mut u32, + pSparseMemoryRequirements: *mut VkSparseImageMemoryRequirements, +) { + gfxGetImageSparseMemoryRequirements( + device, + image, + pSparseMemoryRequirementCount, + pSparseMemoryRequirements, + ) +} +#[no_mangle] +pub extern "C" fn vkGetPhysicalDeviceSparseImageFormatProperties( + physicalDevice: VkPhysicalDevice, + format: VkFormat, + type_: VkImageType, + samples: VkSampleCountFlagBits, + usage: VkImageUsageFlags, + tiling: VkImageTiling, + pPropertyCount: *mut u32, + pProperties: *mut VkSparseImageFormatProperties, +) { + gfxGetPhysicalDeviceSparseImageFormatProperties( + physicalDevice, + format, + type_, + samples, + usage, + tiling, + pPropertyCount, + pProperties, + ) +} +#[no_mangle] +pub extern "C" fn vkQueueBindSparse( + queue: VkQueue, + bindInfoCount: u32, + pBindInfo: *const VkBindSparseInfo, + fence: VkFence, +) -> VkResult { + gfxQueueBindSparse(queue, bindInfoCount, pBindInfo, fence) +} +#[no_mangle] +pub extern "C" fn vkCreateFence( + device: VkDevice, + pCreateInfo: *const VkFenceCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFence: *mut VkFence, +) -> VkResult { + gfxCreateFence(device, pCreateInfo, pAllocator, pFence) +} +#[no_mangle] +pub extern "C" fn vkDestroyFence( + device: VkDevice, + fence: VkFence, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyFence(device, fence, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkResetFences( + device: VkDevice, + fenceCount: u32, + pFences: *const VkFence, +) -> VkResult { + gfxResetFences(device, fenceCount, pFences) +} +#[no_mangle] +pub extern "C" fn vkGetFenceStatus(device: VkDevice, fence: VkFence) -> VkResult { + gfxGetFenceStatus(device, fence) +} +#[no_mangle] +pub extern "C" fn vkWaitForFences( + device: VkDevice, + fenceCount: u32, + pFences: *const VkFence, + waitAll: VkBool32, + timeout: u64, +) -> VkResult { + gfxWaitForFences(device, fenceCount, pFences, waitAll, timeout) +} +#[no_mangle] +pub extern "C" fn vkCreateSemaphore( + device: VkDevice, + pCreateInfo: *const VkSemaphoreCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSemaphore: *mut VkSemaphore, +) -> VkResult { + gfxCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore) +} +#[no_mangle] +pub extern "C" fn vkDestroySemaphore( + device: VkDevice, + semaphore: VkSemaphore, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroySemaphore(device, semaphore, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreateEvent( + device: VkDevice, + pCreateInfo: *const VkEventCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pEvent: *mut VkEvent, +) -> VkResult { + gfxCreateEvent(device, pCreateInfo, pAllocator, pEvent) +} +#[no_mangle] +pub extern "C" fn vkDestroyEvent( + device: VkDevice, + event: VkEvent, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyEvent(device, event, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkGetEventStatus(device: VkDevice, event: VkEvent) -> VkResult { + gfxGetEventStatus(device, event) +} +#[no_mangle] +pub extern "C" fn vkSetEvent(device: VkDevice, event: VkEvent) -> VkResult { + gfxSetEvent(device, event) +} +#[no_mangle] +pub extern "C" fn vkResetEvent(device: VkDevice, event: VkEvent) -> VkResult { + gfxResetEvent(device, event) +} +#[no_mangle] +pub extern "C" fn vkCreateQueryPool( + device: VkDevice, + pCreateInfo: *const VkQueryPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pQueryPool: *mut VkQueryPool, +) -> VkResult { + gfxCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool) +} +#[no_mangle] +pub extern "C" fn vkDestroyQueryPool( + device: VkDevice, + queryPool: VkQueryPool, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyQueryPool(device, queryPool, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkGetQueryPoolResults( + device: VkDevice, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dataSize: usize, + pData: *mut ::std::os::raw::c_void, + stride: VkDeviceSize, + flags: VkQueryResultFlags, +) -> VkResult { + gfxGetQueryPoolResults( + device, + queryPool, + firstQuery, + queryCount, + dataSize, + pData, + stride, + flags, + ) +} +#[no_mangle] +pub extern "C" fn vkCreateBufferView( + device: VkDevice, + pCreateInfo: *const VkBufferViewCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pView: *mut VkBufferView, +) -> VkResult { + gfxCreateBufferView(device, pCreateInfo, pAllocator, pView) +} +#[no_mangle] +pub extern "C" fn vkDestroyBufferView( + device: VkDevice, + bufferView: VkBufferView, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyBufferView(device, bufferView, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkGetImageSubresourceLayout( + device: VkDevice, + image: VkImage, + pSubresource: *const VkImageSubresource, + pLayout: *mut VkSubresourceLayout, +) { + gfxGetImageSubresourceLayout(device, image, pSubresource, pLayout) +} +#[no_mangle] +pub extern "C" fn vkCreateShaderModule( + device: VkDevice, + pCreateInfo: *const VkShaderModuleCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pShaderModule: *mut VkShaderModule, +) -> VkResult { + gfxCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule) +} +#[no_mangle] +pub extern "C" fn vkDestroyShaderModule( + device: VkDevice, + shaderModule: VkShaderModule, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyShaderModule(device, shaderModule, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreatePipelineCache( + device: VkDevice, + pCreateInfo: *const VkPipelineCacheCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineCache: *mut VkPipelineCache, +) -> VkResult { + gfxCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache) +} +#[no_mangle] +pub extern "C" fn vkDestroyPipelineCache( + device: VkDevice, + pipelineCache: VkPipelineCache, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyPipelineCache(device, pipelineCache, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkGetPipelineCacheData( + device: VkDevice, + pipelineCache: VkPipelineCache, + pDataSize: *mut usize, + pData: *mut ::std::os::raw::c_void, +) -> VkResult { + gfxGetPipelineCacheData(device, pipelineCache, pDataSize, pData) +} +#[no_mangle] +pub extern "C" fn vkMergePipelineCaches( + device: VkDevice, + dstCache: VkPipelineCache, + srcCacheCount: u32, + pSrcCaches: *const VkPipelineCache, +) -> VkResult { + gfxMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches) +} +#[no_mangle] +pub extern "C" fn vkCreateGraphicsPipelines( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkGraphicsPipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, +) -> VkResult { + gfxCreateGraphicsPipelines( + device, + pipelineCache, + createInfoCount, + pCreateInfos, + pAllocator, + pPipelines, + ) +} +#[no_mangle] +pub extern "C" fn vkCreateComputePipelines( + device: VkDevice, + pipelineCache: VkPipelineCache, + createInfoCount: u32, + pCreateInfos: *const VkComputePipelineCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelines: *mut VkPipeline, +) -> VkResult { + gfxCreateComputePipelines( + device, + pipelineCache, + createInfoCount, + pCreateInfos, + pAllocator, + pPipelines, + ) +} +#[no_mangle] +pub extern "C" fn vkDestroyPipeline( + device: VkDevice, + pipeline: VkPipeline, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyPipeline(device, pipeline, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreatePipelineLayout( + device: VkDevice, + pCreateInfo: *const VkPipelineLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pPipelineLayout: *mut VkPipelineLayout, +) -> VkResult { + gfxCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout) +} +#[no_mangle] +pub extern "C" fn vkDestroyPipelineLayout( + device: VkDevice, + pipelineLayout: VkPipelineLayout, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyPipelineLayout(device, pipelineLayout, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreateSampler( + device: VkDevice, + pCreateInfo: *const VkSamplerCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSampler: *mut VkSampler, +) -> VkResult { + gfxCreateSampler(device, pCreateInfo, pAllocator, pSampler) +} +#[no_mangle] +pub extern "C" fn vkDestroySampler( + device: VkDevice, + sampler: VkSampler, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroySampler(device, sampler, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreateDescriptorSetLayout( + device: VkDevice, + pCreateInfo: *const VkDescriptorSetLayoutCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pSetLayout: *mut VkDescriptorSetLayout, +) -> VkResult { + gfxCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout) +} +#[no_mangle] +pub extern "C" fn vkDestroyDescriptorSetLayout( + device: VkDevice, + descriptorSetLayout: VkDescriptorSetLayout, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreateDescriptorPool( + device: VkDevice, + pCreateInfo: *const VkDescriptorPoolCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pDescriptorPool: *mut VkDescriptorPool, +) -> VkResult { + gfxCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool) +} +#[no_mangle] +pub extern "C" fn vkDestroyDescriptorPool( + device: VkDevice, + descriptorPool: VkDescriptorPool, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyDescriptorPool(device, descriptorPool, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkResetDescriptorPool( + device: VkDevice, + descriptorPool: VkDescriptorPool, + flags: VkDescriptorPoolResetFlags, +) -> VkResult { + gfxResetDescriptorPool(device, descriptorPool, flags) +} +#[no_mangle] +pub extern "C" fn vkAllocateDescriptorSets( + device: VkDevice, + pAllocateInfo: *const VkDescriptorSetAllocateInfo, + pDescriptorSets: *mut VkDescriptorSet, +) -> VkResult { + gfxAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets) +} +#[no_mangle] +pub extern "C" fn vkFreeDescriptorSets( + device: VkDevice, + descriptorPool: VkDescriptorPool, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, +) -> VkResult { + gfxFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets) +} +#[no_mangle] +pub extern "C" fn vkUpdateDescriptorSets( + device: VkDevice, + descriptorWriteCount: u32, + pDescriptorWrites: *const VkWriteDescriptorSet, + descriptorCopyCount: u32, + pDescriptorCopies: *const VkCopyDescriptorSet, +) { + gfxUpdateDescriptorSets( + device, + descriptorWriteCount, + pDescriptorWrites, + descriptorCopyCount, + pDescriptorCopies, + ) +} +#[no_mangle] +pub extern "C" fn vkCreateFramebuffer( + device: VkDevice, + pCreateInfo: *const VkFramebufferCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pFramebuffer: *mut VkFramebuffer, +) -> VkResult { + gfxCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer) +} +#[no_mangle] +pub extern "C" fn vkDestroyFramebuffer( + device: VkDevice, + framebuffer: VkFramebuffer, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyFramebuffer(device, framebuffer, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkCreateRenderPass( + device: VkDevice, + pCreateInfo: *const VkRenderPassCreateInfo, + pAllocator: *const VkAllocationCallbacks, + pRenderPass: *mut VkRenderPass, +) -> VkResult { + gfxCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass) +} +#[no_mangle] +pub extern "C" fn vkDestroyRenderPass( + device: VkDevice, + renderPass: VkRenderPass, + pAllocator: *const VkAllocationCallbacks, +) { + gfxDestroyRenderPass(device, renderPass, pAllocator) +} +#[no_mangle] +pub extern "C" fn vkGetRenderAreaGranularity( + device: VkDevice, + renderPass: VkRenderPass, + pGranularity: *mut VkExtent2D, +) { + gfxGetRenderAreaGranularity(device, renderPass, pGranularity) +} + +#[no_mangle] +pub extern "C" fn vkBeginCommandBuffer( + commandBuffer: VkCommandBuffer, + pBeginInfo: *const VkCommandBufferBeginInfo, +) -> VkResult { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkEndCommandBuffer(commandBuffer: VkCommandBuffer) -> VkResult { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkResetCommandBuffer( + commandBuffer: VkCommandBuffer, + flags: VkCommandBufferResetFlags, +) -> VkResult { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBindPipeline( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + pipeline: VkPipeline, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetViewport( + commandBuffer: VkCommandBuffer, + firstViewport: u32, + viewportCount: u32, + pViewports: *const VkViewport, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetScissor( + commandBuffer: VkCommandBuffer, + firstScissor: u32, + scissorCount: u32, + pScissors: *const VkRect2D, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetLineWidth(commandBuffer: VkCommandBuffer, lineWidth: f32) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetDepthBias( + commandBuffer: VkCommandBuffer, + depthBiasConstantFactor: f32, + depthBiasClamp: f32, + depthBiasSlopeFactor: f32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetBlendConstants( + commandBuffer: VkCommandBuffer, + blendConstants: *const f32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetDepthBounds( + commandBuffer: VkCommandBuffer, + minDepthBounds: f32, + maxDepthBounds: f32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetStencilCompareMask( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + compareMask: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetStencilWriteMask( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + writeMask: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetStencilReference( + commandBuffer: VkCommandBuffer, + faceMask: VkStencilFaceFlags, + reference: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBindDescriptorSets( + commandBuffer: VkCommandBuffer, + pipelineBindPoint: VkPipelineBindPoint, + layout: VkPipelineLayout, + firstSet: u32, + descriptorSetCount: u32, + pDescriptorSets: *const VkDescriptorSet, + dynamicOffsetCount: u32, + pDynamicOffsets: *const u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBindIndexBuffer( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + indexType: VkIndexType, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBindVertexBuffers( + commandBuffer: VkCommandBuffer, + firstBinding: u32, + bindingCount: u32, + pBuffers: *const VkBuffer, + pOffsets: *const VkDeviceSize, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDraw( + commandBuffer: VkCommandBuffer, + vertexCount: u32, + instanceCount: u32, + firstVertex: u32, + firstInstance: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDrawIndexed( + commandBuffer: VkCommandBuffer, + indexCount: u32, + instanceCount: u32, + firstIndex: u32, + vertexOffset: i32, + firstInstance: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDrawIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDrawIndexedIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, + drawCount: u32, + stride: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDispatch( + commandBuffer: VkCommandBuffer, + groupCountX: u32, + groupCountY: u32, + groupCountZ: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdDispatchIndirect( + commandBuffer: VkCommandBuffer, + buffer: VkBuffer, + offset: VkDeviceSize, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdCopyBuffer( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferCopy, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdCopyImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageCopy, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBlitImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageBlit, + filter: VkFilter, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdCopyBufferToImage( + commandBuffer: VkCommandBuffer, + srcBuffer: VkBuffer, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkBufferImageCopy, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdCopyImageToBuffer( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstBuffer: VkBuffer, + regionCount: u32, + pRegions: *const VkBufferImageCopy, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdUpdateBuffer( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + dataSize: VkDeviceSize, + pData: *const ::std::os::raw::c_void, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdFillBuffer( + commandBuffer: VkCommandBuffer, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + size: VkDeviceSize, + data: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdClearColorImage( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pColor: *const VkClearColorValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdClearDepthStencilImage( + commandBuffer: VkCommandBuffer, + image: VkImage, + imageLayout: VkImageLayout, + pDepthStencil: *const VkClearDepthStencilValue, + rangeCount: u32, + pRanges: *const VkImageSubresourceRange, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdClearAttachments( + commandBuffer: VkCommandBuffer, + attachmentCount: u32, + pAttachments: *const VkClearAttachment, + rectCount: u32, + pRects: *const VkClearRect, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdResolveImage( + commandBuffer: VkCommandBuffer, + srcImage: VkImage, + srcImageLayout: VkImageLayout, + dstImage: VkImage, + dstImageLayout: VkImageLayout, + regionCount: u32, + pRegions: *const VkImageResolve, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdSetEvent( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdResetEvent( + commandBuffer: VkCommandBuffer, + event: VkEvent, + stageMask: VkPipelineStageFlags, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdWaitEvents( + 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, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdPipelineBarrier( + commandBuffer: VkCommandBuffer, + srcStageMask: VkPipelineStageFlags, + dstStageMask: VkPipelineStageFlags, + dependencyFlags: VkDependencyFlags, + memoryBarrierCount: u32, + pMemoryBarriers: *const VkMemoryBarrier, + bufferMemoryBarrierCount: u32, + pBufferMemoryBarriers: *const VkBufferMemoryBarrier, + imageMemoryBarrierCount: u32, + pImageMemoryBarriers: *const VkImageMemoryBarrier, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBeginQuery( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + query: u32, + flags: VkQueryControlFlags, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdEndQuery( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + query: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdResetQueryPool( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdWriteTimestamp( + commandBuffer: VkCommandBuffer, + pipelineStage: VkPipelineStageFlagBits, + queryPool: VkQueryPool, + query: u32, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdCopyQueryPoolResults( + commandBuffer: VkCommandBuffer, + queryPool: VkQueryPool, + firstQuery: u32, + queryCount: u32, + dstBuffer: VkBuffer, + dstOffset: VkDeviceSize, + stride: VkDeviceSize, + flags: VkQueryResultFlags, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdPushConstants( + commandBuffer: VkCommandBuffer, + layout: VkPipelineLayout, + stageFlags: VkShaderStageFlags, + offset: u32, + size: u32, + pValues: *const ::std::os::raw::c_void, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdBeginRenderPass( + commandBuffer: VkCommandBuffer, + pRenderPassBegin: *const VkRenderPassBeginInfo, + contents: VkSubpassContents, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdNextSubpass(commandBuffer: VkCommandBuffer, contents: VkSubpassContents) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdEndRenderPass(commandBuffer: VkCommandBuffer) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkCmdExecuteCommands( + commandBuffer: VkCommandBuffer, + commandBufferCount: u32, + pCommandBuffers: *const VkCommandBuffer, +) { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkAcquireNextImageKHR( + device: VkDevice, + swapchain: VkSwapchainKHR, + timeout: u64, + semaphore: VkSemaphore, + fence: VkFence, + pImageIndex: *mut u32, +) -> VkResult { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkQueuePresentKHR( + queue: VkQueue, + pPresentInfo: *const VkPresentInfoKHR, +) -> VkResult { + unimplemented!() +} +#[no_mangle] +pub extern "C" fn vkEnumerateInstanceExtensionProperties( + pLayerName: *const ::std::os::raw::c_char, + pPropertyCount: *mut u32, + pProperties: *mut VkExtensionProperties, +) -> VkResult { + gfxEnumerateInstanceExtensionProperties(pLayerName, pPropertyCount, pProperties) +}