[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
Wed Feb 29 21:35:58 PST 2012


On Wed, Feb 29, 2012 at 08:41:45AM -0800, Jose Fonseca wrote:
> Yuanhan,
> 
> Let's commit this. I think that was the consensus.
> 
> Without it it will be extremely hard to get apitrace to accurately track recursive buffer mappings w/ 2.x, as described in https://github.com/apitrace/apitrace/issues/66 .
> 
> I'll try to keep apitrace working correctly without these queries for non-recursive buffer mappings, but I won't try to fix the recursive case without these queries.
> 
> If I don't hear any objections I'll commit this myself.
Hi Jose,

Please go ahead :) and thanks.


> 
> Jose
> 
> ----- Original Message -----
> > 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
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > 


More information about the mesa-dev mailing list