[Mesa-dev] [PATCH 1/2] vbo: Don't bother checking for stride == 0 for "any varying in a VBO".

Eric Anholt eric at anholt.net
Thu Jun 23 13:44:22 PDT 2011


On Fri, 17 Jun 2011 14:43:21 -0600, Brian Paul <brianp at vmware.com> wrote:
> On 06/17/2011 02:36 PM, Eric Anholt wrote:
> > We would still want to consider that data as being in a VBO even if we
> > managed to produce this case, which as far as I know we can't.
> > ---
> >   src/mesa/vbo/vbo_rebase.c |    3 +--
> >   1 files changed, 1 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c
> > index 9068ae2..15e5895 100644
> > --- a/src/mesa/vbo/vbo_rebase.c
> > +++ b/src/mesa/vbo/vbo_rebase.c
> > @@ -90,8 +90,7 @@ GLboolean vbo_any_varyings_in_vbos( const struct gl_client_array *arrays[] )
> >      GLuint i;
> >
> >      for (i = 0; i<  VERT_ATTRIB_MAX; i++)
> > -      if (arrays[i]->StrideB&&
> > -	  arrays[i]->BufferObj->Name != 0)
> > +      if (arrays[i]->BufferObj->Name != 0)
> >   	 return GL_TRUE;
> >
> >      return GL_FALSE;
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>
> 
> As a clean-up you might want to use the _mesa_is_bufferobj() function 
> instead of Name!=0 to test if the array is stored in a VBO.  We're 
> doing that in most other places in the VBO code.
> 
> For people reading along: all vertex arrays have pointers to a buffer 
> object but for user-space arrays we point to a dummy buffer object 
> with Name=0.

vbo/ is currently half and half.  I wish coccinelle worked more reliably
on Mesa so we could consistently make these changes instead of being so
ad-hoc about it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110623/9189919b/attachment.pgp>


More information about the mesa-dev mailing list