a/vk: Use vk_print_result instead of vk_has_error

This commit is contained in:
Jakob Bornecrantz 2023-09-30 12:21:00 +01:00
parent 6316bf39a9
commit 0fb3e9a943
2 changed files with 11 additions and 4 deletions

View file

@ -24,7 +24,9 @@
#define CHECK_FIRST_CALL(FUNC, RET, COUNT) \
do { \
if (vk_has_error(RET, FUNC, __FILE__, __LINE__)) { \
VkResult _ret = RET; \
if (_ret != VK_SUCCESS) { \
vk_print_result(vk, _ret, FUNC, __FILE__, __LINE__); \
return RET; \
} \
if (COUNT == 0) { \
@ -34,7 +36,9 @@
#define CHECK_SECOND_CALL(FUNC, RET, TO_FREE) \
do { \
if (vk_has_error(RET, FUNC, __FILE__, __LINE__)) { \
VkResult _ret = RET; \
if (_ret != VK_SUCCESS) { \
vk_print_result(vk, _ret, FUNC, __FILE__, __LINE__); \
free(TO_FREE); \
return RET; \
} \

View file

@ -557,8 +557,11 @@ vk_has_error(VkResult res, const char *fun, const char *file, int line);
*/
#define vk_check_error(fun, res, ret) \
do { \
if (vk_has_error(res, fun, __FILE__, __LINE__)) \
return ret; \
VkResult _ret = res; \
if (_ret != VK_SUCCESS) { \
vk_print_result(vk, _ret, fun, __FILE__, __LINE__); \
return _ret; \
} \
} while (0)
/*!