1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #include "vulkan_interface.h" |
6 | |
7 | namespace vulkan { |
8 | |
9 | std::string VulkanResultToString(VkResult result) { |
10 | switch (result) { |
11 | case VK_SUCCESS: |
12 | return "VK_SUCCESS"; |
13 | case VK_NOT_READY: |
14 | return "VK_NOT_READY"; |
15 | case VK_TIMEOUT: |
16 | return "VK_TIMEOUT"; |
17 | case VK_EVENT_SET: |
18 | return "VK_EVENT_SET"; |
19 | case VK_EVENT_RESET: |
20 | return "VK_EVENT_RESET"; |
21 | case VK_INCOMPLETE: |
22 | return "VK_INCOMPLETE"; |
23 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
24 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
25 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
26 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
27 | case VK_ERROR_INITIALIZATION_FAILED: |
28 | return "VK_ERROR_INITIALIZATION_FAILED"; |
29 | case VK_ERROR_DEVICE_LOST: |
30 | return "VK_ERROR_DEVICE_LOST"; |
31 | case VK_ERROR_MEMORY_MAP_FAILED: |
32 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
33 | case VK_ERROR_LAYER_NOT_PRESENT: |
34 | return "VK_ERROR_LAYER_NOT_PRESENT"; |
35 | case VK_ERROR_EXTENSION_NOT_PRESENT: |
36 | return "VK_ERROR_EXTENSION_NOT_PRESENT"; |
37 | case VK_ERROR_FEATURE_NOT_PRESENT: |
38 | return "VK_ERROR_FEATURE_NOT_PRESENT"; |
39 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
40 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
41 | case VK_ERROR_TOO_MANY_OBJECTS: |
42 | return "VK_ERROR_TOO_MANY_OBJECTS"; |
43 | case VK_ERROR_FORMAT_NOT_SUPPORTED: |
44 | return "VK_ERROR_FORMAT_NOT_SUPPORTED"; |
45 | case VK_ERROR_FRAGMENTED_POOL: |
46 | return "VK_ERROR_FRAGMENTED_POOL"; |
47 | case VK_ERROR_SURFACE_LOST_KHR: |
48 | return "VK_ERROR_SURFACE_LOST_KHR"; |
49 | case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR: |
50 | return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"; |
51 | case VK_SUBOPTIMAL_KHR: |
52 | return "VK_SUBOPTIMAL_KHR"; |
53 | case VK_ERROR_OUT_OF_DATE_KHR: |
54 | return "VK_ERROR_OUT_OF_DATE_KHR"; |
55 | case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR: |
56 | return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR"; |
57 | case VK_ERROR_VALIDATION_FAILED_EXT: |
58 | return "VK_ERROR_VALIDATION_FAILED_EXT"; |
59 | case VK_ERROR_INVALID_SHADER_NV: |
60 | return "VK_ERROR_INVALID_SHADER_NV"; |
61 | case VK_RESULT_RANGE_SIZE: |
62 | return "VK_RESULT_RANGE_SIZE"; |
63 | case VK_RESULT_MAX_ENUM: |
64 | return "VK_RESULT_MAX_ENUM"; |
65 | case VK_ERROR_INVALID_EXTERNAL_HANDLE: |
66 | return "VK_ERROR_INVALID_EXTERNAL_HANDLE"; |
67 | case VK_ERROR_OUT_OF_POOL_MEMORY: |
68 | return "VK_ERROR_OUT_OF_POOL_MEMORY"; |
69 | default: |
70 | return "Unknown Error"; |
71 | } |
72 | return ""; |
73 | } |
74 | |
75 | } // namespace vulkan |
76 |