文档

Unity Engine

Unity Engine

GetShaderPlatformKeywordsForBuildTarget

Gets the platform keywords needed to compile a shader for a shader compiler platform, build target, and graphics tier.
阅读时间1 分钟最后更新于 16 天前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

GetShaderPlatformKeywordsForBuildTarget(ShaderCompilerPlatform, BuildTarget, GraphicsTier)

Gets the platform keywords needed to compile a shader for a shader compiler platform, build target, and graphics tier.
public static BuiltinShaderDefine[] GetShaderPlatformKeywordsForBuildTarget(ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget, GraphicsTier tier)

Parameters

shaderCompilerPlatform

The shader compiler platform.

buildTarget

The build target.

The graphics tier.

Returns

Type

Description

BuiltinShaderDefine[]An array of built-in shader defines that you need to compile a shader for the given target.

Remarks

Unity sets platform keywords when it compiles a shader for a target. Use this method to get the same keywords so that you can compile a shader variant for that target yourself.

GetShaderPlatformKeywordsForBuildTarget(ShaderCompilerPlatform, BuildTarget)

Gets the platform keywords needed to compile a shader for a shader compiler platform and build target, using graphics tier 1.
public static BuiltinShaderDefine[] GetShaderPlatformKeywordsForBuildTarget(ShaderCompilerPlatform shaderCompilerPlatform, BuildTarget buildTarget)

Parameters

shaderCompilerPlatform

The shader compiler platform.

buildTarget

The build target.

Returns

Type

Description

BuiltinShaderDefine[]An array of built-in shader defines that you need to compile a shader for the given target.

Remarks

Unity sets platform keywords when it compiles a shader for a target. Use this method to get the same keywords so that you can compile a shader variant for that target yourself. This overload uses GraphicsTier.Tier1. To specify a graphics tier, use the overload that takes a GraphicsTier.