summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_buffers.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-01-10 13:24:14 -0800
committerEric Anholt <eric@anholt.net>2008-01-10 13:24:14 -0800
commitab2933df65628d8f1f0a3f49129442bc8d2c3a2b (patch)
tree88c19afcfd9c9b8cd24e6edb8c93e203aa855117 /src/mesa/drivers/dri/intel/intel_buffers.c
parenta04b632350e5d0e9994fc667afc59407a39da0ba (diff)
[intel] Only flush batch when changing draw buffers, not every cliprect update.
The previous code would reference freed memory on window moves.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_buffers.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index ceb3058351..dc54c18f40 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -135,9 +135,6 @@ intel_readbuf_region(struct intel_context *intel)
static void
intelSetRenderbufferClipRects(struct intel_context *intel)
{
- /* flush batch since pClipRects may change */
- intel_batchbuffer_flush(intel->batch);
-
assert(intel->ctx.DrawBuffer->Width > 0);
assert(intel->ctx.DrawBuffer->Height > 0);
intel->fboRect.x1 = 0;
@@ -163,9 +160,6 @@ intelSetFrontClipRects(struct intel_context *intel)
if (!dPriv)
return;
- /* flush batch since pClipRects may change */
- intel_batchbuffer_flush(intel->batch);
-
intel->numClipRects = dPriv->numClipRects;
intel->pClipRects = dPriv->pClipRects;
intel->drawX = dPriv->x;
@@ -185,9 +179,6 @@ intelSetBackClipRects(struct intel_context *intel)
if (!dPriv)
return;
- /* flush batch since pClipRects may change */
- intel_batchbuffer_flush(intel->batch);
-
intel_fb = dPriv->driverPrivate;
if (intel_fb->pf_active || dPriv->numBackClipRects == 0) {
@@ -933,6 +924,12 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
if (fb->Name)
intel_validate_paired_depth_stencil(ctx, fb);
+ /* If the batch contents require looping over cliprects, flush them before
+ * we go changing which cliprects get referenced when that happens.
+ */
+ if (intel->batch->cliprect_mode == LOOP_CLIPRECTS)
+ intel_batchbuffer_flush(intel->batch);
+
/*
* How many color buffers are we drawing into?
*/