intel: Count fragments in our blitter-based glBitmap() path.
authorEric Anholt <eric@anholt.net>
Tue, 21 May 2013 23:20:18 +0000 (16:20 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 22 May 2013 21:35:44 +0000 (14:35 -0700)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59440
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_pixel_bitmap.c

index 954dfc50b141b325443cd76944189699f3d2c3f0..c538a29571aa4b47b0dc5cf5bb7cfd9eacfad549 100644 (file)
@@ -259,14 +259,15 @@ do_blit_bitmap( struct gl_context *ctx,
          * Have to translate destination coordinates back into source
          * coordinates.
          */
-        if (get_bitmap_rect(bitmap_width, bitmap_height, unpack,
-                            bitmap,
-                            -orig_dstx + (dstx + px),
-                            -orig_dsty + y_flip(fb, dsty + py, h),
-                            w, h,
-                            (GLubyte *)stipple,
-                            8,
-                            _mesa_is_winsys_fbo(fb)) == 0)
+         int count = get_bitmap_rect(bitmap_width, bitmap_height, unpack,
+                                     bitmap,
+                                     -orig_dstx + (dstx + px),
+                                     -orig_dsty + y_flip(fb, dsty + py, h),
+                                     w, h,
+                                     (GLubyte *)stipple,
+                                     8,
+                                     _mesa_is_winsys_fbo(fb));
+         if (count == 0)
            continue;
 
         if (!intelEmitImmediateColorExpandBlit(intel,
@@ -284,6 +285,9 @@ do_blit_bitmap( struct gl_context *ctx,
                                                logic_op)) {
            return false;
         }
+
+         if (ctx->Query.CurrentOcclusionObject)
+            ctx->Query.CurrentOcclusionObject->Result += count;
       }
    }
 out: