Fix 'continue' in GLSL loops.

The test expression of a loop is placed between the TEST and ENDWHILE
shader assembly instructions, and should no longer be affected by the
cleared execution mask of a continue statement. Thus TEST should always
be emitted, even for non-deterministic loops.

Other masks should still apply, and work recursively, so the
'whileTest' boolean to disable all masks during the test expression
evaluation has been replaced with a stack to restore the continue mask
at the TEST instruction.

Bug swiftshader:93
Bug b/118009174

Change-Id: I505c48f0344e61a6c31f81d26e93bc1217a105a2
Reviewed-on: https://swiftshader-review.googlesource.com/c/22248
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/VertexProgram.hpp b/src/Shader/VertexProgram.hpp
index 3c4199c..437c881 100644
--- a/src/Shader/VertexProgram.hpp
+++ b/src/Shader/VertexProgram.hpp
@@ -124,7 +124,6 @@
 		int ifDepth;
 		int loopRepDepth;
 		int currentLabel;
-		bool whileTest;
 
 		BasicBlock *ifFalseBlock[24 + 24];
 		BasicBlock *loopRepTestBlock[4];
@@ -133,6 +132,7 @@
 		std::vector<BasicBlock*> callRetBlock[2048];
 		BasicBlock *returnBlock;
 		bool isConditionalIf[24 + 24];
+		std::vector<Int4> restoreContinue;
 	};
 }