Probably not useful unless LIBGL_DEBUG is set to something.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3833>
{
return dev->version;
}
+
+bool fd_dbg(void)
+{
+ static int dbg;
+
+ if (!dbg)
+ dbg = getenv("LIBGL_DEBUG") ? 1 : -1;
+
+ return dbg == 1;
+}
#define enable_debug 0 /* TODO make dynamic */
+bool fd_dbg(void);
+
#define INFO_MSG(fmt, ...) \
- do { debug_printf("[I] "fmt " (%s:%d)\n", \
+ do { if (fd_dbg()) debug_printf("[I] "fmt " (%s:%d)\n", \
##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
#define DEBUG_MSG(fmt, ...) \
do if (enable_debug) { debug_printf("[D] "fmt " (%s:%d)\n", \