i965: Actually track the "if" depth in loop in the new FS backend.
authorEric Anholt <eric@anholt.net>
Tue, 28 Sep 2010 04:25:55 +0000 (21:25 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 28 Sep 2010 16:33:30 +0000 (09:33 -0700)
Fixes:
glsl-fs-if-nested-loop.

src/mesa/drivers/dri/i965/brw_fs.cpp

index d05aa29014f8048e0e62adfc42b5b6f840190ec5..c324be210a0f4a16b59e452ad0f785ac843d7b74 100644 (file)
@@ -1789,6 +1789,7 @@ fs_visitor::generate_code()
       case BRW_OPCODE_IF:
         assert(if_stack_depth < 16);
         if_stack[if_stack_depth] = brw_IF(p, BRW_EXECUTE_8);
+        if_depth_in_loop[loop_stack_depth]++;
         if_stack_depth++;
         break;
       case BRW_OPCODE_ELSE:
@@ -1798,6 +1799,7 @@ fs_visitor::generate_code()
       case BRW_OPCODE_ENDIF:
         if_stack_depth--;
         brw_ENDIF(p , if_stack[if_stack_depth]);
+        if_depth_in_loop[loop_stack_depth]--;
         break;
 
       case BRW_OPCODE_DO: