Class ShaderTestFramework
Framework for shader testing.
Implements
Inherited Members
Namespace: UnityEngine.TestTools.Graphics.Shaders
Assembly: UnityEditor.TestTools.Graphics.dll
Syntax
public class ShaderTestFramework : IDisposable
Remarks
Manages loading, executing, and resource cleanup for shaders under test.
Methods
Dispose()
Disposes the shader test framework, resetting state and releasing resources
Declaration
public void Dispose()
ExecuteShader<T>(ShaderHandle)
Executes the given shader and returns the result
Declaration
public T ExecuteShader<T>(ShaderHandle shader)
Parameters
| Type | Name | Description |
|---|---|---|
| ShaderHandle | shader | The shader to execute. |
Returns
| Type | Description |
|---|---|
| T | The shader execution result, in the type of |
Type Parameters
| Name | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | The type of the shader result data.
This must match the expected return type of the function or shader being executed.
|
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Thrown when the shader type is not supported. Currently supported shader types are HLSL and Shaderlab. |
LoadShader(string, ShaderParams)
Loads a shader by its identifier and type.
Declaration
public ShaderHandle LoadShader(string path, ShaderParams shaderParameters)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path of the shader to load |
| ShaderParams | shaderParameters | The preparation parameters for the shader. |
Returns
| Type | Description |
|---|---|
| ShaderHandle | A handle to the loaded shader |
Remarks
Currently supports loading ShaderLab and HLSL shaders.
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Thrown when the shader type is not supported. |