aboutsummaryrefslogtreecommitdiffstats
path: root/include/vk-utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/vk-utils.hpp')
-rw-r--r--include/vk-utils.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/vk-utils.hpp b/include/vk-utils.hpp
index c67cf31..094c5db 100644
--- a/include/vk-utils.hpp
+++ b/include/vk-utils.hpp
@@ -1,9 +1,17 @@
#pragma once
#ifdef DEBUG
-#define VKCHECK(result) assert((result) == VK_SUCCESS)
+#define VK_CHECK(expr) \
+ do { \
+ VkResult res = expr; \
+ if (res < VK_SUCCESS) { \
+ printf("%s returned error code : %d", #expr, res); \
+ __debugbreak(); \
+ } \
+ } \
+ while(0);
#else
-#define VKCHECK(result) (void)result
+#define VK_CHECK(expr) (void)expr
#endif
VKAPI_ATTR VkBool32 VKAPI_CALL debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,