summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-11 00:03:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-21 12:59:36 +0000
commit57ca0803b34587f1148b218a11d2193b0d4f4c97 (patch)
tree39a2f5036b163c7ed6e1abc5644a08f915f2be45 /src/mesa
parentc625aa19cb53ed27f91bfd16fea6ea727e9a5bbd (diff)
intel: Skip the flush before read-pixels via blit
As we will flush when reading the return values of the blit, we can forgo the earlier flush. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_read.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index f90f8224c9..b2e77c7986 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -80,6 +80,7 @@ do_blit_readpixels(struct gl_context * ctx,
drm_intel_bo *dst_buffer;
GLboolean all;
GLint dst_x, dst_y;
+ GLuint dirty;
DBG("%s\n", __FUNCTION__);
@@ -129,7 +130,9 @@ do_blit_readpixels(struct gl_context * ctx,
return GL_TRUE;
}
+ dirty = intel->front_buffer_dirty;
intel_prepare_render(intel);
+ intel->front_buffer_dirty = dirty;
all = (width * height * src->cpp == dst->Base.Size &&
x == 0 && dst_offset == 0);
@@ -171,6 +174,10 @@ intelReadPixels(struct gl_context * ctx,
DBG("%s\n", __FUNCTION__);
+ if (do_blit_readpixels
+ (ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
intel_flush(ctx);
/* glReadPixels() wont dirty the front buffer, so reset the dirty
@@ -179,10 +186,6 @@ intelReadPixels(struct gl_context * ctx,
intel_prepare_render(intel);
intel->front_buffer_dirty = dirty;
- if (do_blit_readpixels
- (ctx, x, y, width, height, format, type, pack, pixels))
- return;
-
fallback_debug("%s: fallback to swrast\n", __FUNCTION__);
/* Update Mesa state before calling down into _swrast_ReadPixels, as