Skip to content
Snippets Groups Projects
Commit d3c123a0 authored by John Kessenich's avatar John Kessenich
Browse files

Fix bug where non-constant test in ?: on a constant results thought the result...

Fix bug where non-constant test in ?: on a constant results thought the result was const, when it is really a temporary.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27291 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent a63faa79
No related branches found
No related tags found
No related merge requests found
......@@ -231,6 +231,32 @@ ERROR: node is still EOpNull!
0:118 'p' (int)
0:118 Constant:
0:118 -2147483647 (const int)
0:119 Sequence
0:119 move second child to first child (float)
0:119 'f' (float)
0:119 Constant:
0:119 1.444000
0:120 move second child to first child (float)
0:120 'f' (float)
0:120 direct index (float)
0:120 Construct vec4 (4-component vector of float)
0:120 Test condition and select (float)
0:120 Condition
0:120 Compare Less Than (bool)
0:120 direct index (float)
0:120 'inv' (smooth in 4-component vector of float)
0:120 Constant:
0:120 0 (const int)
0:120 Constant:
0:120 2.400000
0:120 true case
0:120 Constant:
0:120 -1.000000
0:120 false case
0:120 Constant:
0:120 1.000000
0:120 Constant:
0:120 3 (const int)
0:? Linker Objects
0:? 'a' (const int)
0:? 1 (const int)
......@@ -532,6 +558,32 @@ ERROR: node is still EOpNull!
0:118 'p' (int)
0:118 Constant:
0:118 -2147483647 (const int)
0:119 Sequence
0:119 move second child to first child (float)
0:119 'f' (float)
0:119 Constant:
0:119 1.444000
0:120 move second child to first child (float)
0:120 'f' (float)
0:120 direct index (float)
0:120 Construct vec4 (4-component vector of float)
0:120 Test condition and select (float)
0:120 Condition
0:120 Compare Less Than (bool)
0:120 direct index (float)
0:120 'inv' (smooth in 4-component vector of float)
0:120 Constant:
0:120 0 (const int)
0:120 Constant:
0:120 2.400000
0:120 true case
0:120 Constant:
0:120 -1.000000
0:120 false case
0:120 Constant:
0:120 1.000000
0:120 Constant:
0:120 3 (const int)
0:? Linker Objects
0:? 'a' (const int)
0:? 1 (const int)
......
......@@ -116,4 +116,6 @@ void foo2()
p = -2147483647 / -1;
p = -2147483648 / -1;
p = 2147483647 / -1;
float f = vec4(7.8 < 2.4 ? -1.333 : 1.444).a;
f = vec4(inv.x < 2.4 ? -1.0 : 1.0).a; // not folded, ensuring no propagation
}
......@@ -784,6 +784,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
// Make a selection node.
//
TIntermSelection* node = new TIntermSelection(cond, trueBlock, falseBlock, trueBlock->getType());
node->getQualifier().storage = EvqTemporary;
node->setLoc(loc);
node->getQualifier().precision = std::max(trueBlock->getQualifier().precision, falseBlock->getQualifier().precision);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment