Unverified Commit 51d672b8 by greg-lunarg Committed by GitHub

Merge pull request #2544 from ZhiqianXia/master

Replace log2 and exp2 math func.
parents 00c6d2d4 47a21828
...@@ -599,17 +599,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) ...@@ -599,17 +599,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
newConstArray[i].setDConst(log(unionArray[i].getDConst())); newConstArray[i].setDConst(log(unionArray[i].getDConst()));
break; break;
case EOpExp2: case EOpExp2:
{ newConstArray[i].setDConst(exp2(unionArray[i].getDConst()));
const double inv_log2_e = 0.69314718055994530941723212145818; break;
newConstArray[i].setDConst(exp(unionArray[i].getDConst() * inv_log2_e));
break;
}
case EOpLog2: case EOpLog2:
{ newConstArray[i].setDConst(log2(unionArray[i].getDConst()));
const double log2_e = 1.4426950408889634073599246810019; break;
newConstArray[i].setDConst(log2_e * log(unionArray[i].getDConst()));
break;
}
case EOpSqrt: case EOpSqrt:
newConstArray[i].setDConst(sqrt(unionArray[i].getDConst())); newConstArray[i].setDConst(sqrt(unionArray[i].getDConst()));
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment