I've been using wine for a couple of years now, but I still couldn't play my favorite game, civ2, so I decided to give it a try and see if I could fix anything. I'm new to wine development and its hard to get my bearings, so I'm hoping to get some hints from any knowledgeable persons, as to how I might tackle this problem.
The problem I (and some other people as well, from what I gathered from the archives) am having with civ2 is that the game is incredibly slow. More precisely, it seems to have serious perfomance issues while rendering, which makes the game unplayable, although the graphics look good overall.
So I started inverstigating, running oprofile with default settings turned up that wine spends a lot of time in * X11DRV_DIB_SetImageBits_8 * MapColor * GetImageBits_8
Besides actually writing pixels on the screen, these functions also convert between X's internal representation which is 24 bit in my case, since I am running X in 24 bits, and 8 bit as required for the DIB. So, I tried setting X's display depth to 8 bit, which actually made the game playable.
This leads me to conclude that the conversion between 8 and 24 bits, ties up many resources. I'm not quite sure how to proceed from here on though.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
R.T. wrote:
Besides actually writing pixels on the screen, these functions also convert between X's internal representation which is 24 bit in my case, since I am running X in 24 bits, and 8 bit as required for the DIB. So, I tried setting X's display depth to 8 bit, which actually made the game playable.
This leads me to conclude that the conversion between 8 and 24 bits, ties up many resources. I'm not quite sure how to proceed from here on though.
See http://www.winehq.com/hypermail/wine-patches/2002/09/0251.html and http://www.winehq.com/hypermail/wine-patches/2002/09/att-0250/01-dib-engine....
Felix
I wrote:
See http://www.winehq.com/hypermail/wine-patches/2002/09/0251.html and http://www.winehq.com/hypermail/wine-patches/2002/09/att-0250/01-dib-engine....
... and forgot something: Some days ago someone suggested to port the GDI engine from ReactOS to Wine which is probably much more advanced (and supposedly faster than Microsoft's :-) than Transgaming's from 2002 anyway.
Felix
--- Felix Nawothnig felix.nawothnig@t-online.de wrote:
R.T. wrote:
Besides actually writing pixels on the screen,
these
functions also convert between X's internal representation which is 24 bit in my case, since I
am
running X in 24 bits, and 8 bit as required for
the
DIB. So, I tried setting X's display depth to 8
bit,
which actually made the game playable.
This leads me to conclude that the conversion
between
8 and 24 bits, ties up many resources. I'm not
quite
sure how to proceed from here on though.
See
http://www.winehq.com/hypermail/wine-patches/2002/09/0251.html
and
http://www.winehq.com/hypermail/wine-patches/2002/09/att-0250/01-dib-engine....
The other thing you may be able to do is implement some caching so that the image doesn't get converted into a xpixelmap unless it's needed.
I've got a patch somewhere that makes Arcanum under Cedega about 50 times faster using this method.
Felix
___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
Wow, thats a big speed increase. Can this patch be molded to apply to the winehq tree?
Chris
On 7/13/05, Oliver Stieber oliver_stieber@yahoo.co.uk wrote:
--- Felix Nawothnig felix.nawothnig@t-online.de wrote:
R.T. wrote:
Besides actually writing pixels on the screen,
these
functions also convert between X's internal representation which is 24 bit in my case, since I
am
running X in 24 bits, and 8 bit as required for
the
DIB. So, I tried setting X's display depth to 8
bit,
which actually made the game playable.
This leads me to conclude that the conversion
between
8 and 24 bits, ties up many resources. I'm not
quite
sure how to proceed from here on though.
See
http://www.winehq.com/hypermail/wine-patches/2002/09/0251.html
and
http://www.winehq.com/hypermail/wine-patches/2002/09/att-0250/01-dib-engine....
The other thing you may be able to do is implement
some caching so that the image doesn't get converted into a xpixelmap unless it's needed.
I've got a patch somewhere that makes Arcanum under Cedega about 50 times faster using this method.
Felix
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
Do any of the other devs out there have any ideas how to do some nice and easy automatic gfx testing for d3d9, etc...
At present my testing methods are slow and easily prone to error (does it look like what d3d9 gave me?). I run the test on one computer (real d3d9) then on my other (wined3d d3d9) and compare.
It seems as thou this would be rather nice e.g. have a specific set of output (gfx either pics or vid or ??? -- speed would be hard to MEET as a req.) gathered from (various) windows machines and then try to regenerate this output with wine's d3d9 ---- Fraps may be useful for this type of endovur or mayhap a gigantic test suite (that tests every aspect of d3d9 -- this would be large and... take a long time to do + demos already exist)
At present there are LOTS of d3d9 demos that do things a certain way (not always the correct way) and wined3d/d3d9 should match these as close as possible ----
Well any thoughts? Has this been done?
Well just throwing this out there -- one more in the void cannot hurt...
Nick
Initial window resizing implemented Initial vsync choosing implemented Initial swap effects implemented Synced with wine HEAD (thats the fun part...)
GLX is still supported #define __WIN32_OPENGL__ to use WGL instead of GLX (this is done automatically if either __CYGWIN__ or WIN32 is defined)
Makefile.in has not been modified for compiling... this has to be done manually now (link to opengl32 instead of using the GLX libs)
I need to clean it up a little before making my diff patch file --send an email if ya want the patch --Ill probably post it on wine-devel soon along with latest regression tests -- but I have a term paper due monday so we will see how it all goes... college english lit fun...
Nick