Wine: DirectDraw over Direct3D

Stefan Dösinger stefandoesinger at
Mon Dec 12 14:11:44 CST 2005

> Following your mail on wine-devel about DDRAW, I now understand better
> what's going on behind the scenes. Below is the result of an experiment I
> did at the beginning of this month. Reading your message, I wanted to share
> it with you.
First, thanks for your comments, and one suggestion: You should also CC the 
mails to wine-devel at, so others can read it too.

> I'm an occasional wine user for games, and an experienced developper in
> other projects. Age of Empires II has always been really slow, so I finally
> decided to run an oprofile session. The results are attached to this
> message (wine cvs of 2005-12-04). When I saw the results, I immediately
> thought "put that conversion on the GPU". It seems you found that solution
> long ago :)
Yes, this is known quite well, and if you search the archives, you'll see that 
it has been mentioned over and over

> Of course, there still are the ~35% used by X11, but even if these are not
> compressible (DC stuff), a potential x5 increase in game speed due to DIB
> would make it much more playable.
The need for a better DIB engine is also known, and there are 2 DIB engines 
ready to be included into Wine: One was sponsored by Transgaming, and the 
other one is the DIB engine from ReactOS. The ReactOS engine is said to be 
faster, and it's favored. We'll see, perhaps we can include it with the 
DirectDraw re-work.

The other problem is hardware 2D accelleration: Most DirectDraw functionality 
is handled by the GPU on Windows, since the beginning of DirectDraw, long 
before 3D accellerators were around. In Wine, there are 2 ways: The first is 
to use X calls, which is safe, but slow. The other one is the use of DGA, 
which is as fast as the Windows way, but it requires root preveliges, or at 
least write access to /dev/mem, which is a HORRIBLE security risk. That's 
were OpenGL comes into play: It is hardware accellerated, and doesn't 
require /dev/mem access. But the drawback is, that it needs a 3D 
accellerator, and a decent driver. It works fine for nvidia cards, but it is 
horribly slow for ati cards.

> it seems using 3D as
> the 2D backend it the only option that makes sense nowadays and in the near
> future. In Wine case, this supports your DDraw using D3D idea.
Yeah, that perfectly true for current hardware, rumors even have it, that 
today's GPUs don't have a 2D engine any more, and whatever you do, it will 
make use of the 3D functionality. The problem are older cards: It would be 
nice, if games worked on systems for which they were designed for, for 
example, I'd love to see Anno 1602 working in Wine on my old Acer Extensa 660 
with an 120 MHZ Pentium CPU, and a Chips and Technologies 65000 GPU.

Thanks for your interest, and I'd appreciate performance tests once my work is 
stable ;)


More information about the wine-devel mailing list