| Parameter | Description |
|---|---|
| count | The maximum number of variant permutations to warm up. |
| dependency | Job to wait for. |
| traceCacheMisses | If true, stores any graphics states used during runtime that were not prewarmed. |
Unity.Jobs.JobHandle Handle to prewarming job.
Prewarms the given number of shader variant state permutations using associated graphics states.
Except for the case of WebGPU, graphics state collection warmup is only supported when SystemInfo.supportsParallelPSOCreation is true.
Otherwise, behavior falls back to the legacy ShaderVariantCollection.WarmUp and count restricts the maximum number of shader variants instead of shader variant permutations.
Note that when cache miss tracing begins, only the graphics state collection entries that have completed warm up when this job finishes will be considered in identifying cache misses.
Additionally, :ref::isTracingCacheMisses must be false before initiating warm up in order to set traceCacheMisses to true.
Use EndTrace on the cacheMissCollection to end any ongoing cache miss tracing.
using UnityEngine; using UnityEngine.Experimental.Rendering; using Unity.Jobs;
public class GraphicsStateCollectionWarmup : MonoBehaviour { public GraphicsStateCollection graphicsStateCollection; public int statesToWarmup;
void Start() { JobHandle handle = graphicsStateCollection.WarmUpProgressively(statesToWarmup); } }
Additional resources: WarmUp, isWarmedUp, completedWarmupCount, ShaderVariantCollection.WarmUp.