From: John Kessenich Date: Mon, 2 Jul 2018 22:04:31 +0000 (-0600) Subject: Merge branch 'HaydnTrigg-patch-1' X-Git-Tag: upstream/11.4.0~717 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=513cc4cf870033e0d6744b86efc8df4a0cfc8cbe;p=platform%2Fupstream%2Fglslang.git Merge branch 'HaydnTrigg-patch-1' --- 513cc4cf870033e0d6744b86efc8df4a0cfc8cbe diff --cc Test/baseResults/constFold.frag.out index 33cfcba,33cfcba..2a48c42 --- a/Test/baseResults/constFold.frag.out +++ b/Test/baseResults/constFold.frag.out @@@ -179,6 -179,6 +179,10 @@@ ERROR: node is still EOpNull 0:83 2147483647 (const int) 0:84 Constant: 0:84 +1.#INF ++0:84 Constant: ++0:84 -1.#INF ++0:84 Constant: ++0:84 1.#IND 0:88 Constant: 0:88 2 (const uint) 0:88 3 (const uint) diff --cc Test/constFold.frag index 7306078,7306078..daecaa2 mode 100644,100644..100755 --- a/Test/constFold.frag +++ b/Test/constFold.frag @@@ -81,7 -81,7 +81,7 @@@ void foo( a[0] = s.m[1].z; // 7.0 b % 0; // int b / 0; -- e / 0; ++ e / 0; -e / 0; 0.0 / 0.0; const uint ua = 5; const uvec2 ub = uvec2(6, 7); const uint uc = 8; diff --cc glslang/Include/revision.h index 91ea3e6,91ea3e6..bdae4ff --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@@ -1,3 -1,3 +1,3 @@@ // This header is generated by the make-revision script. --#define GLSLANG_PATCH_LEVEL 2787 ++#define GLSLANG_PATCH_LEVEL 2793 diff --cc glslang/MachineIndependent/Constant.cpp index d447bff,60a8b43..26bdced --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@@ -179,7 -179,27 +179,14 @@@ TIntermTyped* TIntermConstantUnion::fol 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); - } - } ++ if (rightUnionArray[i].getDConst() != 0.0) ++ newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst()); ++ else if (leftUnionArray[i].getDConst() > 0.0) ++ newConstArray[i].setDConst((double)INFINITY); ++ else if (leftUnionArray[i].getDConst() < 0.0) ++ newConstArray[i].setDConst((double)-INFINITY); ++ else ++ newConstArray[i].setDConst((double)NAN); break; case EbtInt8: if (rightUnionArray[i] == (signed char)0)