logo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// This file is auto-generated by vulkano autogen from vk.xml header version 1.3.209.
// It should not be edited manually. Changes should be made by editing autogen.

#[doc = r" An enumeration of runtime errors that can be returned by Vulkan."]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[repr(i32)]
#[non_exhaustive]
pub enum VulkanError {
    OutOfHostMemory,
    OutOfDeviceMemory,
    InitializationFailed,
    DeviceLost,
    MemoryMapFailed,
    LayerNotPresent,
    ExtensionNotPresent,
    FeatureNotPresent,
    IncompatibleDriver,
    TooManyObjects,
    FormatNotSupported,
    FragmentedPool,
    Unknown,
    OutOfPoolMemory,
    InvalidExternalHandle,
    Fragmentation,
    InvalidOpaqueCaptureAddress,
    IncompatibleDisplay,
    NotPermitted,
    SurfaceLost,
    NativeWindowInUse,
    OutOfDate,
    ValidationFailed,
    FullScreenExclusiveModeLost,
    InvalidDrmFormatModifierPlaneLayout,
    InvalidShader,
    Unnamed(ash::vk::Result),
}
impl From<ash::vk::Result> for VulkanError {
    fn from(val: ash::vk::Result) -> VulkanError {
        match val {
            ash::vk::Result::ERROR_OUT_OF_HOST_MEMORY => Self::OutOfHostMemory,
            ash::vk::Result::ERROR_OUT_OF_DEVICE_MEMORY => Self::OutOfDeviceMemory,
            ash::vk::Result::ERROR_INITIALIZATION_FAILED => Self::InitializationFailed,
            ash::vk::Result::ERROR_DEVICE_LOST => Self::DeviceLost,
            ash::vk::Result::ERROR_MEMORY_MAP_FAILED => Self::MemoryMapFailed,
            ash::vk::Result::ERROR_LAYER_NOT_PRESENT => Self::LayerNotPresent,
            ash::vk::Result::ERROR_EXTENSION_NOT_PRESENT => Self::ExtensionNotPresent,
            ash::vk::Result::ERROR_FEATURE_NOT_PRESENT => Self::FeatureNotPresent,
            ash::vk::Result::ERROR_INCOMPATIBLE_DRIVER => Self::IncompatibleDriver,
            ash::vk::Result::ERROR_TOO_MANY_OBJECTS => Self::TooManyObjects,
            ash::vk::Result::ERROR_FORMAT_NOT_SUPPORTED => Self::FormatNotSupported,
            ash::vk::Result::ERROR_FRAGMENTED_POOL => Self::FragmentedPool,
            ash::vk::Result::ERROR_UNKNOWN => Self::Unknown,
            ash::vk::Result::ERROR_OUT_OF_POOL_MEMORY => Self::OutOfPoolMemory,
            ash::vk::Result::ERROR_INVALID_EXTERNAL_HANDLE => Self::InvalidExternalHandle,
            ash::vk::Result::ERROR_FRAGMENTATION => Self::Fragmentation,
            ash::vk::Result::ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS => {
                Self::InvalidOpaqueCaptureAddress
            }
            ash::vk::Result::ERROR_INCOMPATIBLE_DISPLAY_KHR => Self::IncompatibleDisplay,
            ash::vk::Result::ERROR_NOT_PERMITTED_KHR => Self::NotPermitted,
            ash::vk::Result::ERROR_SURFACE_LOST_KHR => Self::SurfaceLost,
            ash::vk::Result::ERROR_NATIVE_WINDOW_IN_USE_KHR => Self::NativeWindowInUse,
            ash::vk::Result::ERROR_OUT_OF_DATE_KHR => Self::OutOfDate,
            ash::vk::Result::ERROR_VALIDATION_FAILED_EXT => Self::ValidationFailed,
            ash::vk::Result::ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => {
                Self::FullScreenExclusiveModeLost
            }
            ash::vk::Result::ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT => {
                Self::InvalidDrmFormatModifierPlaneLayout
            }
            ash::vk::Result::ERROR_INVALID_SHADER_NV => Self::InvalidShader,
            x => Self::Unnamed(x),
        }
    }
}