Android log output for VK_CHECK_RESULT macro

This commit is contained in:
saschawillems 2017-01-23 13:44:31 +01:00
parent 06af4a0cee
commit f09993bc15

View file

@ -36,6 +36,17 @@
#define DEFAULT_FENCE_TIMEOUT 100000000000 #define DEFAULT_FENCE_TIMEOUT 100000000000
// Macro to check and display Vulkan return results // Macro to check and display Vulkan return results
#if defined(__ANDROID__)
#define VK_CHECK_RESULT(f) \
{ \
VkResult res = (f); \
if (res != VK_SUCCESS) \
{ \
LOGE("Fatal : VkResult is \" %s \" in %s at line %d", vkTools::errorString(res).c_str(), __FILE__, __LINE__); \
assert(res == VK_SUCCESS); \
} \
}
#else
#define VK_CHECK_RESULT(f) \ #define VK_CHECK_RESULT(f) \
{ \ { \
VkResult res = (f); \ VkResult res = (f); \
@ -44,7 +55,8 @@
std::cout << "Fatal : VkResult is \"" << vkTools::errorString(res) << "\" in " << __FILE__ << " at line " << __LINE__ << std::endl; \ std::cout << "Fatal : VkResult is \"" << vkTools::errorString(res) << "\" in " << __FILE__ << " at line " << __LINE__ << std::endl; \
assert(res == VK_SUCCESS); \ assert(res == VK_SUCCESS); \
} \ } \
} \ }
#endif
namespace vkTools namespace vkTools
{ {