Win32: Is there a replacement GDI32.dll that uses hardware acceleration?
Asked Answered
D

3

11

Has anyone out there created a version of GDI32.dll that takes advantage of hardware acceleration available on the machine? gdiplus.dll?

Starting with Windows Vista, GDI is no longer hardware accelerated. (GDI+ was never hardware accelerated). Without Microsoft fixing GDI (and GDI+) to be able to run well on the computer: native applications (C++ MFC, Delphi, etc), and managed WinForms applications, will continue to run poorly forever.

While i could use Direct2D for business applications, i cannot control the fact that the development environment still creates controls, with decades of library support code, that assumes the presence of GDI.


Application Compatibility: Graphical Device Interface (GDI):

GDI primitives such as LineTo and Rectangle are now rendered in software rather than video hardware, which greatly simplify the display drivers.

Windows And Video Memory

In XP GDI is GPU accelerated to various degrees depending on how the OS is configured or the device driver (for details see Hooking Versus Punting). In Vista, GDI is not GPU accelerated

Comparing Direct2D and GDI

As a result, in Windows Vista, the GDI DDI display driver was changed to be only implemented by a Microsoft supplied driver, the Canonical Display Driver (CDD). GDI rendered to a system memory bitmap. Dirty regions were used to update the video memory texture which the window manager uses to composite the desktop.

Darees answered 14/4, 2010 at 19:54 Comment(0)
O
5

It seems that Vista was a special case in the history of GDI performance. Both articles below show that the future for GDI looks bright again.

http://msdn.microsoft.com/en-us/library/ff729480%28VS.85%29.aspx

GDI is hardware accelerated on Windows XP, and accelerated on Windows 7 when the Desktop Window Manager is running and a WDDM 1.1 driver is in use. Direct2D is hardware accelerated on almost any WDDM driver and regardless of whether DWM is in use. On Vista, GDI will always render on the CPU.

Link

Based on real-world application statistics, ... we worked with our graphics IHV partners to provide support in their drivers to accelerate the most commonly used GDI operations.

Outmarch answered 5/8, 2010 at 13:57 Comment(2)
The answer seems to be "Microsoft created a version of GDI32.dll that uses hardware acceleration", but you need Windows 7 and WDDM 1.1 drivers to get it. Not a bad tradeoff.Darees
i can really see the performance difference of GDI between Vista and 7, now that my development machine is Windows 7. i'm really glad Microsoft took the time to accelerate GDI again. i can only hope that GDI+ will get the same love.Darees
M
1

Well, yes, GDI is the "it works anywhere anytime" API for rendering graphics. It puts very low demands on the video driver. Everybody got that right a long time ago. Which took a while, I got a distinct memory of a ATI Mach video card that gave me no end of trouble. It stopped me from buying ATI products for quite a while.

Everybody got DirectX right a lesser long time ago too. It is being taking advantage of in the WPF rendering model, it completely relies on DirectX to get the job done. Milcore is the shim name. You won't get it until you buy into the WPF programming model.

Minx answered 14/4, 2010 at 22:7 Comment(4)
Sooo....are you saying there is a version of GDI that uses hardware acceleration?Darees
Did I? No I didn't. The GDI video driver interface allows optimizing BitBlt. That's been done.Minx
Well you didn't actually say one way or the other, except for the "Well, yes" - which might have been an answer to the question, "Is there a replacement gdi32.dll that uses hardware acceleration." First you had the pros of GDI (works anywhere anytime, very low demands, everyone got right, ATI didn't support). Then you talked about DirectX (everyone got right, WPF uses, implemented in milcore,). But you didn't say if there is a version of GDI that uses hardware acceleration. Starting with Vista GDI is no longer accelerated: it doesn't use the video card for drawing primitives.Darees
Turn off Aero to get the old behavior back. With it on, programs draw to memory, not the video card. No acceleration possible for that.Minx
C
1

What do you mean by hardware acceleration? I mean, GDI doesn't do a lot other than raster blits, but those were hardware accelerated. And, given that Vista and Windows 7 arn't terribly slower with desktop apps, still are.

GDI still gets the video drivers to do all the heavy lifting, so if GDI isn't hardware accelerated, then its the driver vendors fault, not GDI's.

Careerist answered 15/4, 2010 at 9:16 Comment(2)
i mean drawing of lines, rectangles, filling rectangles, drawing text, etc. GDI is not hardware accelerated; rendering happens in software to an off-screen DirectX surface.Darees
It's more than obvious that GDI is NOT hardware accelerated. Like Ian said GDI rendering happens in software.Hoch

© 2022 - 2024 — McMap. All rights reserved.