# IsValid

> Checks whether the global shader keyword exists.

## Definition

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

## IsValid()

Checks whether the global shader keyword exists.

```csharp
public bool IsValid()
```

### Returns

| Type                                                          | Description                                                                 |
| ------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the global shader keyword exists. Otherwise, returns false. |

## IsValid(ComputeShader)

Checks whether the shader keyword exists in the compute shader you pass in.

```csharp
public bool IsValid(ComputeShader shader)
```

### Parameters

**** (\[ComputeShader]\(/engine/6000.5/script-reference/unityengine/computeshader)): The shader that declares the keyword.

### Returns

| Type                                                          | Description                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the shader keyword exists. Otherwise, returns false. |

## IsValid(Shader)

Checks whether the shader keyword exists in the shader you pass in.

```csharp
public bool IsValid(Shader shader)
```

### Parameters

**** (\[Shader]\(/engine/6000.5/script-reference/unityengine/shader)): The shader that declares the keyword.

### Returns

| Type                                                          | Description                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the shader keyword exists. Otherwise, returns false. |
