pouët.net

Improving CPU / GPU parallelism

category: code [glöplog]
 
What's the best practice on keeping both CPU and GPU doing something at the same time? Sometimes I get the idea that nothing interesting is really happening when the CPU is busy with his stuff, only to call a few OpenGL functions when he has nothing important to do, while the GPU keeps waiting till the CPU has nothing to do.
I supose that most OpenGL (and DirectX) are asynchronous except the vsync swap thingy...

Do you know any interesting read on the issue?
added on the 2010-08-14 06:40:42 by xernobyl xernobyl
The driver has large command buffers, so unless you're doing some tight synchroniziation (ie reading back data to the cpu), the cpu may be a whole frame ahead of the gpu, usually eliminating the problem. Even the sawp is just a point in the command buffer.
added on the 2010-08-14 10:26:17 by Psycho Psycho
GPU demos only.
added on the 2010-08-14 10:45:38 by moredhel moredhel
Psycho: Does double/tripe-buffering help this? It seems that way when I try things anyway. At least while using vsync in dx9. It guess it should make "oldschool" coding sense. :P

added on the 2010-08-14 11:28:23 by Yomat Yomat
Yomat: if you're using the right lock flags, memory pools etc it shouldn't be necessary.
added on the 2010-08-14 11:42:56 by smash smash
http://www.gameenginegems.com/
10. Camera Centric Engine Design for Multithreaded Rendering
Colt McAnlis (Graphics Programmer at Blizzard Entertainment)

- and yea, triple-buffering helps, trouble being that you don't actually know if the driver is lagging, which can make audio-sync a pain.
added on the 2010-08-14 11:44:05 by hornet hornet
...should probably mention that I'm not exactly a fan of the book, but it does cover basic subjects like this. Go fetch this one instead :)
added on the 2010-08-14 11:47:43 by hornet hornet
Hornet: Ah. Sync. Of course. Although that is mostly a problem when framerate drops, right? And then you're screwed anyway when it comes to sync. Some synchronous event system might still keep up but when framerate drops below a certain threshold you're even more screwed.

Smash: Nice. A twofer. Save memory and improve sync. But dont you need at least one extra backbuffer when using vsync to prevent stall? Or does the command buffers take care of that? Granted your render batches are small enough, that is.
added on the 2010-09-01 02:07:02 by Yomat Yomat
cpu ?
added on the 2010-09-01 10:02:00 by krabob krabob

login