# PrecompiledGraphicsStateStats

> Counters describing precompiled graphics pipeline state cache hits and misses, as returned by PrecompiledGraphicsState.GetStats.

## Definition

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

```csharp
public readonly struct PrecompiledGraphicsStateStats
```

## Remarks

These counters come directly from the graphics driver's Direct3D 12 precompiled state database (PSDB) statistics API. Every counter is 0, and [PrecompiledGraphicsStateStats.isActive](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/isactive.md) is false, whenever [SystemInfo.supportsPrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/systeminfo/supportsprecompiledgraphicsstatestats.md) is false.

Additional Resources: [PrecompiledGraphicsState.GetStats](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstate/getstats.md), [SystemInfo.supportsPrecompiledGraphicsStateStats](/engine/7000.0/script-reference/unityengine/systeminfo/supportsprecompiledgraphicsstatestats.md).

## Examples

```csharp
using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour
{
    void LogAllStatistics()
    {
        if (!SystemInfo.supportsPrecompiledGraphicsStateStats)
            return;

        PrecompiledGraphicsStateStats stats = PrecompiledGraphicsState.GetStats();
        Debug.Log($"Precompiled state active: {stats.isActive}, created: {stats.createdCount}, " +
            $"precompiled misses: {stats.precompiledCacheMissCount}, all-cache misses: {stats.allCachesMissCount}, " +
            $"unknown status: {stats.unknownCacheStatusCount}");
    }
}
```

## Fields

| Value                                                                                                                                         | Description                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [allCachesMissCount](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/allcachesmisscount.md)               | The number of pipeline state object creations that missed every one of the driver's caches, precompiled or otherwise.                                                                                                           |
| [createdCount](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/createdcount.md)                           | The number of pipeline state objects the graphics driver created.                                                                                                                                                               |
| [precompiledCacheMissCount](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/precompiledcachemisscount.md) | The number of pipeline state object creations that found no match in the precompiled state database. This doesn't necessarily mean the driver compiled at runtime - the driver's own cache might still have served it.          |
| [unknownCacheStatusCount](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/unknowncachestatuscount.md)     | The number of pipeline state object creations for which the driver didn't attempt a cache lookup at all. Expected on drivers that don't report cache status; doesn't indicate whether the driver actually cached those objects. |

## Properties

| Property                                                                                                    | Description                                                                                                        |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [isActive](/engine/7000.0/script-reference/unityengine/rendering/precompiledgraphicsstatestats/isactive.md) | Returns true if a default precompiled graphics state database is registered for this application; otherwise false. |
