Promote PrimitiveSetIndirect's VBO to a target explicited DIBO (in order to benefit from BOSet queue management)
This commit is contained in:
@@ -635,6 +635,28 @@ class OSG_EXPORT ElementBufferObject : public BufferObject
|
||||
virtual ~ElementBufferObject();
|
||||
};
|
||||
|
||||
class OSG_EXPORT DrawIndirectBufferObject : public BufferObject
|
||||
{
|
||||
public:
|
||||
|
||||
DrawIndirectBufferObject();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
DrawIndirectBufferObject(const DrawIndirectBufferObject& vbo,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Object(osg,DrawIndirectBufferObject);
|
||||
|
||||
unsigned int addArray(osg::Array* array);
|
||||
void removeArray(osg::Array* array);
|
||||
|
||||
void setArray(unsigned int i, Array* array);
|
||||
Array* getArray(unsigned int i);
|
||||
const Array* getArray(unsigned int i) const;
|
||||
|
||||
protected:
|
||||
virtual ~DrawIndirectBufferObject();
|
||||
};
|
||||
|
||||
class Image;
|
||||
class OSG_EXPORT PixelBufferObject : public BufferObject
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
inline void setIndirectCommandArray(IndirectCommandDrawElements*idc) {
|
||||
_indirectCommandArray = idc;
|
||||
if(!_indirectCommandArray->getBufferObject())
|
||||
_indirectCommandArray->setBufferObject(new osg::VertexBufferObject());
|
||||
_indirectCommandArray->setBufferObject(new osg::DrawIndirectBufferObject());
|
||||
}
|
||||
/// get command array of this indirect primitive set
|
||||
inline IndirectCommandDrawElements* getIndirectCommandArray() { return _indirectCommandArray; }
|
||||
@@ -656,7 +656,7 @@ public:
|
||||
inline void setIndirectCommandArray(IndirectCommandDrawArrays*idc) {
|
||||
_indirectCommandArray = idc;
|
||||
if(!_indirectCommandArray->getBufferObject())
|
||||
_indirectCommandArray->setBufferObject(new osg::VertexBufferObject());
|
||||
_indirectCommandArray->setBufferObject(new osg::DrawIndirectBufferObject());
|
||||
}
|
||||
inline const IndirectCommandDrawArrays* getIndirectCommandArray() const {
|
||||
return _indirectCommandArray;
|
||||
|
||||
@@ -600,7 +600,7 @@ class OSG_EXPORT State : public Referenced
|
||||
}
|
||||
else if (ibo != _currentDIBO)
|
||||
{
|
||||
_glBindBuffer(GL_DRAW_INDIRECT_BUFFER, ibo->getGLObjectID());
|
||||
ibo->bindBuffer();
|
||||
_currentDIBO = ibo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user