# IsShaderStageEnabled(ShaderStageFlags, ShaderStage)

> Returns true if given shader stage is enabled in flags. Returns false otherwise.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Shaders](/engine/6000.5/script-reference/unityengine/shaders.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static bool IsShaderStageEnabled(ShaderStageFlags flags, ShaderStage stage)
```

### Parameters

**** (\[ShaderStageFlags]\(/engine/6000.5/script-reference/unityengine/shaders/shaderstageflags)): The flags to check the stage with.**** (\[ShaderStage]\(/engine/6000.5/script-reference/unityengine/shaders/shaderstage)): The stage to check the flags with.

### Returns

| Type                                                          | Description                            |
| ------------------------------------------------------------- | -------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if `stage` is enabled in `flags`. |

### Remarks

Use this method to check if the given shader stage is enabled when the API can work with multiple shader stages simultaneously.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Shaders;

/*
    Attach this script to a GameObject and enter Play mode. "Shader stages: Basic, Tessellation" will be printed in the console.
*/

public class ShaderTypes : MonoBehaviour
{
    void Start()
    {
        ShaderStageFlags stages = (ShaderStageFlags.Graphics & (~ShaderStageFlags.Geometry));
        // Iterate over all possible shader stages and check if the only stages enabled are Vertex, Fragment, Hull, and Domain
        // Log a message if a stage is enabled or disabled incorrectly.
        for (ShaderStage stage = ShaderStage.FirstStage; stage < ShaderStage.Count; ++stage)
        {
            bool shouldBeEnabled = stage < ShaderStage.GraphicsStageCount && stage != ShaderStage.Geometry;
            if (Utility.IsShaderStageEnabled(stages, stage) != shouldBeEnabled)
                Debug.Log("Unexpected stage " + stage + (shouldBeEnabled ? " not enabled" : " enabled"));
        }
        Debug.Log("Shader stages: " + stages);
    }
}
```
