summaryrefslogtreecommitdiff
path: root/render/vulkan/vkassert.h
diff options
context:
space:
mode:
Diffstat (limited to 'render/vulkan/vkassert.h')
-rw-r--r--render/vulkan/vkassert.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/render/vulkan/vkassert.h b/render/vulkan/vkassert.h
new file mode 100644
index 0000000..393e2de
--- /dev/null
+++ b/render/vulkan/vkassert.h
@@ -0,0 +1,15 @@
+#ifndef VKASSERT_H
+#define VKASSERT_H
+
+#include <rune/core/logging.h>
+#include <rune/core/abort.h>
+#include <vulkan/vulkan.h>
+
+static inline void vkassert(VkResult value, const char *str) {
+ if (value != VK_SUCCESS) {
+ log_output(LOG_ERROR, "Vulkan assertion failed: %s", str);
+ rune_abort();
+ }
+}
+
+#endif