WarmUpProgressively
Prewarms the given number of shader variant state permutations using associated graphics states.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
WarmUpProgressively(int, JobHandle)
Prewarms the given number of shader variant state permutations using associated graphics states.
public JobHandle WarmUpProgressively(int count, JobHandle dependency = default)
Parameters
Returns
Type | Description |
|---|---|
| JobHandle | Handle to prewarming job. |
Remarks
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 restricts the maximum number of shader variants instead of shader variant permutations.
countNote 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 to true. Use GraphicsStateCollection.EndTrace on the GraphicsStateCollection.cacheMissCollection to end any ongoing cache miss tracing.
traceCacheMissesusing UnityEngine;using UnityEngine.Rendering;using Unity.Jobs;public class GraphicsStateCollectionWarmup : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; public int statesToWarmup; void Start() { JobHandle handle = graphicsStateCollection.WarmUpProgressively(statesToWarmup); }}
Additional Resources: GraphicsStateCollection.WarmUp, GraphicsStateCollection.isWarmedUp, GraphicsStateCollection.completedWarmupCount, ShaderVariantCollection.WarmUp.
WarmUpProgressively(int, JobHandle, bool)
Prewarms the given number of shader variant state permutations using associated graphics states.
public JobHandle WarmUpProgressively(int count, JobHandle dependency, bool traceCacheMisses)
Parameters
Returns
Type | Description |
|---|---|
| JobHandle | Handle to prewarming job. |
Remarks
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 restricts the maximum number of shader variants instead of shader variant permutations.
countNote 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 to true. Use GraphicsStateCollection.EndTrace on the GraphicsStateCollection.cacheMissCollection to end any ongoing cache miss tracing.
traceCacheMissesusing UnityEngine;using UnityEngine.Rendering;using Unity.Jobs;public class GraphicsStateCollectionWarmup : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; public int statesToWarmup; void Start() { JobHandle handle = graphicsStateCollection.WarmUpProgressively(statesToWarmup); }}