From 3469878bafc8d329309ef60e2473156b08fb40f3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 1 Oct 2010 00:52:34 +0100 Subject: [PATCH] intel: Skip clear for invalid render buffers Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30509 Reported-by: Magnus Kessler Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_blit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 2c85ad3..099a365 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -263,6 +263,9 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) /* OK, clear this renderbuffer */ irb = intel_get_renderbuffer(fb, buf); + if (irb == NULL || irb->region == NULL) + goto clear_bit; + write_buffer = intel_region_buffer(intel, irb->region, all ? INTEL_WRITE_FULL : INTEL_WRITE_PART); @@ -370,6 +373,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) if (intel->always_flush_cache) intel_batchbuffer_emit_mi_flush(intel->batch); +clear_bit: if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL); else -- 1.7.1