Merge branch 'patch-1' of https://github.com/HaydnTrigg/glslang into HaydnTrigg-patch-1
This commit is contained in:
commit
c88edb1319
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user