Using the ARB_multi_draw_indirect command

Started by
12 comments, last by tmason 9 years, 11 months ago
When it comes to performance and usage etc this is worth a watch Approaching Zero Driver Overhead.
Advertisement

When it comes to performance and usage etc this is worth a watch Approaching Zero Driver Overhead.

That's an awesome presentation.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


then an additional ~8 ms is spent blocking on buffer swap (= waiting for the driver to complete the queued commands, e.g. C code (or something) in the driver)
As a rule of thumb, if you're blocking on swap/flip/present, you're either waiting for a vblank if you're vsyncing, or you're waiting for the GPU to catch up.

Measurements of "GPU load" are very misleading. You can be bottlenecked by the GPU without seeing it report 100% load...

Threaded optimization off:

51 FPS

Render time: 18.806 ms
Swap time: 0.277 ms
Frame time: 19.678 ms (also includes some UI rendering)
GPU load: ~60%

Threaded optimization on:

61 FPS

Render time: 9.185 ms
Swap time: 5.739 ms
Frame time: 15.727 ms

GPU load: ~71%

I did not change a single line in my program. Threaded optimization on simply moves the cost of the render calls to the driver server thread (see the slides I posted above), and if the server thread lags behind it causes it to block on buffer swaps.

Remember to use timestamp queries for GPU timing. tmason, I think what you want to do is put all of your material parameters together in an array, and load it into a single buffer. Then you want to make a single MultiDraw call, and use DrawID in the shader to choose the correct material. That way you won't have that loop of calls anymore.


Great, worth a shot. And this seems like something I can do even without using "ARB_multi_draw_indirect".

Of course, that command seems awesome but I can experiment slowly.

This topic is closed to new replies.

Advertisement