cacheMissCollection
A separate GraphicsStateCollection that stores shader variants and graphics states that were not in this collection during GraphicsStateCollection.WarmUp.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Property
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public GraphicsStateCollection cacheMissCollection { get; }
Remarks
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 can be used to resolve this issue.
cacheMissCollectionWhen the user calls GraphicsStateCollection.WarmUp with set to , the 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 .
traceCacheMissestruecacheMissCollectionGraphicsStateCollectionA common use pattern is to enable during GraphicsStateCollection.WarmUp, then after tracing either save it out as a separate collection or immediately append it to the current collection.
traceCacheMissesusing UnityEngine;using UnityEngine.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); }}