pub fn check_vk(r: RawVkResult) -> VkResult<VkSuccess> {
    match r {
        // Success
        VK_SUCCESS => Ok(VkSuccess::Success),
        VK_NOT_READY => Ok(VkSuccess::NotReady),
        VK_TIMEOUT => Ok(VkSuccess::Timeout),
        VK_EVENT_SET => Ok(VkSuccess::EventSet),
        VK_EVENT_RESET => Ok(VkSuccess::EventReset),
        VK_INCOMPLETE => Ok(VkSuccess::Incomplete),
        // Error
        VK_ERROR_OUT_OF_HOST_MEMORY => Err(VkError::OutOfHostMemory),
        VK_ERROR_OUT_OF_DEVICE_MEMORY => Err(VkError::OutOfDeviceMemory),
        VK_ERROR_INITIALIZATION_FAILED => Err(VkError::InitializationFailed),
        VK_ERROR_DEVICE_LOST => Err(VkError::DeviceLost),
        VK_ERROR_MEMORY_MAP_FAILED => Err(VkError::MemoryMapFailed),
        VK_ERROR_LAYER_NOT_PRESENT => Err(VkError::LayerNotPresent),
        VK_ERROR_EXTENSION_NOT_PRESENT => Err(VkError::ExtensionNotPresent),
        VK_ERROR_FEATURE_NOT_PRESENT => Err(VkError::FeatureNotPresent),
        VK_ERROR_INCOMPATIBLE_DRIVER => Err(VkError::IncompatibleDriver),
        VK_ERROR_TOO_MANY_OBJECTS => Err(VkError::TooManyObjects),
        VK_ERROR_FORMAT_NOT_SUPPORTED => Err(VkError::FormatNotSupported),
        VK_ERROR_SURFACE_LOST_KHR => Err(VkError::SurfaceLostKhr),
        VK_ERROR_NATIVE_WINDOW_IN_USE_KHR => Err(VkError::NativeWindowInUseKhr),
        VK_SUBOPTIMAL_KHR => Err(VkError::SuboptimalKhr),
        VK_ERROR_OUT_OF_DATE_KHR => Err(VkError::OutOfDateKhr),
        VK_ERROR_INCOMPATIBLE_DISPLAY_KHR => Err(VkError::IncompatibleDisplayKhr),
        VK_ERROR_VALIDATION_FAILED_EXT => Err(VkError::ValidationFailedExt),
        VK_ERROR_OUT_OF_POOL_MEMORY_KHR => Err(VkError::OutOfPoolMemory),
        VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => {
            Err(VkError::FullscreenExclusiveModeLostExt)
        }
        VK_ERROR_INVALID_SHADER_NV => Err(VkError::InvalidShaderNv),
        VK_ERROR_UNKNOWN => Err(VkError::Unknown),
        r => panic_with_log!("Unexpected raw VkResult value: {}", r),
    }
}
/// Check VkResult and return corresponding result.
Check VkResult and return corresponding result.
Check VkResult and return corresponding result .
pub fn check_vk(r: RawVkResult) -> VkResult<VkSuccess> {
    match r {
        // Success
        VK_SUCCESS => Ok(VkSuccess::Success),
        VK_NOT_READY => Ok(VkSuccess::NotReady),
        VK_TIMEOUT => Ok(VkSuccess::Timeout),
        VK_EVENT_SET => Ok(VkSuccess::EventSet),
        VK_EVENT_RESET => Ok(VkSuccess::EventReset),
        VK_INCOMPLETE => Ok(VkSuccess::Incomplete),
        // Error
        VK_ERROR_OUT_OF_HOST_MEMORY => Err(VkError::OutOfHostMemory),
        VK_ERROR_OUT_OF_DEVICE_MEMORY => Err(VkError::OutOfDeviceMemory),
        VK_ERROR_INITIALIZATION_FAILED => Err(VkError::InitializationFailed),
        VK_ERROR_DEVICE_LOST => Err(VkError::DeviceLost),
        VK_ERROR_MEMORY_MAP_FAILED => Err(VkError::MemoryMapFailed),
        VK_ERROR_LAYER_NOT_PRESENT => Err(VkError::LayerNotPresent),
        VK_ERROR_EXTENSION_NOT_PRESENT => Err(VkError::ExtensionNotPresent),
        VK_ERROR_FEATURE_NOT_PRESENT => Err(VkError::FeatureNotPresent),
        VK_ERROR_INCOMPATIBLE_DRIVER => Err(VkError::IncompatibleDriver),
        VK_ERROR_TOO_MANY_OBJECTS => Err(VkError::TooManyObjects),
        VK_ERROR_FORMAT_NOT_SUPPORTED => Err(VkError::FormatNotSupported),
        VK_ERROR_SURFACE_LOST_KHR => Err(VkError::SurfaceLostKhr),
        VK_ERROR_NATIVE_WINDOW_IN_USE_KHR => Err(VkError::NativeWindowInUseKhr),
        VK_SUBOPTIMAL_KHR => Err(VkError::SuboptimalKhr),
        VK_ERROR_OUT_OF_DATE_KHR => Err(VkError::OutOfDateKhr),
        VK_ERROR_INCOMPATIBLE_DISPLAY_KHR => Err(VkError::IncompatibleDisplayKhr),
        VK_ERROR_VALIDATION_FAILED_EXT => Err(VkError::ValidationFailedExt),
        VK_ERROR_OUT_OF_POOL_MEMORY_KHR => Err(VkError::OutOfPoolMemory),
        VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => {
            Err(VkError::FullscreenExclusiveModeLostExt)
        }
        VK_ERROR_INVALID_SHADER_NV => Err(VkError::InvalidShaderNv),
        VK_ERROR_UNKNOWN => Err(VkError::Unknown),
        r => panic_with_log!("Unexpected raw VkResult value: {}", r),
    }
}
pub fn check_vk ( r : RawVkResult ) -> VkResult < VkSuccess > { match r { // Success VK_SUCCESS => Ok ( VkSuccess :: Success ) , VK_NOT_READY => Ok ( VkSuccess :: NotReady ) , VK_TIMEOUT => Ok ( VkSuccess :: Timeout ) , VK_EVENT_SET => Ok ( VkSuccess :: EventSet ) , VK_EVENT_RESET => Ok ( VkSuccess :: EventReset ) , VK_INCOMPLETE => Ok ( VkSuccess :: Incomplete ) , // Error VK_ERROR_OUT_OF_HOST_MEMORY => Err ( VkError :: OutOfHostMemory ) , VK_ERROR_OUT_OF_DEVICE_MEMORY => Err ( VkError :: OutOfDeviceMemory ) , VK_ERROR_INITIALIZATION_FAILED => Err ( VkError :: InitializationFailed ) , VK_ERROR_DEVICE_LOST => Err ( VkError :: DeviceLost ) , VK_ERROR_MEMORY_MAP_FAILED => Err ( VkError :: MemoryMapFailed ) , VK_ERROR_LAYER_NOT_PRESENT => Err ( VkError :: LayerNotPresent ) , VK_ERROR_EXTENSION_NOT_PRESENT => Err ( VkError :: ExtensionNotPresent ) , VK_ERROR_FEATURE_NOT_PRESENT => Err ( VkError :: FeatureNotPresent ) , VK_ERROR_INCOMPATIBLE_DRIVER => Err ( VkError :: IncompatibleDriver ) , VK_ERROR_TOO_MANY_OBJECTS => Err ( VkError :: TooManyObjects ) , VK_ERROR_FORMAT_NOT_SUPPORTED => Err ( VkError :: FormatNotSupported ) , VK_ERROR_SURFACE_LOST_KHR => Err ( VkError :: SurfaceLostKhr ) , VK_ERROR_NATIVE_WINDOW_IN_USE_KHR => Err ( VkError :: NativeWindowInUseKhr ) , VK_SUBOPTIMAL_KHR => Err ( VkError :: SuboptimalKhr ) , VK_ERROR_OUT_OF_DATE_KHR => Err ( VkError :: OutOfDateKhr ) , VK_ERROR_INCOMPATIBLE_DISPLAY_KHR => Err ( VkError :: IncompatibleDisplayKhr ) , VK_ERROR_VALIDATION_FAILED_EXT => Err ( VkError :: ValidationFailedExt ) , VK_ERROR_OUT_OF_POOL_MEMORY_KHR => Err ( VkError :: OutOfPoolMemory ) , VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => { Err ( VkError :: FullscreenExclusiveModeLostExt ) } VK_ERROR_INVALID_SHADER_NV => Err ( VkError :: InvalidShaderNv ) , VK_ERROR_UNKNOWN => Err ( VkError :: Unknown ) , r => panic_with_log ! ( " " r ) , } }
Check VkResult and return corresponding result.
Check VkResult and return corresponding result .
r
RawVkResult
r
RawVkResult