[Mesa-dev,1/2] Revert "intel: Fix initial MakeCurrent for single-buffer drawables"

Submitted by Iago Toral Quiroga on April 8, 2014, 8:20 a.m.

Details

Message ID 1396945250-532-2-git-send-email-itoral@igalia.com
State Rejected
Headers show

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga April 8, 2014, 8:20 a.m.
This reverts commit 11baad35088dfd4bdabc1710df650dbfb413e7a3.

This was producing regressions, at least:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74005
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77083
---
 src/mesa/drivers/dri/i965/brw_context.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index e113654..7c6281a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -932,6 +932,7 @@  intelMakeCurrent(__DRIcontext * driContextPriv,
    if (driContextPriv) {
       struct gl_context *ctx = &brw->ctx;
       struct gl_framebuffer *fb, *readFb;
+      struct intel_renderbuffer *rb = NULL;
 
       if (driDrawPriv == NULL && driReadPriv == NULL) {
          fb = _mesa_get_incomplete_framebuffer();
@@ -939,6 +940,7 @@  intelMakeCurrent(__DRIcontext * driContextPriv,
       } else {
          fb = driDrawPriv->driverPrivate;
          readFb = driReadPriv->driverPrivate;
+         rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
          driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1;
          driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
       }
@@ -950,11 +952,11 @@  intelMakeCurrent(__DRIcontext * driContextPriv,
       intel_gles3_srgb_workaround(brw, fb);
       intel_gles3_srgb_workaround(brw, readFb);
 
-      /* If the context viewport hasn't been initialized, force a call out to
-       * the loader to get buffers so we have a drawable size for the initial
-       * viewport. */
-      if (!brw->ctx.ViewportInitialized)
+      if (rb && !rb->mt) {
+         /* If we don't have buffers for the drawable yet, force a call to
+          * getbuffers here so we can have a default drawable size. */
          intel_prepare_render(brw);
+      }
 
       _mesa_make_current(ctx, fb, readFb);
    } else {