[Mesa-dev] [PATCH] mesa: Set default bufferobj access to zero

Kenneth Graunke kenneth at whitecape.org
Mon Nov 19 11:04:58 PST 2012


On 11/19/2012 10:55 AM, Matt Turner wrote:
> Fixes - copy_buffer_defaults
>        - map_buffer_range_modify_indices
>        - pixel_buffer_object_default_parameters
> in es3conform.
> ---
>   src/mesa/main/bufferobj.c |    9 +++++++--
>   1 files changed, 7 insertions(+), 2 deletions(-)
>
> This code was previously returning GL_MAP_WRITE_BIT for ES since
> GL_OES_mapbuffer is exposed. We *do* expose this on ES 3 as well,
> so we probably need to do something more than this patch.
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 5521617..8471b60 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -155,8 +155,13 @@ default_access_mode(const struct gl_context *ctx)
>       * The difference is because GL_OES_mapbuffer only supports mapping buffers
>       * write-only.
>       */
> -   return _mesa_is_gles(ctx)
> -      ? GL_MAP_WRITE_BIT : (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
> +   if (_mesa_is_gles3(ctx)) {
> +      return 0;
> +   } else if (_mesa_is_gles(ctx)) {
> +      return GL_MAP_WRITE_BIT;
> +   } else {
> +      return GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
> +   }
>   }

Please see my patch on the list:
mesa: Fix default value of BUFFER_ACCESS_FLAGS.


More information about the mesa-dev mailing list