Occlusion Query Test conditions:
Windows 7 x64,
Gigabyte HD 6670(bought especially for testing),
Occlusion query FBO size 256x256,
About 10-12 objects of different size and distance passing frustum test to be rendered for occlusion test,
Every object about 2-3k triangles,
Rendering with glDrawElements, no deprecated stuff.
Putting glFinish and timer after rendering to occlusion query says occlusion query is ready in 25 ms average. it seems heavily fillrate-limited, because rendering bounding boxes doesn't help. and about 50 small billboards rendered for lens-flare occlusion take 1-2 ms to finish. It's terrible, but it get's worse. if i don't force occlusion query to finish and check if it's ready on the next frame like that:
checkOcclusionQuery(); //get occlusion query results from previous frame if available
this loop runs at 30 fps, so every frame takes 33ms to finish. enough for our query, right? but it's not ready by next frames. in fact, it takes 3-4 frames 33 ms each until occlusion query is ready. 105 ms in average. it's ridiculous. 25 ms are unacceptable even for 10 times objects i render. 105 ms marks it as broken part of functionality. it seems like occlusion query result is getting delayed by other commands pushed to pipeline, which makes it useless.
I've seen it's already have been reported, but described poorly. A bit of detail: conditional rendering always passes if you use it with GL_NO_WAIT. and it stalls GPU up to the point it crashes driver if you use GL_WAIT. Forcefully waiting for occlusion query to finish before using conditional rendering, doesn't make it work. It's completely broken.
P.S.: As a developer, i'm really pissed off with your current implementation of OpenGL, since i've dealed with AMD cards 3 years ago, you didn't improve a lot. Your driver's are still full of critical issues, your employees never visit OpenGL.org forums anymore, and i have no desire to support your hardware.