   Optimization - glDrawRangedElements
  I'm currently optimizing my opengl pipeline. I want to avoid CPU blocking operations. Sofar I discovered that glGetError and according framebuffer check functions seems to flush the command pipeline. Now I'm stuck at glDrawRangedElements. It doesn't seem to flush the pipeline, but it blocks the cpu for quite some time. I think, that glDrawRangedElements or any other draw element function, is just the trigger for some cpu bound processing, maybe partial pipeline flushing. I utilize many expensive shaders (SSOA, blur, lighting, displacement mapping) and my game is pixel shader limited.Simplified overview of my rendering pipeline:  // flush command pipeline for testing purpose only !  glFinish();  #1  SDL_swap_buffers();    for each shader    shader.activate();    for each object with object.shader==shader object.setShaderParameters(); object.activateTexture(); object.activateVBOs();  glDrawRangedElements(object); #2#1 Here I'm expecting the time waster (currently 40% of a frame duration).#2 Here is a major time waster (currently 8-10% of a frame duration). There are really not many glDrawXXX calls , 100 per frame.I'm not sure if the drivers really need this time to setup all the rending data or if the driver waits for an event or certain commands to be completed.I want shift the time wasted from #2 to #1, so that other CPU bound engine features (physics, ai etc.) can utilize more of the CPU time.Any help, tip or insight would be appreciated :-)   