Resize Buffer Object from Transform Feedback Result. GL3 < GL 3.3
Hello GL Fellows.
I need to glBufferData a buffer based on the result of a Transform Feedback.
I do Iso-Surface extraction and the last step in the algo is the resize and copy of the result of the extraction into a more reasonable sized buffer object. Everything works just fine. I have everything on the GPU thanks to DrawTransformFeedback, except the last "copy to smaller sized buffer object" step.
The problem is, that last resize/copy step kills the performance! I could do the copy step with another DrawTransformFeedback and a copy vertex shader, but the resize command still remains that forces me to round-trip to the CPU... I.e. I wait for the query object that delivers the number of vertices written.
Do you have any advice or is it even possible to do a glBufferData(resize buffer) based on TF result on GL 3.3 and prior?
Please do not consider >= GL 4.0, I need to do it in pre-4.0 GL.