Automatic Shader Cache

When the proprietary NVIDIA shader cache support in the driver is enabled, the OpenGL ES 3.0 driver maintains a shader cache file for each program. When an application specifies a shader source, the driver first searches the cache to see if it has already compiled this source with the current version of the compiler. If not, it compiles the program and then saves a copy in the cache. If the shader has been previously compiled, the driver loads the pre-built binary from the cache. The cache persists between application runs, so that with a thorough initial test run, compilation need only occur the first time a new driver is installed.

The shader cache is enabled on read/write file systems by default. Assign the __GL_SHADER_DISK_CACHE environment variable a value of 0 to disable the cache.

Note:

The shader cache is disabled by default on QNX as the root file system is read only. The cache can be enabled by setting the environment variables __GL_SHADER_DISK_CACHE to 1 and __GL_SHADER_DISK_CACHE_PATH to a location with write access.

By default, the cache is placed in an .nv directory in the user's home directory, which is created if it does not already exist. If desired, override the default location by specifying a valid alternate path with the __GL_SHADER_DISK_CACHE_PATH environment variable. Unlike the .nv directory, the driver does not create this non-default directory if it does not already exist. If this variable specifies a directory that does not already exist, the cache is disabled.

The cache appears in the specified location as a subdirectory named GLCache containing a set of directories and files with hashed names. These files encode the driver version, GPU, and application. Whenever you install a new version of the driver, the hashed names change. Users may therefore wish to clean out the old directory before running any applications.