X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_debug.h;h=4a060d7759c5dbf888db884e92433bd74c5de8ad;hb=e0773da1e897164ed7597437070e32b867734ee5;hp=49d752e1b23dd1efc20b11ec930a33b9565a8ab2;hpb=df6155fcff66034457b3165f5df0a61ccfc41314;p=mesa.git diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index 49d752e1b23..4a060d7759c 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -29,8 +29,44 @@ #ifndef ST_DEBUG_H #define ST_DEBUG_H +#include "pipe/p_compiler.h" +#include "util/u_debug.h" + extern void st_print_current(void); +#define DEBUG_MESA 0x1 +#define DEBUG_TGSI 0x2 +#define DEBUG_CONSTANTS 0x4 +#define DEBUG_PIPE 0x8 +#define DEBUG_TEX 0x10 +#define DEBUG_FALLBACK 0x20 +#define DEBUG_QUERY 0x40 +#define DEBUG_SCREEN 0x80 + +#ifdef DEBUG +extern int ST_DEBUG; +#define DBSTR(x) x +#else +#define ST_DEBUG 0 +#define DBSTR(x) "" +#endif + +void st_debug_init( void ); + +static INLINE void +ST_DBG( unsigned flag, const char *fmt, ... ) +{ + if (ST_DEBUG & flag) + { + va_list args; + + va_start( args, fmt ); + debug_vprintf( fmt, args ); + va_end( args ); + } +} + + #endif /* ST_DEBUG_H */