Mesa (master): i965: Remember to call intel_prepare_render() before blitting.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Aug 8 19:13:55 UTC 2013


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Aug  6 14:36:09 2013 -0700

i965: Remember to call intel_prepare_render() before blitting.

Otherwise, blits to the window system buffer may cause crashes,
since dst_irb->mt may be NULL.

This code is lifted straight out of brw_blorp_framebuffer()'s
try_blorp_blit() helper.

Fixes crashes in Piglit's fbo-sys-blit on systems without BLORP.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65919
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <idr at freedesktop.org>
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Cc: "9.2" <mesa-stable at lists.freedesktop.org>

---

 src/mesa/drivers/dri/i965/intel_fbo.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index fb0bb71..1692325 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -695,6 +695,11 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
 {
    struct brw_context *brw = brw_context(ctx);
 
+   /* Sync up the state of window system buffers.  We need to do this before
+    * we go looking for the buffers.
+    */
+   intel_prepare_render(brw);
+
    if (mask & GL_COLOR_BUFFER_BIT) {
       GLint i;
       const struct gl_framebuffer *drawFb = ctx->DrawBuffer;




More information about the mesa-commit mailing list