Commit e3f05550 by Nicolas Capens

Implement unrolling of loops using > or >=.

Bug swiftshader:53 Change-Id: I20500e567e58ed29caa0a0ad9ad7884e66e96cb9 Reviewed-on: https://swiftshader-review.googlesource.com/9811Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent d0bfd915
......@@ -3517,7 +3517,7 @@ namespace glsl
TIntermSequence &sequence = init->getSequence();
TIntermTyped *variable = sequence[0]->getAsTyped();
if(variable && variable->getQualifier() == EvqTemporary)
if(variable && variable->getQualifier() == EvqTemporary && variable->getBasicType() == EbtInt)
{
TIntermBinary *assign = variable->getAsBinaryNode();
......@@ -3608,6 +3608,19 @@ namespace glsl
comparator = EOpLessThan;
limit += 1;
}
else if(comparator == EOpGreaterThanEqual)
{
comparator = EOpLessThan;
limit -= 1;
std::swap(initial, limit);
increment = -increment;
}
else if(comparator == EOpGreaterThan)
{
comparator = EOpLessThan;
std::swap(initial, limit);
increment = -increment;
}
if(comparator == EOpLessThan)
{
......
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