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?
I supose that most OpenGL (and DirectX) are asynchronous except the vsync swap thingy...
Do you know any interesting read on the issue?
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.
GPU demos only.
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
Yomat: if you're using the right lock flags, memory pools etc it shouldn't be necessary.
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.
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.
...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 :)
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.
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.
cpu ?