A separate GraphicsStateCollection that stores shader variants and graphics states that were not in this collection during WarmUp.
When a prewarming a graphics state collection does not appear to reduce load times as expected, one possibility is that some graphics states encountered during playthrough were not contained in the "warmed up" collection.
The cacheMissCollection can be used to resolve this issue.
When the user calls WarmUp with traceCacheMisses set to true, the cacheMissCollection is created, otherwise it is null by default. After warmup, any time
a shader variant state permutation that does not exist in the current collection is used, it will be added to the cache miss collection.
This collection can then operated on as with any other GraphicsStateCollection.
A common use pattern is to enable traceCacheMisses during WarmUp, then after tracing either save it out as a separate collection or immediately append it to the current collection.
using UnityEngine; using UnityEngine.Experimental.Rendering; using Unity.Jobs;
public class CacheMissTracingExample : MonoBehaviour { public GraphicsStateCollection graphicsStateCollection; public string cacheMissFilePath;
void Start() { // Start prewarming without any job dependencies and with traceCacheMisses enabled JobHandle handle = graphicsStateCollection.WarmUp(new JobHandle(), true); }
void OnDestroy() { graphicsStateCollection.cacheMissCollection.EndTrace(); graphicsStateCollection.cacheMissCollection.SaveToFile(cacheMissFilePath); } }
Additional resources: isTracingCacheMisses, SaveToFile, SendToEditor, Append.