Skip to content

Commit

Permalink
Add new Macro VK_ASSERT_FORCE_LOG
Browse files Browse the repository at this point in the history
Summary: For debugging on release builds we sometimes need to force error logs

Reviewed By: corporateshark

Differential Revision: D50249159

fbshipit-source-id: 5751d5a8574e1621a992ea3517d81e73d8904aa3
  • Loading branch information
Shayan Javed authored and facebook-github-bot committed Oct 13, 2023
1 parent 6b21e50 commit af19adb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/igl/vulkan/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
} \
}

#define VK_ASSERT_FORCE_LOG(func) \
{ \
const VkResult vk_assert_result = func; \
if (vk_assert_result != VK_SUCCESS) { \
IGLLog(IGLLogLevel::LOG_ERROR, \
"Vulkan API call failed: %s:%i\n %s\n %s\n", \
__FILE__, \
__LINE__, \
#func, \
ivkGetVulkanResultString(vk_assert_result)); \
assert(false); \
} \
}

#define VK_ASSERT_RETURN_VALUE(func, value) \
{ \
const VkResult vk_assert_result = func; \
Expand Down

0 comments on commit af19adb

Please sign in to comment.