Documentation

Unity Engine

Download Unity

Unity Engine

chunkEvictionStrategy

The strategy Unity uses to evict unused shader variant chunks from memory.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static ChunkEvictionStrategy chunkEvictionStrategy { get; set; }

Remarks

Use this property to control how quickly Unity evicts shader variant chunks from memory after they're no longer used. The default value is
Aggressive
. This setting affects only the Unity Player.
For more information about each strategy and how it interacts with Shader.maximumChunksOverride, refer to ChunkEvictionStrategy.

Examples

using UnityEngine;using UnityEngine.Shaders;// Attach this script to a GameObject and enter Play mode. Unity prints "Default chunk eviction strategy: Aggressive" in the Console window.public class ShaderChunkEvictionStrategy : MonoBehaviour{ void Start() { ChunkEvictionStrategy strategy = Shader.chunkEvictionStrategy; Debug.Log("Default chunk eviction strategy: " + strategy); }}