Module: Mesa
Branch: 10.1
Commit: c79a7ef9a3d86116f8b8775d1f1960ef179198eb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c79a7ef9a3d86116f8b8775d1f1960ef179198eb

Author: Kristian Høgsberg <k...@bitplanet.net>
Date:   Wed Feb  5 10:59:02 2014 -0800

i965: Move intel_prepare_render() above first buffer access

The driver is supposed to ensure buffers before any drawing operation, but in
do_blit_drawpixels() and do_blit_copypixels() we inspect the buffer format
before calling intel_prepare_render().  That was covered up by the
unconditional call to intel_prepare_render() in intelMakeCurrent(), but we
now only do this on the initial intelMakeCurrent call for a context
(to get the size for the initial viewport values).

https://bugs.freedesktop.org/show_bug.cgi?id=74083

Signed-off-by: Kristian Høgsberg <k...@bitplanet.net>
Tested-by: Alexander Monakov <amona...@gmail.com>
(cherry picked from commit 44338cd826623ae0675861015a56c528261f3fd3)

---

 src/mesa/drivers/dri/i965/intel_pixel_copy.c |    4 ++--
 src/mesa/drivers/dri/i965/intel_pixel_draw.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c 
b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
index b2795c6..486e308 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -66,6 +66,8 @@ do_blit_copypixels(struct gl_context * ctx,
    /* Update draw buffer bounds */
    _mesa_update_state(ctx);
 
+   intel_prepare_render(brw);
+
    switch (type) {
    case GL_COLOR:
       if (fb->_NumColorDrawBuffers != 1) {
@@ -148,8 +150,6 @@ do_blit_copypixels(struct gl_context * ctx,
       return false;
    }
 
-   intel_prepare_render(brw);
-
    intel_batchbuffer_flush(brw);
 
    /* Clip to destination buffer. */
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_draw.c 
b/src/mesa/drivers/dri/i965/intel_pixel_draw.c
index a09c139..2925b63 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_draw.c
@@ -72,6 +72,8 @@ do_blit_drawpixels(struct gl_context * ctx,
       return false;
    }
 
+   intel_prepare_render(brw);
+
    struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
 
@@ -101,8 +103,6 @@ do_blit_drawpixels(struct gl_context * ctx,
    src_offset += _mesa_image_offset(2, unpack, width, height,
                                    format, type, 0, 0, 0);
 
-   intel_prepare_render(brw);
-
    src_buffer = intel_bufferobj_buffer(brw, src,
                                       src_offset, width * height *
                                        irb->mt->cpp);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to