kiba-engine
util.h
1 #pragma once
2 
3 #include <kiba/core/log.h>
4 #include <vulkan/vulkan.h>
5 
6 // TODO figure out macro to create kb_error on non-success but allow adding custom data based on context
7 
8 #define VK_CALL_B8(expr) \
9  { \
10  VkResult call_res; \
11  if ((call_res = expr) != VK_SUCCESS) { \
12  KB_ERROR("vulkan call {raw_string} unsuccessful, returned: {i32}", #expr, call_res); \
13  return false; \
14  } \
15  }
16 
17 #define VK_CALL_ASSERT(expr) \
18  { \
19  VkResult call_res; \
20  KB_ASSERT((call_res = expr) == VK_SUCCESS, \
21  "vulkan call " #expr " should have been successful, but returned: {i32}", \
22  call_res); \
23  }
Logging system.