X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fshading.html;h=e36bab49c58373aba145ebbdf1d65a2ec9018484;hb=c0bdf37c9100c4e473f53defccab4e2ae6b7a7b1;hp=b0ed249e1dddc09518eeeee14a59e9bf93ed4d13;hpb=5034cf4e35446bf3a4eab0aab7694211dadffae3;p=mesa.git
diff --git a/docs/shading.html b/docs/shading.html
index b0ed249e1dd..e36bab49c58 100644
--- a/docs/shading.html
+++ b/docs/shading.html
@@ -2,23 +2,23 @@
-
Shading Language Support
+
Shading Language
This page describes the features and status of Mesa's support for the
-
+
OpenGL Shading Language.
@@ -49,8 +49,9 @@ execution. These are generally used for debugging.
log - log all GLSL shaders to files.
The filenames will be "shader_X.vert" or "shader_X.frag" where X
the shader ID.
-nopt - disable compiler optimizations
-opt - force compiler optimizations
+cache_info - print debug information about shader cache
+cache_fb - force cached shaders to be ignored and do a full
+ recompile via the fallback path
uniform - print message to stdout when glUniform is called
nopvert - force vertex shaders to be a simple shader that just transforms
the vertex position with ftransform() and passes through the color and
@@ -58,24 +59,40 @@ execution. These are generally used for debugging.
nopfrag - force fragment shader to be a simple shader that passes
through the color attribute.
useprog - log glUseProgram calls to stderr
+errors - GLSL compilation and link errors will be reported to stderr.
Example: export MESA_GLSL=dump,nopt
+Experimenting with Shader Replacements
-Shaders can be dumped and replaced on runtime for debugging purposes. Mesa
-needs to be configured with '--with-sha1' to enable this functionality. This
+Shaders can be dumped and replaced on runtime for debugging purposes. This
feature is not currently supported by SCons build.
This is controlled via following environment variables:
+
- MESA_SHADER_DUMP_PATH - path where shader sources are dumped
- MESA_SHADER_READ_PATH - path where replacement shaders are read
Note, path set must exist before running for dumping or replacing to work.
When both are set, these paths should be different so the dumped shaders do
-not clobber the replacement shaders.
+not clobber the replacement shaders. Also, the filenames of the replacement shaders
+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
@@ -145,11 +162,11 @@ These issues will be addressed/resolved in the future.
Use the built-in library functions whenever possible.
For example, instead of writing this:
- float x = 1.0 / sqrt(y);
+float x = 1.0 / sqrt(y);
Write this:
- float x = inversesqrt(y);
+float x = inversesqrt(y);
@@ -221,7 +238,7 @@ regressions.
-The Piglit project
+The Piglit project
has many GLSL tests.