mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 12:00:05 +00:00
Merge pull request #2544 from ZhiqianXia/master
Replace log2 and exp2 math func.
This commit is contained in:
commit
51d672b8a8
@ -599,17 +599,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setDConst(log(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpExp2:
|
||||
{
|
||||
const double inv_log2_e = 0.69314718055994530941723212145818;
|
||||
newConstArray[i].setDConst(exp(unionArray[i].getDConst() * inv_log2_e));
|
||||
break;
|
||||
}
|
||||
newConstArray[i].setDConst(exp2(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpLog2:
|
||||
{
|
||||
const double log2_e = 1.4426950408889634073599246810019;
|
||||
newConstArray[i].setDConst(log2_e * log(unionArray[i].getDConst()));
|
||||
break;
|
||||
}
|
||||
newConstArray[i].setDConst(log2(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpSqrt:
|
||||
newConstArray[i].setDConst(sqrt(unionArray[i].getDConst()));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user