PDA

View Full Version : GL_COMPILE vs. COMPILE AND EXECUTE ?



Anonymous Coward
08-08-2000, 01:15 PM
What for can be used GL_COMPILE_AND_EXECUTE in glNewList() ? A good example?

08-08-2000, 01:56 PM
anything that can be used for one can be used for the other

the difference
compile just compiles
compile and execute compiles and then executes http://www.opengl.org/discussion_boards/ubb/smile.gif

so if you use compile you have to call the list before anything will be rendered

in compile and execute the first time it will be executed automatically

I always use compile
Some people say that compile provides better performance than compile and execute also

john
08-08-2000, 04:32 PM
W-e-l-l... compile & executes is not *necessarily* compile and __THEN__ execute, it could jsut as easily be compile *as* you execute. The difference is the pipline... h/w can easily dup the primitive and send one copy to the rasteriser and another to the thing that compiles the data.

Why is this important, or--indeed--different depends on what you want to use it for. From my own exerience, I used compile and execute when I did something dynamic for one frame, but knew I would be doing the same thing for a couple of frames in the future... so I'd compile the geometry AS I WAS DRAWING IT for the first frame.

oh, and it helped that it was on an SGI Onyx2, and compile and executing seemed to be about the same speed as just executing http://www.opengl.org/discussion_boards/ubb/wink.gif (COMPILE FOR _FREE!_ lamost http://www.opengl.org/discussion_boards/ubb/wink.gif

hope this helps.
cheers,
John

Eric
08-08-2000, 11:25 PM
Just a remark here for you guys :

I discovered when I received my ELSA Erazor X2 (GeForce DDR 32Mb) that using GL_COMPILE +glCallList was a lot faster (factor 10 at least !) than using GL_COMPILE_AND_EXECUTE. Even the display list produced by the two tokens does not execute at the same speed : the first one is a lot (A LOT !) faster to call !

You might think I had done something wrong but NO : I mentioned it on this very web site (I think it was in the old forum but I am not sure) and other people tried and SAW the difference !

So be aware : prefer GL_COMPILE and then call your list than GL_COMPILE_AND_EXECUTE !

Regards.

Eric

P.S. : if you use the Find All Posts option on me, you might be able to locate the thread (if it is still here...)

john
08-09-2000, 04:49 PM
Yes, yes, but like everything it's implementation dependent. Want to bet that my SGI has problems doing compile and execute?

the moral of this story, as always is: profile first.

profileOpenGLDriver(&use_compile_and_execute);
...

if(!use_compile_and_execute) {
makeList();
executeList();
} else {
compileAndExecuteList();
}

cheers,
John