General BufferObject as SSBO and VBO


#1

Hey,

I´m doing some OpenGL things where I´m using buffers in the compute shader and later in the vertex shader.
For this I´m using the buffer first as SSBO and later on with a mesh as VBO.

When adding a buffer to a VboMesh with ´appendVbo` I’m wondering if there is a better way to do this other than that:

mVoxelData = std::static_pointer_cast<gl::Vbo>(voxelData);
auto prevTarget = mVoxelData->getTarget();
mVoxelData->setTarget(GL_ARRAY_BUFFER);

arrowMeshVbo->appendVbo(instanceDataLayout, mVoxelData);
mBatch = gl::Batch::create(arrowMeshVbo, mVoxelProg, { { geom::Attrib::CUSTOM_0, "vInstanceVoxelData" } });
mVoxelData->setTarget(prevTarget);

Where voxelData is a gl::BufferObjRef.

Thanks.
Patrick