ImGuiRenderers icon indicating copy to clipboard operation
ImGuiRenderers copied to clipboard

Improve perfomance

Open tambry opened this issue 8 years ago • 2 comments

@ratchetfreak pointed out that perfomance could be improved by either delaying the cleanup of resources or putting them in a pool for reuse. Need to figure out how this should be performed, find some examples and then implement.

tambry avatar Feb 28 '16 15:02 tambry

Another optimization that's possible (and encouraged) is allocating one big buffer for vertex and index data and suballocating from that for the per-frame data (round-robin style).

For the pool you would have a struct with the resources you need per frame (semaphore, commandbuffer, commandpool, the range of the buffer that was allocated, etc) and a fence that gets signaled after the render.

Then after rendering you push that to an array.

When starting the render you check the first struct whether its fence is signaled. If not create the resources and return the new struct. If yes then pop it off the array, reset the fence and return that struct. In the destructor you'll need to destroy all resources in the array.

As a side not keeping the buffer suballocation ranges in a separate array will let you reuse the memory range sooner.

Also you can precreate a framebuffer per swapchain image.

ratchetfreak avatar Feb 28 '16 17:02 ratchetfreak

I don't think the perfomance might be the main priority. In the test GUI demo I can more or less easily achieve 3500-4000fps. That's quite fast.
I don't think I'll spend my time improving perfomance any further, but if anyone's interested on working on it, then they're welcome.

tambry avatar Feb 29 '16 17:02 tambry