Added VK_ASSERT macro to save some boilerplate when checking 'VkResult err;' sections

This commit is contained in:
2025-06-24 15:35:45 +10:00
parent cd1430d258
commit 7c2d6db2e7

View File

@@ -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 { \