[Mesa-dev] [PATCH] egl_dri2: set ctx->WindowRenderBuffer

Chad Versace chad at chad-versace.us
Tue Aug 30 15:52:16 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/28/2011 08:38 AM, Chia-I Wu wrote:
> From: Chia-I Wu <olv at lunarg.com>
> 
> 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.
> ---
>  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;

Yes. Now eglQuerySurface(EGL_RENDER_BUFFER) will do the right thing.

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

- -- 
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOXWmgAAoJEAIvNt057x8iNh8P/2E46l+ftf9jHKgAbZkuCDR1
wa8wVDKUEKXt5xvZKAPZx9IwoDbNyiHyEf2QOgn3Hk08uQKR7CP1+nzj7nC74oab
AklG79VurGdANLMtynworv7HTfmT6ZmoDkpUEYw31t7AKTVLKTB4LmJy2H0t3dmt
h5pQkW2UZp3h1e0efobQUvY8lFQOb6SUPzU9x8w2MgOen+QShLYZgvu2Xt3Dl0g7
APji6hdNppfRrrpTTOMGkfyARarVc88OWvpLNBCFKKvXkWdN6eJ8oSk3BJfh1T5E
ycvUb2MET2IKVm2nzDswcXNGsQcVJhoiKkmiRtYHafN7uM+vZn/V7YoLuc7w58g0
JaMJNArmq5ADgLPqYI1fu6yc6YZw5QYt2xAKzCT4S3IeJNF9rhv349X40vEofh7u
r8lojv3dbANQJMJ0sKpNdaOJ3euAHLBXSDbQDHpe87l+B2NJmgPqzWzw9HRgXSjS
++tl3c84jpgCVCvl04OfE3XjJ3jLyStlY2M1n7mdBY9C7a9JSZjCdfZC8yNnMRgY
+owL284uR5P4LwR265qD2/LpNXxU7VOKNRN/jYxgIO04iEOBwUyTldUskl/63/h7
IR9Sz5GvO9KQv5U9tJ+wW65al75hk0VF04INubZtARZVrU8AP9lodO9Pu5em2zts
iEozyO7A43oJD/qEi6gM
=yc6i
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list