CompileVariant
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
Read time 6 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, bool)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, bool forExternalTool)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
Indicates whether to prepare the bytecode for Unity or to use with external tools.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, GraphicsTier)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, GraphicsTier tier)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional graphics tier.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, GraphicsTier, bool)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, GraphicsTier tier, bool forExternalTool)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional graphics tier.
Indicates whether to prepare the bytecode for Unity or to use with external tools.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, BuiltinShaderDefine[])
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, BuiltinShaderDefine[] platformKeywords)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional set of platform keywords. If you do not provide any, Unity uses the default keywords for the given platform, target, and tier.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, BuiltinShaderDefine[], bool)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, BuiltinShaderDefine[] platformKeywords, bool forExternalTool)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional set of platform keywords. If you do not provide any, Unity uses the default keywords for the given platform, target, and tier.
Indicates whether to prepare the bytecode for Unity or to use with external tools.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, BuiltinShaderDefine[], GraphicsTier)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, BuiltinShaderDefine[] platformKeywords, GraphicsTier tier)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional set of platform keywords. If you do not provide any, Unity uses the default keywords for the given platform, target, and tier.
An optional graphics tier.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |
CompileVariant(ShaderType, string[], ShaderCompilerPlatform, BuildTarget, BuiltinShaderDefine[], GraphicsTier, bool)
Compiles a shader variant for this shader pass and returns its bytecode and resource layout.
public ShaderData.VariantCompileInfo CompileVariant(ShaderType shaderType, string[] keywords, ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, BuiltinShaderDefine[] platformKeywords, GraphicsTier tier, bool forExternalTool)
Parameters
The shader type within this pass to compile. (e.g. Vertex, Fragment, etc.) Some platforms (OpenGLCore, GLES3x, Switch and Vulkan) include all stages within the Vertex shader type.
The keywords to use during the compilation.
The shader compiler platform to compile for.
The build target to compile for.
An optional set of platform keywords. If you do not provide any, Unity uses the default keywords for the given platform, target, and tier.
An optional graphics tier.
Indicates whether to prepare the bytecode for Unity or to use with external tools.
Returns
Type | Description |
|---|---|
| VariantCompileInfo | The compiled variant result, including resource layout information and bytecode. If the pass doesn't include the requested program, or if the pass is not the correct type, this function still succeeds but returns empty bytecode. |