Commit 50b7178d by Jamie Madill

Revert "Support constant folding of exponential built-ins"

Part of a chain breaking the clang build: http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33588 This reverts commit 1c89caef. Change-Id: I36e080d8f64d4d4ca5de04bebbd119db83956d0e Reviewed-on: https://chromium-review.googlesource.com/265185Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 3cf271fe
...@@ -1284,52 +1284,6 @@ TIntermTyped *TIntermConstantUnion::fold( ...@@ -1284,52 +1284,6 @@ TIntermTyped *TIntermConstantUnion::fold(
return nullptr; return nullptr;
break; break;
case EOpExp:
if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&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.0)
tempConstArray[i].setFConst(0.0);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&log), infoSink, &tempConstArray[i]))
return nullptr;
break;
case EOpExp2:
if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&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.0)
tempConstArray[i].setFConst(0.0);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&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.0)
tempConstArray[i].setFConst(0.0);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&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.0)
tempConstArray[i].setFConst(0.0);
else if (!foldFloatTypeUnary(unionArray[i], static_cast<FloatTypeUnaryFunc>(&sqrt), infoSink, &tempConstArray[i]))
return nullptr;
else
tempConstArray[i].setFConst(1 / tempConstArray[i].getFConst());
break;
default: default:
return NULL; return NULL;
} }
......
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