[Piglit] New test regarding GL_CLIENT_VERTEX_ARRAY_BIT on push/pop

Mathias Fröhlich Mathias.Froehlich at gmx.net
Wed Nov 2 13:36:15 PDT 2011


Hi,

On Monday, October 31, 2011 16:55:56 Brian Paul wrote:
> Buffer objects are reference counted.  A BO isn't truly deleted until
> its refcount hits zero.  If a BO is referenced by some pushed/saved
> state, the BO won't be deleted until after that saved state is popped.
>   The alternative would be to dig through (multiple layers of) the
> saved state and remove references to the buffer.  I don't think that
> makes sense.
I agree with that.

The question is what a user observes by the OpenGL api.
What does glGet* return on buffer object array bindings?
How does a draw behave past the pop?

Regarding mesa, we could check the DeletePending flag on pop which would be a 
pretty cheap test to get rid of the already deleted buffer objects on pop.
This was actually the motivation I introduced this flag. Once I did, I realized 
that it also helps to solve a different problem.

> > Nicely also the closed source drivers as of today from nvidia
> > and ati also disagree with their behaviour.
> 
> Can you elaborate?

The nvidia binary only driver really binds the 0 object to the buffer array 
bindings that that are deleted. That still holds for the poped array buffer 
object bindings.
That does not mean that their internal object implementation really releases 
the buffer object at this time.
This just means that you can no longer observe this buffer object from the 
OpenGL api.

The ati binary driver did something different. I don't remember exactly. But 
there were some buffer object names which were non zero past the pop even if 
the buffer object in question was deleted between push and pop.
I can recheck - but probably not before the beginning of next week.

The way nvidia handles this corner case, matches my personal expectations as 
the buffer object is no longer visible in terms of api queries once it is 
deleted.

> > Please review and apply if the test is ok so far.
> 
> I think a better name for the test would be "varray-push-pop-state" or
> something like that.
> 
> Other minor comments below.
I will post a followup test.

> > @@ -0,0 +1,568 @@
> > +/*
> > + * (C) Copyright IBM Corporation 2006
> 
> Is this test derrived from an IBM test?
Yes, the very initial starting point was vao-02.c ...

Thanks for looking into this.

Mathias


More information about the Piglit mailing list