# GetStats()

> Returns counters describing precompiled graphics pipeline state cache hits and misses.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/7000.0/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static PrecompiledGraphicsStateStats GetStats()
```

### Returns

| Type                                                                                                                    | Description                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats.md) | A [PrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats.md) struct with the current counters, or an all-zero struct when [SystemInfo.supportsPrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/systeminfo/supportsprecompiledgraphicsstatestats.md) is false. |

### Remarks

Check [SystemInfo.supportsPrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/systeminfo/supportsprecompiledgraphicsstatestats.md) first. When the current graphics device doesn't report these statistics, this method also sets [PrecompiledGraphicsStateStats.isActive](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/isactive.md) to false.

### Examples

```csharp
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}");
    }
}
```
