[Mesa-dev] [RFC] [PATCH 1/2] mesa: let GL3 buf obj queries not depend on opengl major version

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu Sep 22 20:23:05 PDT 2011


On Mon, Sep 19, 2011 at 06:25:54PM +0800, Yuanhan Liu wrote:
> If I understand correctly, the new GL3 buffer object queries parameters,
> like BUFFER_MAP_ACCESS_FLAGS, depends on ARB_map_buffer_range
> extension.

Hello,

Any more comments?

BTW, it doesn't make sense for me that we can set the access flag but we
can't query it.

Thanks,
Yuanhan Liu
> 
> Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> ---
>  src/mesa/main/bufferobj.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index a303401..ba2275d 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -1155,17 +1155,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
>        *params = _mesa_bufferobj_mapped(bufObj);
>        return;
>     case GL_BUFFER_ACCESS_FLAGS:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = bufObj->AccessFlags;
>        return;
>     case GL_BUFFER_MAP_OFFSET:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = (GLint) bufObj->Offset;
>        return;
>     case GL_BUFFER_MAP_LENGTH:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = (GLint) bufObj->Length;
>        return;
> @@ -1212,7 +1212,7 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
>        *params = simplified_access_mode(bufObj->AccessFlags);
>        return;
>     case GL_BUFFER_ACCESS_FLAGS:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = bufObj->AccessFlags;
>        return;
> @@ -1220,12 +1220,12 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
>        *params = _mesa_bufferobj_mapped(bufObj);
>        return;
>     case GL_BUFFER_MAP_OFFSET:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = bufObj->Offset;
>        return;
>     case GL_BUFFER_MAP_LENGTH:
> -      if (ctx->VersionMajor < 3)
> +      if (!ctx->Extensions.ARB_map_buffer_range)
>           goto invalid_pname;
>        *params = bufObj->Length;
>        return;
> -- 
> 1.7.4.4


More information about the mesa-dev mailing list