OSDN Git Service

Fix deterministic loops within conditional blocks.
authorNicolas Capens <capn@google.com>
Sat, 20 Oct 2018 18:17:49 +0000 (14:17 -0400)
committerNicolas Capens <nicolascapens@google.com>
Mon, 22 Oct 2018 14:11:13 +0000 (14:11 +0000)
commit8a587714cb9f6efc69192481867d437014496b07
tree7f0393a9e99babc9231c4468322690a06869045d
parent082dfec95519d26a94681aa821bebb1da18d096d
Fix deterministic loops within conditional blocks.

Deterministic loops use the first scalar of the SIMD register used as
the loop index, for addressing arrays. This means that operations on the
index register should not be masked (i.e. it should be treated as a
scalar).

Previously we were still masking it based on conditional statements, and
we didn't disable the masking altogether (using the 'TEST' instruction)
for the loop initialization and initial test.

Also, non-deterministic loops should not have any execution masking
disabled, so don't emit 'TEST' for them.

Bug swiftshader:93
Bug b/118009174

Change-Id: I661de83df931d85f806d2ec5c9e1b2f20a9b5567
Reviewed-on: https://swiftshader-review.googlesource.com/c/21788
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
src/Common/Version.h
src/OpenGL/compiler/OutputASM.cpp
src/Shader/PixelProgram.cpp
src/Shader/VertexProgram.cpp