}
void
-intel_batchbuffer_flush(struct intel_batchbuffer *batch)
+_intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
+ int line)
{
struct intel_context *intel = batch->intel;
GLuint used = batch->ptr - batch->map;
if (used == 0)
return;
+ if (INTEL_DEBUG & DEBUG_BATCH)
+ fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line,
+ used);
/* Add the MI_BATCH_BUFFER_END. Always add an MI_FLUSH - this is a
* performance drain that we would like to avoid.
*/
void intel_batchbuffer_finish(struct intel_batchbuffer *batch);
-void intel_batchbuffer_flush(struct intel_batchbuffer *batch);
+void _intel_batchbuffer_flush(struct intel_batchbuffer *batch,
+ const char *file, int line);
+
+#define intel_batchbuffer_flush(batch) \
+ _intel_batchbuffer_flush(batch, __FILE__, __LINE__)
void intel_batchbuffer_reset(struct intel_batchbuffer *batch);
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;
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;
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) {
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?
*/