i965/fs: Don't modify ann_count if not debugging.
authorMatt Turner <mattst88@gmail.com>
Sun, 25 May 2014 17:30:13 +0000 (10:30 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 25 May 2014 17:32:35 +0000 (10:32 -0700)
If we make ann_count non-zero, annotation_finalize() won't bail.

Not modifying it seems to make the code more clear than would modifying
annotation_finalize().

src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/gen8_fs_generator.cpp

index d1d271933c6b3617b340a4aac397ebad7064f405..6ba8bb98295d8a5bdf11cb2d5d4c548ea68f4ebb 100644 (file)
@@ -1751,7 +1751,9 @@ fs_generator::generate_code(exec_list *instructions,
           * we've emitted any discards.  If not, this will emit no code.
           */
          if (!patch_discard_jumps_to_fb_writes()) {
-            annotation->ann_count--;
+            if (unlikely(debug_flag)) {
+               annotation->ann_count--;
+            }
          }
          break;
 
index bab1208a217674391ffe8085d7b1cf4fb0eb949d..6755398d042a42b58b793221932e0fbaacbbf890 100644 (file)
@@ -1243,7 +1243,11 @@ gen8_fs_generator::generate_code(exec_list *instructions,
          /* This is the place where the final HALT needs to be inserted if
           * we've emitted any discards.  If not, this will emit no code.
           */
-         patch_discard_jumps_to_fb_writes();
+         if (!patch_discard_jumps_to_fb_writes()) {
+            if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
+               annotation->ann_count--;
+            }
+         }
          break;
 
       default: