Added GLBufferObject::computeBufferAlignment(..) method to enable buffer entries to be aligned along specified buffer alignment boundaries, currently defaulting to 4.
This commit is contained in:
@@ -334,6 +334,13 @@ class OSG_EXPORT GLBufferObject : public Referenced
|
||||
|
||||
virtual ~GLBufferObject();
|
||||
|
||||
unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment) const
|
||||
{
|
||||
if (bufferAlignment<2) return pos;
|
||||
if ((pos%bufferAlignment)==0) return pos;
|
||||
return ((pos/bufferAlignment)+1)*bufferAlignment;
|
||||
}
|
||||
|
||||
unsigned int _contextID;
|
||||
GLuint _glObjectID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user