OSDN Git Service

intel: Don't force a batchbuffer flush in readpixels.
authorEric Anholt <eric@anholt.net>
Wed, 19 Oct 2011 17:39:15 +0000 (10:39 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 4 Nov 2011 06:29:53 +0000 (23:29 -0700)
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 <brianp@vmware.com>
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_pixel_read.c

index 6638f17..801b747 100644 (file)
@@ -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);
index 47e53d9..08c1692 100644 (file)
@@ -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);
index 803d714..a79b69c 100644 (file)
@@ -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;