intel: Call intel_draw_buffer() again after _mesa_make_current()
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 17 May 2010 20:49:55 +0000 (16:49 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 17 May 2010 20:50:44 +0000 (16:50 -0400)
The initial call to intel_draw_buffers() happens when
intel->ctx.DrawBuffer is still NULL.  Call it again after
calling _mesa_make_current().

https://bugs.freedesktop.org/show_bug.cgi?id=28112

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

index 150f4b35c7e509e319c71fec199e657618a2d31a..e714e2e90b070fc75e1fc0c1f0bee83edfd54f5f 100644 (file)
@@ -906,6 +906,12 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
       driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
       intel_prepare_render(intel);
       _mesa_make_current(&intel->ctx, fb, readFb);
+
+      /* We do this in intel_prepare_render() too, but intel->ctx.DrawBuffer
+       * is NULL at that point.  We can't call _mesa_makecurrent()
+       * first, since we need the buffer size for the initial
+       * viewport.  So just call intel_draw_buffer() again here. */
+      intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer);
    }
    else {
       _mesa_make_current(NULL, NULL, NULL);