ComputeShaderVariant
Creates a compute shader variant identifier with the provided compute shader, kernel index, and keywords.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
ComputeShaderVariant(ComputeShader, int, LocalKeyword[])
Creates a compute shader variant identifier with the provided compute shader, kernel index, and keywords.
public ComputeShaderVariant(ComputeShader shader, int kernelIndex, LocalKeyword[] keywords)
Parameters
The ComputeShader of the variant.
The index of the kernel in .
shaderThe LocalKeyword array of the variant.
Remarks
Use this constructor to describe a variant to pass to GraphicsStateCollection.AddComputeVariant, GraphicsStateCollection.ContainsComputeVariant, or GraphicsStateCollection.RemoveComputeVariant, or to compare with the variants that GraphicsStateCollection.GetComputeVariants returns. The constructor stores the arguments as they are and doesn't validate them.
ComputeShaderVariant(ComputeShader, int)
Creates a compute shader variant identifier with the provided compute shader, kernel index, and the keywords enabled on the compute shader.
public ComputeShaderVariant(ComputeShader shader, int kernelIndex)
Parameters
Remarks
The variant uses the keywords that are enabled on when you call the constructor, from ComputeShader.enabledKeywords. Later changes to the keywords of don't affect the variant. If is , this constructor throws a .
shadershadershadernullNullReferenceException