intel: Call _mesa_make_current() after getting initial buffers
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 18 Mar 2010 02:44:58 +0000 (22:44 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 18 Mar 2010 02:45:21 +0000 (22:45 -0400)
The default viewport is the window rectangle, which is set up by
_mesa_make_current().  To be able to do that we need to get the
window dimension (and buffers) first, so we have to call
intel_prepare_render() before we can call into _mesa_make_current().

Fixes #26676 and #26678.

src/mesa/drivers/dri/intel/intel_context.c

index d6a1ba69524f0c7f1f1171deb16e0258d9b1b0b0..c86dd1d0d985ba5dae624321381547272e37a39c 100644 (file)
@@ -880,12 +880,12 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
       struct gl_framebuffer *fb = driDrawPriv->driverPrivate;
       struct gl_framebuffer *readFb = driReadPriv->driverPrivate;
 
-      _mesa_make_current(&intel->ctx, fb, readFb);
       intel->driReadDrawable = driReadPriv;
       intel->driDrawable = driDrawPriv;
       driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1;
       driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
       intel_prepare_render(intel);
+      _mesa_make_current(&intel->ctx, fb, readFb);
    }
    else {
       _mesa_make_current(NULL, NULL, NULL);