[Mesa-dev] [PATCH 2/2] st/mesa: enable the ST_DEBUG env var in release and debugoptimized builds

Marek Olšák maraeo at gmail.com
Fri May 10 05:21:16 UTC 2019


From: Marek Olšák <marek.olsak at amd.com>

Useful for dumping shaders.
---
 src/mesa/state_tracker/st_debug.c | 4 ----
 src/mesa/state_tracker/st_debug.h | 6 ------
 2 files changed, 10 deletions(-)

diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c
index 27d50a17e5e..7faffb581ef 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -35,21 +35,20 @@
 #include "tgsi/tgsi_dump.h"
 
 #include "cso_cache/cso_cache.h"
 
 #include "st_context.h"
 #include "st_debug.h"
 #include "st_program.h"
 
 
 
-#ifdef DEBUG
 int ST_DEBUG = 0;
 
 static const struct debug_named_value st_debug_flags[] = {
    { "mesa",     DEBUG_MESA, NULL },
    { "tgsi",     DEBUG_TGSI, NULL },
    { "constants",DEBUG_CONSTANTS, NULL },
    { "pipe",     DEBUG_PIPE, NULL },
    { "tex",      DEBUG_TEX, NULL },
    { "fallback", DEBUG_FALLBACK, NULL },
    { "screen",   DEBUG_SCREEN, NULL },
@@ -57,29 +56,26 @@ static const struct debug_named_value st_debug_flags[] = {
    { "draw",     DEBUG_DRAW, NULL },
    { "buffer",   DEBUG_BUFFER, NULL },
    { "wf",       DEBUG_WIREFRAME, NULL },
    { "precompile",  DEBUG_PRECOMPILE, NULL },
    { "gremedy",  DEBUG_GREMEDY, "Enable GREMEDY debug extensions" },
    { "noreadpixcache", DEBUG_NOREADPIXCACHE, NULL },
    DEBUG_NAMED_VALUE_END
 };
 
 DEBUG_GET_ONCE_FLAGS_OPTION(st_debug, "ST_DEBUG", st_debug_flags, 0)
-#endif
 
 
 void
 st_debug_init(void)
 {
-#ifdef DEBUG
    ST_DEBUG = debug_get_option_st_debug();
-#endif
 }
 
 
 
 /**
  * Print current state.  May be called from inside gdb to see currently
  * bound vertex/fragment shaders and associated constants.
  */
 void
 st_print_current(void)
diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h
index 6c1e915f68c..446baa75c64 100644
--- a/src/mesa/state_tracker/st_debug.h
+++ b/src/mesa/state_tracker/st_debug.h
@@ -46,27 +46,21 @@ st_print_current(void);
 #define DEBUG_FALLBACK  0x20
 #define DEBUG_QUERY     0x40
 #define DEBUG_SCREEN    0x80
 #define DEBUG_DRAW      0x100
 #define DEBUG_BUFFER    0x200
 #define DEBUG_WIREFRAME 0x400
 #define DEBUG_PRECOMPILE   0x800
 #define DEBUG_GREMEDY   0x1000
 #define DEBUG_NOREADPIXCACHE 0x2000
 
-#ifdef DEBUG
 extern int ST_DEBUG;
-#define DBSTR(x) x
-#else
-#define ST_DEBUG 0
-#define DBSTR(x) ""
-#endif
 
 void st_debug_init( void );
 
 void st_update_debug_callback(struct st_context *st);
 
 static inline void
 ST_DBG( unsigned flag, const char *fmt, ... )
 {
     if (ST_DEBUG & flag)
     {
-- 
2.17.1



More information about the mesa-dev mailing list