GL_fence_NV and glFinish

Hi,

I’m running a paged application. The culling pass creates some paging requests. A paging thread load the requests files and put the corresponding sub-graph in a “to compile list”.

I’m trying to control the time spent compiling (display lists) the sub-graph.
I see 2 options:


while (elapsedTime < availableTime)
{
  compile
  glFinish
  update elapsedTime
}

or


while (elapsedTime < availableTime)
{
  compile
  glSetFenceNV
  FinishFenceNV
  update elapsedTime
}

Suggestions ?

You don’t need to call glFinish or anything like that. The driver will finish once you call glEndList.
If the compilation is slow and you are doing this at runtime, don’t use DL at all. Use VBO.
http://www.opengl.org/wiki/VBO#Sample_Code

Hi,

I use display lists because the benches I’ve made show that the VBOs version takes more time to render (80 Hz / 60 Hz).

I plan to switch to VBOs anyway because I will use GL_draw_instanced.

I agree that the compilation time will be better with VBOs but I’ll still need to limit the number of compilation with the available time. To do that I need to know when a buffer has been completely uploaded. So the question remains.

Maybe for VBOs I could map the buffer.

Suggest before you pursue further, you find the maximum time you can expect to spend compiling a single display list (you may already have done this). Here that was the killer for this idea a while back. For not so big batches, I found you could waste ~1.4ms of clock time compiling a single geometry-only display list. And that’s on a very beefy system.

I already have done this. I have a compile time estimator based on the size (in bytes) of the geometry. The estimator is updated after each compilation.

The problem is that the compile time is very dependent on the machine load. The estimator estimates well the compile time most of the time but sometimes, a classic geometry takes ~x10 s.