diff --git a/src/xrt/auxiliary/vk/vk_enumerate.c b/src/xrt/auxiliary/vk/vk_enumerate.c index d72bab4c6..a1f43c66c 100644 --- a/src/xrt/auxiliary/vk/vk_enumerate.c +++ b/src/xrt/auxiliary/vk/vk_enumerate.c @@ -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; \ } \ diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 0b2359791..0a9afbf30 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -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) /*!