Implementated experimental reuse of PBO's after download

This commit is contained in:
Robert Osfield
2011-02-07 14:19:58 +00:00
parent e0924886bd
commit 4b4754c3cf
5 changed files with 49 additions and 7 deletions

View File

@@ -528,6 +528,14 @@ class OSG_EXPORT BufferObject : public Object
BufferObjectProfile& getProfile() { return _profile; }
const BufferObjectProfile& getProfile() const { return _profile; }
/** Set whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately so that it may be reused.*/
void setCopyDataAndReleaseGLBufferObject(bool copyAndRelease) { _copyDataAndReleaseGLBufferObject = copyAndRelease; }
/** Get whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately.*/
bool getCopyDataAndReleaseGLBufferObject() const { return _copyDataAndReleaseGLBufferObject; }
void dirty();
/** Resize any per context GLObject buffers to specified size. */
@@ -572,6 +580,8 @@ class OSG_EXPORT BufferObject : public Object
BufferObjectProfile _profile;
bool _copyDataAndReleaseGLBufferObject;
BufferDataList _bufferDataList;
mutable GLBufferObjects _glBufferObjects;

View File

@@ -39,6 +39,7 @@ class OSGUTIL_EXPORT StateToCompile : public osg::NodeVisitor
TextureSet _textures;
ProgramSet _programs;
bool _assignPBOToImages;
osg::ref_ptr<osg::PixelBufferObject> _pbo;
bool empty() const { return _textures.empty() && _programs.empty() && _drawables.empty(); }
@@ -48,6 +49,7 @@ class OSGUTIL_EXPORT StateToCompile : public osg::NodeVisitor
virtual void apply(osg::Drawable& drawable);
virtual void apply(osg::StateSet& stateset);
virtual void apply(osg::Texture& texture);
};
class OSGUTIL_EXPORT IncrementalCompileOperation : public osg::GraphicsOperation