Another issue with WPF 4+ software?

In earlier versions of the Window.AllowsTransparency WPF options, either using BitmapEffects (deprecated) or using TileBrush, it seems that could cause WPF to switch to software rendering mode instead of hardware rendering, which will significantly affect performance.

I found this list, but this is from 2010.

Are there potentially common cases that could lead to software rendering within 4+? Suppose that the hardware is sufficient, purely related to the software.

+4
source share
2 answers

This list is still accurate.

This is described on the MSDN page regarding Graphics Rendering Levels. The second is referred to as "The following features and capabilities are not hardware accelerated:" lists specific criteria that may cause non-acceredated rendering in WPF.

It includes:

  • TileBrush
  • Content passed through RenderTargetBitmap
  • Any printed result
  • Surfaces exceeding the maximum size of graphics hardware texture
  • Layered windows in Windows XP.
+4
source

The next blog post from Dwayne Need seems to suggest that tiered windows in Windows XP are now hardware accelerated .

http://blogs.msdn.com/b/dwayneneed/archive/2008/09/08/transparent-windows-in-wpf.aspx

DirectX provides the IDirect3DSurface9 :: GetDC method, which can return a DC that references a DirectX surface. Unfortunately, there was a limitation in DX9c that would not have received this method if it were called a surface containing an alpha channel. Of course, the whole point of our layered API windows is to enable per-pixel transparency. This restriction was lifted for Vista, but our initial release forced WPF to use software backups by rendering to a multi-level window on XP. We were able to raise this restriction for XP too, which we released as a hot fix (KB 937106). This hot fix has also been included in XP SP3, so go ahead! Now, on XP, we can visualize through DirectX and pass the IDirect3DSurface9 :: GetDC results directly to UpdateLayeredWindow. On good video drivers, the resulting copy will remain entirely on the video which provides excellent performance. Some video drivers, however, may choose to run this copy through system memory. performance on such systems will not be as good, but should still be acceptable for many scenarios.

I tested this by running the Perforator WPF Performance Suite tool (and checking the "Draw software rendering with purple hue" checkbox) ... in an application with a multi-layer window ... and everything seemed to have hardware acceleration (no purple hue).

Recent MSDN documentation on Graphics Rendering Levels still says (as Reed Copsy points out) that it should be software, but that’s not what I am experiencing.

0
source

Source: https://habr.com/ru/post/1484255/


All Articles