GetStats()
Returns counters describing precompiled graphics pipeline state cache hits and misses.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public static PrecompiledGraphicsStateStats GetStats()
Returns
Type | Description |
|---|---|
| PrecompiledGraphicsStateStats | A PrecompiledGraphicsStateStats struct with the current counters, or an all-zero struct when SystemInfo.supportsPrecompiledGraphicsStateStats is false. |
Remarks
Check SystemInfo.supportsPrecompiledGraphicsStateStats first. When the current graphics device doesn't report these statistics, this method also sets PrecompiledGraphicsStateStats.isActive to false.
Examples
using UnityEngine;using UnityEngine.Rendering;public class Example : MonoBehaviour{ void ReportPrecompiledStateStatistics() { if (!SystemInfo.supportsPrecompiledGraphicsStateStats) return; PrecompiledGraphicsStateStats stats = PrecompiledGraphicsState.GetStats(); Debug.Log($"Unknown-status lookups: {stats.unknownCacheStatusCount}"); }}