projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29d2bbb
)
vk/private: Add a non-fatal assert
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Thu, 11 Jun 2015 04:03:50 +0000
(21:03 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Thu, 11 Jun 2015 04:03:50 +0000
(21:03 -0700)
src/vulkan/private.h
patch
|
blob
|
history
diff --git
a/src/vulkan/private.h
b/src/vulkan/private.h
index 095f8f0f86eb0cbe88fab3334dfa7a19ff7a44e2..9f1345fd8eda3f31aa579619a7f786c6d9f62efa 100644
(file)
--- a/
src/vulkan/private.h
+++ b/
src/vulkan/private.h
@@
-107,6
+107,16
@@
void __anv_finishme(const char *file, int line, const char *format, ...)
#define anv_finishme(format, ...) \
__anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__);
+/* A non-fatal assert. Useful for debugging. */
+#ifdef DEBUG
+#define anv_assert(x) ({ \
+ if (unlikely(!(x))) \
+ fprintf(stderr, "%s:%d ASSERT: %s\n", __FILE__, __LINE__, #x); \
+})
+#else
+#define anv_assert(x)
+#endif
+
void anv_abortf(const char *format, ...) anv_noreturn anv_printflike(1, 2);
void anv_abortfv(const char *format, va_list va) anv_noreturn;