<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>Shading Language Support</title>
+ <title>Shading Language</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<div class="header">
- <h1>The Mesa 3D Graphics Library</h1>
+ The Mesa 3D Graphics Library
</div>
<iframe src="contents.html"></iframe>
<div class="content">
-<h1>Shading Language Support</h1>
+<h1>Shading Language</h1>
<p>
This page describes the features and status of Mesa's support for the
-<a href="http://opengl.org/documentation/glsl/">
+<a href="https://opengl.org/documentation/glsl/">
OpenGL Shading Language</a>.
</p>
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>cache_fb</b> - force cached shaders to be ignored and do a full
+ recompile via the fallback path</li>
<li><b>uniform</b> - print message to stdout when glUniform is called
<li><b>nopvert</b> - force vertex shaders to be a simple shader that just transforms
the vertex position with ftransform() and passes through the color and
<li><b>nopfrag</b> - force fragment shader to be a simple shader that passes
through the color attribute.
<li><b>useprog</b> - log glUseProgram calls to stderr
+<li><b>errors</b> - GLSL compilation and link errors will be reported to stderr.
</ul>
<p>
Example: export MESA_GLSL=dump,nopt
</p>
+<h3 id="replacement">Experimenting with Shader Replacements</h3>
<p>
-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:
+</p>
<ul>
<li><b>MESA_SHADER_DUMP_PATH</b> - path where shader sources are dumped
<li><b>MESA_SHADER_READ_PATH</b> - path where replacement shaders are read
</ul>
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.
+
+<h3 id="capture">Capturing Shaders</h3>
+
+<p>
+Setting <b>MESA_SHADER_CAPTURE_PATH</b> to a directory will cause the compiler
+to write <code>.shader_test</code> files for use with
+<a href="https://gitlab.freedesktop.org/mesa/shader-db">shader-db</a>, a tool
+which compiler developers can use to gather statistics about shaders
+(instructions, cycles, memory accesses, and so on).
+</p>
+<p>
+Notably, this captures linked GLSL shaders - with all stages together -
+as well as ARB programs.
</p>
<h2 id="support">GLSL Version</h2>
</p>
<p>
-The <a href="http://piglit.freedesktop.org/">Piglit</a> project
+The <a href="https://piglit.freedesktop.org/">Piglit</a> project
has many GLSL tests.
</p>