From d4d32cbde718fcf80767ecab7bb4623888b5d974 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 1 Sep 2016 14:41:17 +0100 Subject: [PATCH] Improved handling of the BufferObject::Profile::_size, utilizing it's intial value when it is non zero and larger than the arrays assigned to it. --- src/osg/BufferObject.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index ed4a176ba..9e793ea44 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -208,6 +208,7 @@ void GLBufferObject::compileBuffer() if (_allocatedSize != _profile._size) { _allocatedSize = _profile._size; + OSG_INFO<<" Allocating new glBufferData(), _allocatedSize="<<_allocatedSize<glBufferData(_profile._target, _profile._size, NULL, _profile._usage); compileAll = true; } @@ -229,7 +230,6 @@ void GLBufferObject::compileBuffer() unsigned int offset = entry.offset; for(osg::Image::DataIterator img_itr(image); img_itr.valid(); ++img_itr) { - //OSG_NOTICE<<"Copying to buffer object using DataIterator, offset="<getProfile()._size() = "<<_glBufferObjects[contextID]->getProfile()._size<dirty(); + if (_glBufferObjects[i].valid()) + { + _glBufferObjects[i]->dirty(); + } } }