radv: Make radv_finishme only warn once per call-site
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 24 Nov 2016 18:18:14 +0000 (18:18 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 28 Nov 2016 19:12:48 +0000 (19:12 +0000)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_private.h

index a5d13a9239a9c3cde86b58c5dba8e727ad002879..def0af2069dbd3e64b853f9c09138868c7d877b8 100644 (file)
@@ -211,7 +211,13 @@ void radv_loge_v(const char *format, va_list va);
  * Print a FINISHME message, including its source location.
  */
 #define radv_finishme(format, ...)                                     \
-       __radv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__);
+       do { \
+               static bool reported = false; \
+               if (!reported) { \
+                       __radv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
+                       reported = true; \
+               } \
+       } while (0)
 
 /* A non-fatal assert.  Useful for debugging. */
 #ifdef DEBUG