Fence_NV, glGets, and performance

I’ve got a question about NVIDIA’s fence_NV extension.

I understand exactly what it does. And I understand that glGet* functions are typically performance killers. The question is: does glTestFenceNV count as a glGet as far as performance goes? Would it be a good idea, performance wise, to call glTestFenceNV several times per frame in the rendering loop?

It would be very useful if the test were fast, since it would allow me to do more as far as CPU/GPU synchronization. glFinishFenceNV simply blocks the processor until the GPU hits the fence in question, which eats up CPU time that could be put to better uses. The hope would be to keep the renderer rendering as much as possible, and glTestFenceNV is pretty much the only way to tell where the graphics chip is in rendering.

Tests are fairly fast (but not extremely fast). Testing too often is bad, but you should really be more worried about inserting too many fences, i.e., calling SetFence too often.

  • Matt

Sounds good. Thank you.