add more type asserts and fix api types
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 26 Sep 2018 03:41:56 +0000 (20:41 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 26 Sep 2018 03:41:56 +0000 (20:41 -0700)
vulkan-driver/src/lib.rs

index 2b256a35aa6c14b0621cb2343e44c58ccf0d4606..b66dd1dbccaca5368e7d7b8e076b1a8ea2da51ec 100644 (file)
@@ -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 {}