Revert "Support constant folding of exponential built-ins"

Part of a chain causing compile errors on Mac. Example:

../../third_party/angle/src/compiler/translator/IntermNode.cpp:1216:89: error: no member named 'sin' in namespace 'std'; did you mean 'sinf'?

http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33747

This reverts commit 62e2c8d2bc.

Change-Id: Id20f7f4efbc3df7756161b192d4858caeeb0572f
Reviewed-on: https://chromium-review.googlesource.com/265627
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Jamie Madill 2015-04-14 15:30:45 +00:00
Родитель d1e9a0f488
Коммит 3c772f3623
1 изменённых файлов: 0 добавлений и 46 удалений

Просмотреть файл

@ -1284,52 +1284,6 @@ TIntermTyped *TIntermConstantUnion::fold(
return nullptr;
break;
case EOpExp:
if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::exp), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpLog:
// For log(x), results are undefined if x <= 0, we are choosing to set result to 0.
if (getType().getBasicType() == EbtFloat && unionArray[i].getFConst() <= 0.0f)
tempConstArray[i].setFConst(0.0f);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::log), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpExp2:
if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::exp2), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpLog2:
// For log2(x), results are undefined if x <= 0, we are choosing to set result to 0.
if (getType().getBasicType() == EbtFloat && unionArray[i].getFConst() <= 0.0f)
tempConstArray[i].setFConst(0.0f);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::log2), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpSqrt:
// For sqrt(x), results are undefined if x < 0, we are choosing to set result to 0.
if (getType().getBasicType() == EbtFloat && unionArray[i].getFConst() < 0.0f)
tempConstArray[i].setFConst(0.0f);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::sqrt), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpInverseSqrt:
// There is no stdlib built-in function equavalent for GLES built-in inversesqrt(),
// so getting the square root first using builtin function sqrt() and then taking its inverse.
// Also, for inversesqrt(x), results are undefined if x <= 0, we are choosing to set result to 0.
if (getType().getBasicType() == EbtFloat && unionArray[i].getFConst() <= 0.0f)
tempConstArray[i].setFConst(0.0f);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&std::sqrt), infoSink, &tempConstArray[i]))
return nullptr;
else
tempConstArray[i].setFConst(1.0f / tempConstArray[i].getFConst());
break;
default:
return NULL;
}