OSDN Git Service

Fixed initializing the 'leave' enable mask on every shader iteration.
authorNicolas Capens <capn@google.com>
Tue, 6 May 2014 20:42:26 +0000 (16:42 -0400)
committerNicolas Capens <capn@google.com>
Tue, 6 May 2014 20:42:26 +0000 (16:42 -0400)
src/Shader/PixelRoutine.cpp
src/Shader/PixelRoutine.hpp
src/Shader/VertexProgram.cpp
src/Shader/VertexRoutine.hpp

index 2528a9c..42f6189 100644 (file)
@@ -3781,6 +3781,11 @@ namespace sw
                r.enableIndex = 0;
                r.stackIndex = 0;
 
+               if(shader->containsLeaveInstruction())
+               {
+                       r.enableLeave = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
+               }
+
                bool out[4][4] = {false};
 
                // Create all call site return blocks up front
index de8533d..1439467 100644 (file)
@@ -66,11 +66,6 @@ namespace sw
                                        enableContinue = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
                                }
 
-                               if(shader && shader->containsLeaveInstruction())
-                               {
-                                       enableLeave = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
-                               }
-
                                occlusion = 0;
                                
                                #if PERF_PROFILE
index 6075d1f..75dc5df 100644 (file)
@@ -70,6 +70,11 @@ namespace sw
                r.enableIndex = 0;
                r.stackIndex = 0;
 
+               if(shader->containsLeaveInstruction())
+               {
+                       r.enableLeave = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
+               }
+
                // Create all call site return blocks up front
                for(int i = 0; i < shader->getLength(); i++)
                {
index 7c174e8..17c04dd 100644 (file)
@@ -41,11 +41,6 @@ namespace sw
                                {
                                        enableContinue = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
                                }
-
-                               if(shader && shader->containsLeaveInstruction())
-                               {
-                                       enableLeave = Int4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
-                               }
                        }
 
                        Pointer<Byte> data;