Silverlight Hardware Acceleration

Caching visual elements as bitmaps allows you to take advantage of hardware acceleration. Once an object or tree of objects has been cached as a bitmap, it no longer goes through the render phase as the application refreshes, rather, the cached bitmap is rendered. The cached bitmap swapping is able to take advantage of hardware acceleration from the user’s GPU which can yield significant performance improvements for some scenarios.

Hardware acceleration can benefit performance for the following scenarios:

Blending two static layers using opacity. For example, you can mark both trees of objects as cached, and the opacity animation will be executed using Hardware Acceleration.

Transforming objects (e.g. stretching and rotating).

Note:

Caching objects can hurt performance if you misuse it. See How Hardware Acceleration Works below.

Notice that not everything can be hardware accelerated. Effects like DropShadowEffect and OpacityMask can only be rendered by the software. Also, WriteableBitmap goes through its own rendering pipeline and therefore cannot take advantage of hardware acceleration.

When you cache an object, you are creating multiple rendering surfaces in the VRAM which are then accelerated using the GPU. Other visible objects in your application that are not cached are rendered as surfaces in software. Your performance will be best if you can minimize the total number of rendering surfaces and get the hardware to do work where it can. Note that BitmapCache is the only supported cache-mode.

Note:

Hardware acceleration is only enabled on Windows Vista, Windows 7, and Windows XP. On Windows XP, NVidia, ATI, Intel cards with a driver date post November 2004 is required for hardware acceleration.