Direct2D Causes Considerable Performance Drop

We’ve pushed some updates for Images that should help performance when working with D2D images. You can now call Image::setBackupEnabled (false) to disable flushing of the image to main memory after modifying it on the GPU, e.g. via a Graphics instance.

The relevant change is here:

As part of this change, we’ve updated StandardCachedComponentImage, DropShadowEffect, and GlowEffect to use this new behaviour, so projects that are using setBufferedToImage and/or component effects should see performance improvements without needing to make any changes.

Note that disabling image backup has some potential drawbacks. It means that a copy of the image is kept only in GPU memory, which might go away in some scenarios (disconnecting an external GPU, disconnecting a remote desktop session, updating graphics drivers, etc.). Therefore, we recommend that you only change this flag on images that are temporary, or when it’s possible to completely recreate the image on-demand.

There’s a new example showing the backup API in use in the GraphicsDemo:

4 Likes