Direct2D Performance Update

A few more updates:

Automatic ImageType selection

Added various checks to make sure that the correct ImageType is used that matches the active renderer. Turns out its easy to end up in a situation (especially with the software renderer) where you end up bouncing the same image data back and forth between the GPU & CPU. Specifically:

effectImage used to paint Components with an effect (setComponentEffect(…))
DropShadow::drawForPath
Cached component image
LookAndFeel progress bar
DragAndDropContainer thumbnail
Component::createComponentSnapshot
ListBox::createSnapshotOfRows

This change may resolve this issue: createComponentSnapshot looks different than the component painting itself - #5 by RolandMR

Remove swap chain thread

The renderer uses a swap chain to sequentially stage each frame and paint the window. JUCE uses a waitable swap chain, meaning that DXGI signals an event when the swap chain is ready for the next frame. Previously, the renderer would create a thread for each window to service that event and schedule the next frame.

In retrospect, that thread may not be necessary since there is already a thread per monitor using DXGI to wait for vblank for reach monitor. The thread therefore seems to be redundant and may actually be making matters worse by clogging up the message thread with excessive notifications.

So this is somewhat experimental, but removing the swap chain thread entirely seems to work just fine with multiple plugin instances running in the same process.

Please let me know if you have any other issues or performance problems.

Matt

4 Likes