intel: Fix a crash if dri2 is disabled.
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 3 Sep 2008 06:47:36 +0000 (14:47 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 3 Sep 2008 06:47:36 +0000 (14:47 +0800)
src/mesa/drivers/dri/intel/intel_context.c

index f0ee96f18dac7c2178ee245d760175a0632b44c4..2975e4c0f0930c02ad39ef830c2641934976e901 100644 (file)
@@ -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