From bf41acc11fe2043128bd2334175547afda7bd121 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 25 Sep 2018 20:41:56 -0700 Subject: [PATCH] add more type asserts and fix api types --- vulkan-driver/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vulkan-driver/src/lib.rs b/vulkan-driver/src/lib.rs index 2b256a3..b66dd1d 100644 --- a/vulkan-driver/src/lib.rs +++ b/vulkan-driver/src/lib.rs @@ -21,8 +21,8 @@ const ASSERT_TYPE_VK_ICD_GET_INSTANCE_PROC_ADDR: api::PFN_vkGetInstanceProcAddr const ICD_VERSION: u32 = 5; #[no_mangle] -pub extern "system" fn vk_icdNegotiateLoaderICDInterfaceVersion( - supported_version: &mut u32, +pub unsafe extern "system" fn vk_icdNegotiateLoaderICDInterfaceVersion( + supported_version: *mut u32, ) -> api::VkResult { if *supported_version > ICD_VERSION { *supported_version = ICD_VERSION; @@ -30,6 +30,10 @@ pub extern "system" fn vk_icdNegotiateLoaderICDInterfaceVersion( api::VK_SUCCESS } +#[allow(dead_code)] +const ASSERT_TYPE_VK_ICD_NEGOTIATE_LOADER_ICD_INTERFACE_VERSION: + api::PFN_vkNegotiateLoaderICDInterfaceVersion = Some(vk_icdNegotiateLoaderICDInterfaceVersion); + #[no_mangle] pub extern "system" fn vk_icdGetPhysicalDeviceProcAddr( instance: api::VkInstance, @@ -93,5 +97,9 @@ pub extern "system" fn vk_icdGetPhysicalDeviceProcAddr( } } +#[allow(dead_code)] +const ASSERT_TYPE_VK_ICD_GET_PHYSICAL_DEVICE_PROC_ADDR: api::PFN_GetPhysicalDeviceProcAddr = + Some(vk_icdGetInstanceProcAddr); + #[cfg(test)] mod tests {} -- 2.30.2