OSDN Git Service

intel: Ensure renderbuffers are current when mapping them.
authorEric Anholt <eric@anholt.net>
Fri, 19 Apr 2013 21:47:28 +0000 (14:47 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Apr 2013 17:40:45 +0000 (10:40 -0700)
In the case of renering to windows in X, we would render to stale buffers
(or not render at all!) if you hit a MapRenderbuffer as the first thing
done to your window after new buffers are ready to be collected in DRI2.

I think this also covers the weird comment about irb->mt being missing
sometimes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/intel/intel_fbo.c

index 0a55afd..6b5e513 100644 (file)
@@ -123,12 +123,7 @@ intel_map_renderbuffer(struct gl_context *ctx,
       return;
    }
 
-   /* We sometimes get called with this by our intel_span.c usage. */
-   if (!irb->mt) {
-      *out_map = NULL;
-      *out_stride = 0;
-      return;
-   }
+   intel_prepare_render(intel);
 
    /* For a window-system renderbuffer, we need to flip the mapping we receive
     * upside-down.  So we need to ask for a rectangle on flipped vertically, and