The scenario is the following:
I wrote a very simple example program where I generate five tris from five points with a geometry shader. I stream those five tris to a vertex buffer via transform feedback and render it with glDrawArrays. The loaded vertex buffer for tfb is just as large as the geometry output requires, i.e. 5*3*24Bytes. 24Bytes are two vec3. Position and color. The output is as expected. The five tris are rendered.
The observed problem:
As I figures out, exactly when calling glDrawArrays DURING transform feedback(I DONT mean rendering the result)run through, the observed GPU memory footprint of the described little program grows by approx. 150 MB. I checked this behavior with Process Explorer by putting a glFlush and glFinish after the mentioned glDrawArrays for the input vertices to the transform feedback stage(!).
Code :// during initialization of program // transform feedback stage bind feedback render five points and stream out to vertex buffer// here the memory grow by 150 MB unbind feedback // in runtime loop // render stage render result of transform feedback
When I check the GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN by glGetQueryObjectuiv, I correctly get 5. When I release the transform feedback buffer along with the streamed out vertex buffer, the 150 MB footprint doesn't disappear. When I release every single gl object in that simple program, the footprint of 150 MB doesn't disappear.
When I do not render with transform feedback, i.e. render an empty buffer, the memory does not grow by 150 MB.
Additionally, I just observe that memory grow on my PC with AMD Radeon HD 7700 Series.
When I check the same program on my other PC with nvidia card(gforce 650GTX TI), there is no grow in GPU memory.
The real problem is in my production code, where I stream out approx. 350000 Primitives(I assume a lot more) and the freaking GPU Memory(1GB) is running full and havok!
350000 Prims * 3(Tri) * 12 Byte(1xvec3) = 12.6 MB right?
Does someone observed the same problem?
I updated to the latest drives available today. Catalyst Version 13.4