Commit 6953d4a1 by Nicolas Capens Committed by Nicolas Capens

Fix loops with dynamic iteration count.

The 'enable' execution mask for if/else, which is also used by loops, was not being applied to predicate the instructions within a loop. Bug b/28710510 Change-Id: Ibd8e962ef60de76ec1c018ca064a791abf214c94 Reviewed-on: https://swiftshader-review.googlesource.com/15948Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent ac6d5050
...@@ -1684,12 +1684,12 @@ namespace sw ...@@ -1684,12 +1684,12 @@ namespace sw
for(unsigned int i = 0; i < instruction.size(); i++) for(unsigned int i = 0; i < instruction.size(); i++)
{ {
// If statements // If statements and loops
if(instruction[i]->isBranch()) if(instruction[i]->isBranch() || instruction[i]->isLoop())
{ {
branchDepth++; branchDepth++;
} }
else if(instruction[i]->opcode == OPCODE_ENDIF) else if(instruction[i]->opcode == OPCODE_ENDIF || instruction[i]->isEndLoop())
{ {
branchDepth--; branchDepth--;
} }
......
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