Hi Robert,

Proposal:

new member: BufferData::_numUsers initialized to BufferData::getReferenceCount when the GL buffer object is created and filled

In Texture:apply, decrement the _numUsers member of the Image and release the GL buffer object if the sum of the _numUsers of all the BufferData contained if the GL buffer object is 0

Any thoughts ?

Lionel

On 14/12/2012 10:12, Robert Osfield wrote:
Hi Lionel,

Thanks for the explanation/code segment on the other thread. I now understand what is at issue, when an PBO is shared between osg::Texture/osg::Image the release is done by the first texture that applies it, rather than the last one to need it. I don't think the suggested fix of modifying the IncrementalCompileOperation is appropriate - it just hides the bug which is actually in the way that osg::Texture does the release based on the assumption that it's the only one using it. A proper solution will be to add some support into osg::BufferObject for registering when BufferData has been used and no longer required.

Robert.


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to