# GetVariants(List<ShaderVariant>)

> Populate given list with shader variants contained in the collection.

## Definition

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

```csharp
public void GetVariants(List<GraphicsStateCollection.ShaderVariant> results)
```

### Parameters

**** (\[List\<ShaderVariant>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): [ShaderVariantCollection.ShaderVariant](/engine/6000.6/script-reference/unityengine/shadervariantcollection/shadervariant.md) list to be populated.

### Examples

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

public class GetVariantsExample : MonoBehaviour
{
    public GraphicsStateCollection graphicsStateCollection;

    void Start()
    {
        List<GraphicsStateCollection.ShaderVariant> variants = new List<GraphicsStateCollection.ShaderVariant>();
        graphicsStateCollection.GetVariants(variants);
        Debug.Log("Collection contains " + variants.Count + " variants.");
    }
}
```
