Commit c88edb13 by John Kessenich

Merge branch 'patch-1' of https://github.com/HaydnTrigg/glslang into HaydnTrigg-patch-1

parents 5e701954 e826286f
......@@ -179,7 +179,27 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
case EbtDouble:
case EbtFloat:
case EbtFloat16:
newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst());
{
auto right = rightUnionArray[i].getDConst();
auto left = leftUnionArray[i].getDConst();
if (right)
{
newConstArray[i].setDConst(left / right);
}
else if (left > 0)
{
newConstArray[i].setDConst((double)INFINITY);
}
else if (left < 0)
{
newConstArray[i].setDConst((double)-INFINITY);
}
else
{
newConstArray[i].setDConst((double)NAN);
}
}
break;
case EbtInt8:
if (rightUnionArray[i] == (signed char)0)
......
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