[Mesa-dev] [PATCH 05/37] mesa: add new MESA_GLSL flag for printing shader cache debug info

Timothy Arceri t_arceri at yahoo.com.au
Mon Jan 23 23:12:44 UTC 2017


From: Timothy Arceri <timothy.arceri at collabora.com>

---
 docs/shading.html         | 1 +
 src/mesa/main/mtypes.h    | 1 +
 src/mesa/main/shaderapi.c | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/docs/shading.html b/docs/shading.html
index b0ed249..e44035a 100644
--- a/docs/shading.html
+++ b/docs/shading.html
@@ -49,6 +49,7 @@ execution.  These are generally used for debugging.
 <li><b>log</b> - log all GLSL shaders to files.
     The filenames will be "shader_X.vert" or "shader_X.frag" where X
     the shader ID.
+<li><b>cache_info</b> - print debug information about shader cache
 <li><b>nopt</b> - disable compiler optimizations
 <li><b>opt</b> - force compiler optimizations
 <li><b>uniform</b> - print message to stdout when glUniform is called
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1cc8322..a2280e2 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2837,6 +2837,7 @@ struct gl_shader_program
 #define GLSL_USE_PROG 0x80  /**< Log glUseProgram calls */
 #define GLSL_REPORT_ERRORS 0x100  /**< Print compilation errors */
 #define GLSL_DUMP_ON_ERROR 0x200 /**< Dump shaders to stderr on compile error */
+#define GLSL_CACHE_INFO 0x400 /**< Print debug information about shader cache */
 
 
 /**
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 3313fa2..c4ea79f 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -77,6 +77,8 @@ _mesa_get_shader_flags(void)
          flags |= GLSL_DUMP;
       if (strstr(env, "log"))
          flags |= GLSL_LOG;
+      if (strstr(env, "cache_info"))
+         flags |= GLSL_CACHE_INFO;
       if (strstr(env, "nopvert"))
          flags |= GLSL_NOP_VERT;
       if (strstr(env, "nopfrag"))
-- 
2.9.3



More information about the mesa-dev mailing list