[Mesa-dev] [PATCH] intel: fix read_only/write_only

Kenneth Graunke kenneth at whitecape.org
Mon Aug 22 11:21:33 PDT 2011


On 08/22/2011 10:37 AM, Ben Widawsky wrote:
> Here was my patch which I forgot to send to the list. I think you missed
> map.

Actually, I think he deleted intel_bufferobj_map in favor of just using 
intel_bufferobj_map_range.  So it didn't need fixing.

> Signed-off-by: Ben Widawsky<ben at bwidawsk.net>
> ---
>   src/mesa/drivers/dri/intel/intel_buffer_objects.c |    9 ++++++---
>   1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> index 703300b..bab5d46 100644
> --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> @@ -307,8 +307,10 @@ intel_bufferobj_map(struct gl_context * ctx,
>   {
>      struct intel_context *intel = intel_context(ctx);
>      struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
> -   GLboolean read_only = (access == GL_READ_ONLY_ARB);
> -   GLboolean write_only = (access == GL_WRITE_ONLY_ARB);
> +   GLboolean read_only = (access&  (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
> +			 GL_MAP_READ_BIT);
> +   GLboolean write_only = (access&  (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
> +			  GL_MAP_WRITE_BIT);
>
>      assert(intel_obj);
>
> @@ -378,7 +380,8 @@ intel_bufferobj_map_range(struct gl_context * ctx,
>   {
>      struct intel_context *intel = intel_context(ctx);
>      struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
> -   GLboolean read_only = (access == GL_READ_ONLY_ARB);
> +   GLboolean read_only = (access&  (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
> +			 GL_MAP_READ_BIT);
>
>      assert(intel_obj);
>



More information about the mesa-dev mailing list