set DIBO of the drawcommandarray directly in their interface constructor

it makes osggpu use case lighter + drawcommandarray can't exist without a BO
This commit is contained in:
mp3butcher
2017-07-27 12:27:55 +02:00
parent 104b2dfc72
commit a45c4c8f39
2 changed files with 10 additions and 10 deletions

View File

@@ -181,18 +181,16 @@ struct IndirectTarget
: maxTargetQuantity(0)
{
indirectCommands = new osg::DefaultIndirectCommandDrawArrays;
indirectCommands->getBufferObject()->setUsage(GL_DYNAMIC_DRAW);
}
IndirectTarget( AggregateGeometryVisitor* agv, osg::Program* program )
: geometryAggregator(agv), drawProgram(program), maxTargetQuantity(0)
{
indirectCommands = new osg::DefaultIndirectCommandDrawArrays;
indirectCommands->getBufferObject()->setUsage(GL_DYNAMIC_DRAW);
}
void endRegister(unsigned int index, unsigned int rowsPerInstance, GLenum pixelFormat, GLenum type, GLint internalFormat, bool useMultiDrawArraysIndirect )
{
osg::DrawIndirectBufferObject * indirectCommandbuffer = new osg::DrawIndirectBufferObject();
indirectCommandbuffer->setUsage(GL_DYNAMIC_DRAW);
indirectCommands->setBufferObject(indirectCommandbuffer);
indirectCommandTextureBuffer = new osg::TextureBuffer(indirectCommands);
indirectCommandTextureBuffer->setInternalFormat( GL_R32I );
indirectCommandTextureBuffer->bindToImageUnit(index, osg::Texture::READ_WRITE);