[Mesa-dev] [PATCH] mesa: fix default_access_mode() result for ES2

Ian Romanick idr at freedesktop.org
Wed Aug 1 09:53:27 PDT 2012


On 08/01/2012 09:51 AM, Brian Paul wrote:
> The GL_OES_mapbuffer extension is supported by OpenGL ES 1 and ES 2 so return
> GL_MAP_WRITE_BIT for both ES versions, not just ES 1.

Yes, but keep ?:.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   src/mesa/main/bufferobj.c |    6 ++++--
>   1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index c7c21fb..912ba61 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -150,8 +150,10 @@ default_access_mode(const struct gl_context *ctx)
>       * The difference is because GL_OES_mapbuffer only supports mapping buffers
>       * write-only.
>       */
> -   return (ctx->API == API_OPENGLES)
> -      ? GL_MAP_WRITE_BIT : (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
> +   if (_mesa_is_gles(ctx))
> +      return GL_MAP_WRITE_BIT;
> +   else
> +      return GL_MAP_WRITE_BIT | GL_MAP_READ_BIT;
>   }
>
>


More information about the mesa-dev mailing list