stuttering caused by glDrawElements / glMultiDrawElementsEXT, any ideas?

Hi,

I have a strange stuttering caused by glDrawElements/glMultiDrawElementsEXT. This also happen if I don’t move the camera and render the same static scene for several frames. According to my profiling glDrawElements/glMultiDrawElementsEXT seem to cause the stuttering. The time consumed by the draw calls varies between about 4ms to 200ms-400ms. Any ideas what can cause this if the same scene is rendered every frame the same way?

most modern HW are able to cache several frame ahead. so until the buffer isn’t full, the actual call does not take tooo much time. until the buffer gets full.

try insert glFinish() somewhere in your pipeline to make sure, your graphics card is ready for new tasks.(ie. after or before swapbuffers)
your framerate might drop, but the stottering should go away. if this works, you have to balance your rendering pipeline.(what is your CPU actually doing, besides feeding openGL ?)
for more details take a look at the NVIDIA and ATI optimization talks from their developer websites.

Originally posted by AdrianD:
[b]most modern HW are able to cache several frame ahead. so until the buffer isn’t full, the actual call does not take tooo much time. until the buffer gets full.

try insert glFinish() somewhere in your pipeline to make sure, your graphics card is ready for new tasks.(ie. after or before swapbuffers)
your framerate might drop, but the stottering should go away. if this works, you have to balance your rendering pipeline.(what is your CPU actually doing, besides feeding openGL ?)
for more details take a look at the NVIDIA and ATI optimization talks from their developer websites.[/b]
Ahhh, thanks for the help. The glFinish solved the issue. I thought that a SwapBuffers should also synchronize, but now it make sense.

Yeah, I know I still have to do lots of optimizations but to know where to start and where to get the most benefit I want to have somehow reliable profiling data :wink: I really don’t like this trial and error approach mostly suggested in the nvidia/ati talks to identify bottlenecks. Ok, so it seem to result in lots of glFinishs to profile the GPU, and depending on the paralellism of gl command execution by the GPU this will result in incorrect result, too :frowning: Are there some infos available about the parallelism of gl command execution?

I really would like to have an OpenGL extension for profiling support :rolleyes: