Class ShaderCompilerClient
Namespace: Unity.Tiny.ShaderCompiler
Syntax
public class ShaderCompilerClient
Properties
IsOpen
Declaration
public bool IsOpen { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Close()
Declaration
public void Close()
Compile(String, ShaderCompilerPlatform, String, String, Int32, out Byte[], out Byte[], List<String>)
Declaration
public void Compile(string src, ShaderCompilerPlatform platform, string name, string filepath, int startLine, out byte[] serializedVert, out byte[] serializedFrag, List<string> errors)
Parameters
Type | Name | Description |
---|---|---|
String | src | |
ShaderCompilerPlatform | platform | |
String | name | |
String | filepath | |
Int32 | startLine | |
Byte[] | serializedVert | |
Byte[] | serializedFrag | |
List<String> | errors |
CompileShaderForPlatforms(String, ShaderCompilerPlatform[])
Declaration
public BlobAssetReference<PrecompiledShaderPipeline> CompileShaderForPlatforms(string filepath, ShaderCompilerPlatform[] platforms)
Parameters
Type | Name | Description |
---|---|---|
String | filepath | |
ShaderCompilerPlatform[] | platforms |
Returns
Type | Description |
---|---|
BlobAssetReference<PrecompiledShaderPipeline> |
CompileShaderForPlatforms(String, ShaderCompilerPlatform[], String, Int32, String)
Declaration
public BlobAssetReference<PrecompiledShaderPipeline> CompileShaderForPlatforms(string src, ShaderCompilerPlatform[] platforms, string filepath, int startLine = 0, string name = null)
Parameters
Type | Name | Description |
---|---|---|
String | src | |
ShaderCompilerPlatform[] | platforms | |
String | filepath | |
Int32 | startLine | |
String | name |
Returns
Type | Description |
---|---|
BlobAssetReference<PrecompiledShaderPipeline> |
Remarks
The Unity shader compiler compiles all shader stages in a single step for some backends, so all compiled stages for a pipeline are stored in a single BlobAsset
GetSupportedPlatforms(BuildTarget, Boolean)
Declaration
public static ShaderCompilerPlatform[] GetSupportedPlatforms(BuildTarget target, bool forceIncludeAllPlatform = false)
Parameters
Type | Name | Description |
---|---|---|
BuildTarget | target | |
Boolean | forceIncludeAllPlatform |
Returns
Type | Description |
---|---|
ShaderCompilerPlatform[] |
Open(String)
Declaration
public void Open(string logOutputPath)
Parameters
Type | Name | Description |
---|---|---|
String | logOutputPath |
Preprocess(String, String, String, out String, out Int32, out UInt32[])
Declaration
public bool Preprocess(string shaderLabSrc, string filepath, string name, out string hlslSrc, out int startLine, out uint[] includeHash)
Parameters
Type | Name | Description |
---|---|---|
String | shaderLabSrc | |
String | filepath | |
String | name | |
String | hlslSrc | |
Int32 | startLine | |
UInt32[] | includeHash |
Returns
Type | Description |
---|---|
Boolean |