# GetGraphicsStateCountForVariant

> Get the number of graphics states associated with an input shader variant.

## Definition

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

## GetGraphicsStateCountForVariant(Shader, PassIdentifier, LocalKeyword\[])

Get the number of graphics states associated with an input shader variant.

```csharp
public int GetGraphicsStateCountForVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords)
```

### Parameters

**** (\[Shader]\(/engine/6000.7/script-reference/unityengine/shader)): Shader used in the variant.**** (\[PassIdentifier]\(/engine/6000.7/script-reference/unityengine/rendering/passidentifier)): PassIdentifier used in the variant.**** (\[LocalKeyword\[]]\(/engine/6000.7/script-reference/unityengine/rendering/localkeyword)): [LocalKeyword](/engine/6000.7/script-reference/unityengine/rendering/localkeyword.md) array of keywords used in the variant.

### Returns

| Type                                                       | Description                                                       |
| ---------------------------------------------------------- | ----------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of graphics states associated to input shader variant. |

### Remarks

Additional Resources: [GraphicsStateCollection.totalGraphicsStateCount](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/totalgraphicsstatecount.md), [GraphicsStateCollection.GetGraphicsStatesForVariant](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/getgraphicsstatesforvariant.md).

## GetGraphicsStateCountForVariant(ShaderVariant)

Get the number of graphics states associated with an input shader variant.

```csharp
public int GetGraphicsStateCountForVariant(GraphicsStateCollection.ShaderVariant variant)
```

### Parameters

**** (\[ShaderVariant]\(/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/shadervariant)): The input shader variant.

### Returns

| Type                                                       | Description                                                       |
| ---------------------------------------------------------- | ----------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of graphics states associated to input shader variant. |

### Remarks

Additional Resources: [GraphicsStateCollection.totalGraphicsStateCount](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/totalgraphicsstatecount.md), [GraphicsStateCollection.GetGraphicsStatesForVariant](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/getgraphicsstatesforvariant.md).
