# AddGraphicsStateForVariant(Shader, PassIdentifier, LocalKeyword[], GraphicsState)

> Adds a new graphics state associated with a shader variant.

## Definition

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

```csharp
public bool AddGraphicsStateForVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords, GraphicsStateCollection.GraphicsState setup)
```

### Parameters

**** (\[Shader]\(/engine/6000.0/script-reference/unityengine/shader)): Shader used in associated variant.**** (\[PassIdentifier]\(/engine/6000.0/script-reference/unityengine/rendering/passidentifier)): PassIdentifier used in associated variant.**** (\[LocalKeyword\[]]\(/engine/6000.0/script-reference/unityengine/rendering/localkeyword)): Array of keywords used in associated variant.**** (\[GraphicsState]\(/engine/6000.0/script-reference/unityengine/experimental/rendering/graphicsstatecollection/graphicsstate)): GraphicsState to add.

### Returns

| Type                                                          | Description                                                    |
| ------------------------------------------------------------- | -------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the graphics state was added, false otherwise. |
