diff options
author | Eric Anholt <[email protected]> | 2011-10-19 10:39:15 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-11-03 23:29:53 -0700 |
commit | ac6a376f528e4867b8422e42fd36c10e4fa79cfb (patch) | |
tree | e2665754a230ecabec79d5e27e2459f4f8bbff01 /src/mesa/drivers | |
parent | e7349a55f75e8d1155684b5ad0f9dede55eb8549 (diff) |
intel: Don't force a batchbuffer flush in readpixels.
Renderbuffer mapping handles flushing the batchbuffer if required, so
all we need to do is make sure any pending rendering has reached the
batchbuffer.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_read.c | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 6638f1704a4..801b747a926 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -495,7 +495,7 @@ intelInvalidateState(struct gl_context * ctx, GLuint new_state) } void -intel_flush(struct gl_context *ctx) +intel_flush_rendering_to_batch(struct gl_context *ctx) { struct intel_context *intel = intel_context(ctx); @@ -504,6 +504,14 @@ intel_flush(struct gl_context *ctx) if (intel->gen < 4) INTEL_FIREVERTICES(intel); +} + +void +intel_flush(struct gl_context *ctx) +{ + struct intel_context *intel = intel_context(ctx); + + intel_flush_rendering_to_batch(ctx); if (intel->batch.used) intel_batchbuffer_flush(intel); diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 47e53d9e38a..08c1692ad96 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -483,6 +483,7 @@ extern bool intelInitContext(struct intel_context *intel, struct dd_function_table *functions); extern void intelFinish(struct gl_context * ctx); +extern void intel_flush_rendering_to_batch(struct gl_context *ctx); extern void intel_flush(struct gl_context * ctx); extern void intelInitDriverFunctions(struct dd_function_table *functions); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 803d7147037..a79b69ca695 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -172,14 +172,14 @@ intelReadPixels(struct gl_context * ctx, struct intel_context *intel = intel_context(ctx); bool dirty; + intel_flush_rendering_to_batch(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 * flag after calling intel_prepare_render(). */ dirty = intel->front_buffer_dirty; |