OSDN Git Service

Fixed Temporary issues
authorAlexis Hetu <sugoi@google.com>
Fri, 25 Sep 2015 17:09:56 +0000 (13:09 -0400)
committerAlexis Hétu <sugoi@google.com>
Fri, 25 Sep 2015 19:08:55 +0000 (19:08 +0000)
Some issues, like failures using the do-while command, were caused
by the assembler being unable to assign registers consistently for
a single temporary variable. For example, in the do-while case, the
"iterate" Temporary object was not being assigned to the same
register between it's initial declaration and it's usage inside the
loop condition later on, causing the do-while to behave weirdly.
Other instances where multiple Temporary objects ended up being used
simultaneously of where a single object was references in multiple
parts of the code could have failed because of this.

The fix is simply to assign Temporary objects a unique ID.

Change-Id: Ie48c596b4c6570853702cab71497b3e00a40c2a0
Reviewed-on: https://swiftshader-review.googlesource.com/4015
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/compiler/OutputASM.cpp

index f6210ec..5a7b108 100644 (file)
@@ -33,7 +33,7 @@ namespace glsl
        class Temporary : public TIntermSymbol\r
        {\r
        public:\r
-               Temporary(OutputASM *assembler) : TIntermSymbol(0, "tmp", TType(EbtFloat, EbpHigh, EvqTemporary, 4, 1, false)), assembler(assembler)\r
+               Temporary(OutputASM *assembler) : TIntermSymbol(TSymbolTableLevel::nextUniqueId(), "tmp", TType(EbtFloat, EbpHigh, EvqTemporary, 4, 1, false)), assembler(assembler)\r
                {\r
                }\r
 \r