您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
940 B
33 行
940 B
namespace UnityEditor.ShaderGraph
|
|
{
|
|
internal static class PrecisionUtil
|
|
{
|
|
internal const string Token = "$precision";
|
|
|
|
internal static string ToShaderString(this ConcretePrecision precision)
|
|
{
|
|
switch(precision)
|
|
{
|
|
case ConcretePrecision.Float:
|
|
return "float";
|
|
case ConcretePrecision.Half:
|
|
return "half";
|
|
default:
|
|
return "float";
|
|
}
|
|
}
|
|
|
|
internal static ConcretePrecision ToConcrete(this Precision precision)
|
|
{
|
|
switch(precision)
|
|
{
|
|
case Precision.Float:
|
|
return ConcretePrecision.Float;
|
|
case Precision.Half:
|
|
return ConcretePrecision.Half;
|
|
default:
|
|
return ConcretePrecision.Float;
|
|
}
|
|
}
|
|
}
|
|
}
|