From 3bb2a24921af0ec419afc928ee5b279982aa01ea Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Wed, 3 Sep 2008 14:47:36 +0800 Subject: [PATCH] intel: Fix a crash if dri2 is disabled. --- src/mesa/drivers/dri/intel/intel_context.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index f0ee96f18da..2975e4c0f09 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -921,14 +921,14 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, struct intel_framebuffer *intel_fb = (struct intel_framebuffer *) driDrawPriv->driverPrivate; GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate; - - intel_update_renderbuffers(driContextPriv, driDrawPriv); - if (driDrawPriv != driReadPriv) - intel_update_renderbuffers(driContextPriv, driReadPriv); - - /* XXX FBO temporary fix-ups! */ - /* if the renderbuffers don't have regions, init them from the context */ - if (!driContextPriv->driScreenPriv->dri2.enabled) { + + if (driContextPriv->driScreenPriv->dri2.enabled) { + intel_update_renderbuffers(driContextPriv, driDrawPriv); + if (driDrawPriv != driReadPriv) + intel_update_renderbuffers(driContextPriv, driReadPriv); + } else { + /* XXX FBO temporary fix-ups! */ + /* if the renderbuffers don't have regions, init them from the context */ struct intel_renderbuffer *irbDepth = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); struct intel_renderbuffer *irbStencil -- 2.30.2