From e9cf458fa8c60878a17bee6a0f0b5b11f88272a4 Mon Sep 17 00:00:00 2001
From: Kenneth Graunke
Date: Mon, 11 Sep 2017 15:47:55 -0700
Subject: [PATCH] docs: Document shader capturing environment variables.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Reviewed-by: Tapani Pälli
---
docs/envvars.html | 2 ++
docs/shading.html | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/docs/envvars.html b/docs/envvars.html
index 51c930f013f..17d69dc4cd4 100644
--- a/docs/envvars.html
+++ b/docs/envvars.html
@@ -133,6 +133,8 @@ that variable is set), or else within .cache/mesa within the user's
home directory.
MESA_GLSL - shading language compiler options
MESA_NO_MINMAX_CACHE - when set, the minmax index cache is globally disabled.
+MESA_SHADER_CAPTURE_PATH - see Capturing Shaders
+MESA_SHADER_DUMP_PATH and MESA_SHADER_READ_PATH - see Experimenting with Shader Replacements
diff --git a/docs/shading.html b/docs/shading.html
index 8b4cfb36a1f..a0bbe997c1b 100644
--- a/docs/shading.html
+++ b/docs/shading.html
@@ -64,6 +64,7 @@ execution. These are generally used for debugging.
Example: export MESA_GLSL=dump,nopt
+Experimenting with Shader Replacements
Shaders can be dumped and replaced on runtime for debugging purposes. This
feature is not currently supported by SCons build.
@@ -79,6 +80,20 @@ not clobber the replacement shaders. Also, the filenames of the replacement shad
should match the filenames of the corresponding dumped shaders.
+Capturing Shaders
+
+
+Setting MESA_SHADER_CAPTURE_PATH to a directory will cause the compiler
+to write .shader_test files for use with
+shader-db, a tool
+which compiler developers can use to gather statistics about shaders
+(instructions, cycles, memory accesses, and so on).
+
+
+Notably, this captures linked GLSL shaders - with all stages together -
+as well as ARB programs.
+
+
GLSL Version
--
2.30.2