Added VK_ASSERT macro to save some boilerplate when checking 'VkResult err;' sections
This commit is contained in:
@@ -60,6 +60,14 @@ void basalt_write(const LOG_LEVEL level, const char* msg, ...);
|
||||
#define BDEBUG(msg, ...) basalt_log(LOG_DEBUG, msg, ##__VA_ARGS__);
|
||||
#define BTRACE(msg, ...) basalt_log(LOG_TRACE, msg, ##__VA_ARGS__);
|
||||
|
||||
#define VK_ASSERT(call, msg, ...) \
|
||||
if ((err = (call)) == VK_SUCCESS) {} \
|
||||
else { \
|
||||
BFATAL(msg, __FILE__, __LINE__, string_VkResult(err), ##__VA_ARGS__); \
|
||||
debug_break(); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
#define BASSERT_FATAL(cond, msg, ...) \
|
||||
if (cond){} \
|
||||
else { \
|
||||
|
||||
Reference in New Issue
Block a user