Mesa (master): egl_dri2: set ctx->WindowRenderBuffer

Chia-I Wu olv at kemper.freedesktop.org
Tue Aug 30 21:09:23 PDT 2011


Module: Mesa
Branch: master
Commit: 357d3f30f36878a3010547b669f055a2043cbbaa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=357d3f30f36878a3010547b669f055a2043cbbaa

Author: Chia-I Wu <olv at lunarg.com>
Date:   Sat Aug 27 01:42:16 2011 +0800

egl_dri2: set ctx->WindowRenderBuffer

Set ctx->WindowRenderBuffer to EGL_BACK_BUFFER.  As EGL_WINDOW_BIT of a
config is set only when there is dri_double_buffer, that makes sure
window surfaces are always double-buffered and contexts will render to
the back buffer.

Reviewed-by: Chad Versace <chad at chad-versace.us>

---

 src/egl/drivers/dri2/egl_dri2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 4aa1df0..0099a0d 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -697,6 +697,12 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
          dri_config = dri2_config->dri_double_config;
       else
          dri_config = dri2_config->dri_single_config;
+
+      /* EGL_WINDOW_BIT is set only when there is a dri_double_config.  This
+       * makes sure the back buffer will always be used.
+       */
+      if (conf->SurfaceType & EGL_WINDOW_BIT)
+         dri2_ctx->base.WindowRenderBuffer = EGL_BACK_BUFFER;
    }
    else
       dri_config = NULL;



More information about the mesa-commit mailing list