OSDN Git Service

Fix 'continue' in GLSL loops.
authorNicolas Capens <capn@google.com>
Thu, 1 Nov 2018 20:53:36 +0000 (16:53 -0400)
committerNicolas Capens <nicolascapens@google.com>
Fri, 2 Nov 2018 14:07:30 +0000 (14:07 +0000)
commit2f490f064772811703a0f8a7b2ec38805841f2c3
treed0e94070f69c37e325df311a46e2e02e18fc6e13
parent42e8e54e30494a922ddb1168ff2e0e2fda26b0bd
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>
src/OpenGL/compiler/OutputASM.cpp
src/Shader/PixelProgram.cpp
src/Shader/PixelProgram.hpp
src/Shader/VertexProgram.cpp
src/Shader/VertexProgram.hpp