summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/vulkan/anv_util.c')
-rw-r--r--src/intel/vulkan/anv_util.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/intel/vulkan/anv_util.c b/src/intel/vulkan/anv_util.c
index 6d751870654..ec5c9486d8c 100644
--- a/src/intel/vulkan/anv_util.c
+++ b/src/intel/vulkan/anv_util.c
@@ -29,6 +29,7 @@
#include <assert.h>
#include "anv_private.h"
+#include "vk_enum_to_str.h"
/** Log an error message. */
void anv_printflike(1, 2)
@@ -69,40 +70,7 @@ __vk_errorf(VkResult error, const char *file, int line, const char *format, ...)
va_list ap;
char buffer[256];
-#define ERROR_CASE(error) case error: error_str = #error; break;
-
- const char *error_str;
- switch ((int32_t)error) {
-
- /* Core errors */
- ERROR_CASE(VK_ERROR_OUT_OF_HOST_MEMORY)
- ERROR_CASE(VK_ERROR_OUT_OF_DEVICE_MEMORY)
- ERROR_CASE(VK_ERROR_INITIALIZATION_FAILED)
- ERROR_CASE(VK_ERROR_DEVICE_LOST)
- ERROR_CASE(VK_ERROR_MEMORY_MAP_FAILED)
- ERROR_CASE(VK_ERROR_LAYER_NOT_PRESENT)
- ERROR_CASE(VK_ERROR_EXTENSION_NOT_PRESENT)
- ERROR_CASE(VK_ERROR_FEATURE_NOT_PRESENT)
- ERROR_CASE(VK_ERROR_INCOMPATIBLE_DRIVER)
- ERROR_CASE(VK_ERROR_TOO_MANY_OBJECTS)
- ERROR_CASE(VK_ERROR_FORMAT_NOT_SUPPORTED)
- ERROR_CASE(VK_ERROR_FRAGMENTED_POOL)
-
- /* Extension errors */
- ERROR_CASE(VK_ERROR_SURFACE_LOST_KHR)
- ERROR_CASE(VK_ERROR_NATIVE_WINDOW_IN_USE_KHR)
- ERROR_CASE(VK_ERROR_OUT_OF_DATE_KHR)
- ERROR_CASE(VK_ERROR_INCOMPATIBLE_DISPLAY_KHR)
- ERROR_CASE(VK_ERROR_VALIDATION_FAILED_EXT)
- ERROR_CASE(VK_ERROR_INVALID_SHADER_NV)
- ERROR_CASE(VK_ERROR_OUT_OF_POOL_MEMORY_KHR)
-
- default:
- assert(!"Unknown error");
- error_str = "unknown error";
- }
-
-#undef ERROR_CASE
+ const char *error_str = vk_Result_to_str(error);
if (format) {
va_start(ap, format);