diff options
author | Kristian Høgsberg <[email protected]> | 2010-05-10 16:01:38 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-05-10 17:48:11 -0400 |
commit | d8cfdbe894be8691242df4e812601320fbf6c5e7 (patch) | |
tree | ffa4f5641571086fdafd9bcfa81ebc86612caf59 | |
parent | 32942d2b1c80d3f16048d6acfedf7dbcf5e2f8cb (diff) |
intel: Don't mark front buffer dirty if we're only reading
When we call intel_prepare_render() from intelReadPixels(), we'll mark
the front buffer dirty. That's silly, since we're only reading from it
and marking it dirty will cause us to copy from fake front to front
eventually.
Just clear the dirty flag after doing the read.
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_read.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 2ac3da7f42f..0c95a975ff4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -170,11 +170,19 @@ intelReadPixels(GLcontext * ctx, GLenum format, GLenum type, const struct gl_pixelstore_attrib *pack, GLvoid * pixels) { + struct intel_context *intel = intel_context(ctx); + GLboolean dirty; + if (INTEL_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s\n", __FUNCTION__); intelFlush(ctx); - intel_prepare_render(intel_context(ctx)); + + /* glReadPixels() wont dirty the front buffer, so reset the dirty + * flag after calling intel_prepare_render(). */ + dirty = intel->front_buffer_dirty; + intel_prepare_render(intel); + intel->front_buffer_dirty = dirty; if (do_blit_readpixels (ctx, x, y, width, height, format, type, pack, pixels)) @@ -193,4 +201,7 @@ intelReadPixels(GLcontext * ctx, _mesa_update_state(ctx); _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels); + + /* There's an intel_prepare_render() call in intelSpanRenderStart(). */ + intel->front_buffer_dirty = dirty; } |