Class ComputeShaderSingleton
Stores compute kernel cache for GPU compute backends
Namespace: Unity.Barracuda
Syntax
public sealed class ComputeShaderSingleton : object
Fields
kernels
Optimized kernels
Declaration
public readonly ComputeShader[] kernels
Field Value
| Type | Description |
|---|---|
| ComputeShader[] |
referenceKernels
Reference compute kernels
Declaration
public readonly ComputeShader referenceKernels
Field Value
| Type | Description |
|---|---|
| ComputeShader |
Properties
Instance
Singleton
Declaration
public static ComputeShaderSingleton Instance { get; }
Property Value
| Type | Description |
|---|---|
| ComputeShaderSingleton |
supported
Check if GPU compute is supported
Declaration
public bool supported { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
LoadIf(Boolean, String)
Load kernel if condition is met
Declaration
public static ComputeShader LoadIf(bool condition, string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | condition | condition to check |
| String | fileName | file name to load from |
Returns
| Type | Description |
|---|---|
| ComputeShader |
|
LoadIf(Boolean, String, List<ComputeShader>)
Load kernels if condition is met
Declaration
public static void LoadIf(bool condition, string fileName, List<ComputeShader> list)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | condition | condition to check |
| String | fileName | file name to load from |
| List<ComputeShader> | list | list to store loaded |