The cache should be populated by enabling
r.UseShaderDrawLog on a development machine.
Users/players should then consume the cache by enabling
Draw logging (
r.UseShaderDrawLog) adds noticeable fixed overhead so avoid enabling it in shipped products if possible.
The binary shader cache can either be accumulated during play through or (currently Mac targets only) during cooking by specifying the shader platforms to cache in the CachedShaderFormats array within the /Script/MacTargetPlatform.MacTargetSettings settings group of Engine.ini.
For OpenGL the binary cache contains enough data about shader pipelines to construct fully linked GL programs or GL program pipelines (depending on availability of GL_ARB_separate_shader_objects) but not enough for pipeline construction on any other RHI.
This can help reduce the amount of hitching on OpenGL without first playing through the game, though this is still advisable for maximum effect.
Since the caching is done via shader hashes, it is also advisable to only use this as a final optimization tool when content is largely complete
as changes to shader hashes will result in unused entries accumulating in the cache, increasing cache size without reducing hitches.
The code will first try and load the writable cache, then fall back to the distribution cache if needed.