summaryrefslogtreecommitdiff
path: root/render/vulkan/vkassert.h
blob: 393e2dead5f8d97740faaaffd7250dbc94fb2725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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