# GetGraphicsStatesForVariant

> Populate given list with graphics states associated with input shader variant.

## Definition

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

## GetGraphicsStatesForVariant(Shader, PassIdentifier, LocalKeyword\[], List\<GraphicsState>)

Populate given list with graphics states associated with input shader variant.

```csharp
public void GetGraphicsStatesForVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords, List<GraphicsStateCollection.GraphicsState> results)
```

### Parameters

**** (\[Shader]\(/engine/6000.0/script-reference/unityengine/shader)): Shader used in the variant.**** (\[PassIdentifier]\(/engine/6000.0/script-reference/unityengine/rendering/passidentifier)): PassIdentifier used in the variant.**** (\[LocalKeyword\[]]\(/engine/6000.0/script-reference/unityengine/rendering/localkeyword)): Array of keywords used in the variant.**** (\[List\<GraphicsState>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): List of graphics states to populate.

### Examples

```csharp
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;

public class GetGraphicsStatesExample : MonoBehaviour
{
    public GraphicsStateCollection graphicsStateCollection;

    void Start()
    {
        List<GraphicsStateCollection.ShaderVariant> variants = new List<GraphicsStateCollection.ShaderVariant>();
        graphicsStateCollection.GetVariants(variants);
        foreach (var variant in variants)
        {
            List<GraphicsStateCollection.GraphicsState> states = new List<GraphicsStateCollection.GraphicsState>();
            graphicsStateCollection.GetGraphicsStatesForVariant(variant, states);
        }
    }
}
```

## GetGraphicsStatesForVariant(ShaderVariant, List\<GraphicsState>)

Populate given list with graphics states associated with input shader variant.

```csharp
public void GetGraphicsStatesForVariant(GraphicsStateCollection.ShaderVariant variant, List<GraphicsStateCollection.GraphicsState> results)
```

### Parameters

**** (\[ShaderVariant]\(/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsstatecollection/shadervariant)): The input variant.**** (\[List\<GraphicsState>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): List of graphics states to populate.

### Examples

```csharp
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;

public class GetGraphicsStatesExample : MonoBehaviour
{
    public GraphicsStateCollection graphicsStateCollection;

    void Start()
    {
        List<GraphicsStateCollection.ShaderVariant> variants = new List<GraphicsStateCollection.ShaderVariant>();
        graphicsStateCollection.GetVariants(variants);
        foreach (var variant in variants)
        {
            List<GraphicsStateCollection.GraphicsState> states = new List<GraphicsStateCollection.GraphicsState>();
            graphicsStateCollection.GetGraphicsStatesForVariant(variant, states);
        }
    }
}
```
