PDA

View Full Version : GL_fence_NV and glFinish



errno
02-05-2009, 06:42 AM
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 ?

V-man
02-05-2009, 08:36 AM
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

errno
02-05-2009, 09:37 AM
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.

Dark Photon
02-09-2009, 06:42 AM
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.

errno
02-10-2009, 01:06 AM
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.