Wine DirectX status

From Wine-Wiki.org
Jump to: navigation, search

Contents

Introduction

According to Wikipedia:DirectX (originally called "Game SDK") is a collection of APIs for easily handling tasks related to game programming on Microsoft Windows and is most widely used in the development of video and computer games for Windows. The DirectX runtime was originally redistributed by computer game developers along with their games, but later it was included in Windows. While the DirectX SDK is available free from Microsoft, the latest versions of DirectX are still usually included with PC games, since the API is updated so often

Constant work has been made on DirectX and Wine. Many games that use DirectX were shown at the 2005 Wine Conf as working with a stock Wine. Raphael made some good progress. O. Stieber was a major contributer to Wine and DirectX, and maintained a set of patches yet to be included with wine on sourceforge. Then among others [with apologies to these as they have too made significant contributions] , Stephan and H. Verbeet have been steadily working away.


This unofficial page made up from forum comments has been superseded by the official Wine Developer Wiki. For the official DirectX todo list, see The Official Wine wiki Direct X to do list

Current status

This information is collated from the forums and is now mostly out of date. For the most recent developer notes see the Official Wine Developer Wiki.


J. Green: [May 06] If you've been part of these shader discussions recently or even have at least a vague understanding of how this stuff works in wined3d ... a rough draft of our roadmap for GLSL implementation [is] here: http://wiki.winehq.org/DirectX-Shaders

O Stieber: [Nov 05] I've updated the directX 8 wrapper with a load more bug fixes notably Max payne 2 now works correctly. For anyone who's interested the update patch is avaialble here: https://sourceforge.net/project/shownotes.php?release_id=371929&group_id=134206

O. Stieber: [Nov 05] I've put together a Direct3D 8 wrapper for wined3d which should hopefully replace the current Direct3D 8 code. The patch needs [...] some work [...] and testing before it can go into Wine. I would be greatfull if anyone with DirectX 8 games or applications that currently work or they would like to get working could test the patch and report back any errors they come across. The patch is against Wine cvs 2005-11-05 and can be downloaded from https://sourceforge.net/project/shownotes.php?release_id=368929

O. Stieber: [Oct 05] I have partly working versions of D3DRENDERSTATE_ZVISIBLE and D3DRENDERSTATE_VERTEXBLEND, [...]most of the [other] states could be supported by using shaders. I've only been working on wined3d because Stefan Dosinger has been working on getting DirectX 7 to work with wined3d and I'm testing a d3d8 wrapper for wined3d at the moment so other versions of DirectX should get the extra states without any additional work.

O. Stieber: [Sept 05] Almost everything is in cvs now so it shouldn't make too much difference, I'm going to post a patch in a few minutes hat works around the device texture format compatibility problems as a stop-gap until format detection is reworked and working properly. [...] MDI was updated a few months ago, one of the results is that MDI no longer works for Direct3D applications. Fixing MDI for Direct3D is on my TODO list.

O. Stieber: [Sept05]: a status update on DirectX9/wined3d Short of a couple of bug fixes (one to shaders, and another that causes some games to crash) and a couple of patches that need resending (support for non-power2 textures in warhammer 40k) wined3d and d3d9 is functionally as complete as the version on http://directxwine.sourceforge.net/, that means that as soon as pixel shaders are coppied across from d3d8 it's more or less the end of adding features to wined3d and the start of fixing the remaining bugs and getting the performance up to spec. Anyhow, as soon as I've sent in those patches I'll provide another status update with a bit more information about moving d3d8 over to wined3d and the improvements that have been made.


O. Stieber: [Aug 05]" This patch moves the setting of states from device to basetexture, states that relate to the opengl texture object will only be updated when they are out of sync, this reduces the number of texture object state changes during game play in Axis and allies from severalhundred to 0 or 1.


O. Stieber mentioned a 'fun' and useful project [Jun 05]: It should be fairly to make wined3d (or d3d8) use the wgl (windows opengl) instead of glx. (just search for glx commands and replace then with the wgl equivalents) Doing so would enable wine's d3d to run on windows in place of the windows driver and without the rest of WINE which would greatly help in debugging. It would also allow wined3d to use the wgl implementation in wine.


O. Stieber [July 05]: If anyone has any games or applications they would like to see working than it would be really handy if you could add them to the Bugs DB blocking bug 1434 (it would be great).


O. Stieber [July 05]: I hope to get vertexshaders into winecvs by Friday this week, it's more or less the same as vertexshader support in d3d8 but with a load of parser fixes (it can now parse V2 and 3 shaders). Pixelshaders are more or less identical to vertexshaders so they should follow soon afterwards. To properly support version 2 and 3 shaders we need to use GL shader language instead of vertex and fragment program, it expect it to take a couple of weeks to get a cross compiler up and running. Blends also needs to be implemented using shaders to efficiently use VBO and the cards onboard memory for animated models. This affect more applications / games than V2 and 3 shaders so I'll try and develop it first.Wine Archive


DirectX guru O. Stieber [July 05]: Wined3d in CVS is now in a reasonable state to start regression testing new changes against. [...] O. Stieber: I've managed to get [a lot] more DirectX 9 work done,


Tips and Tricks

repacking nonpower2 textures
O. Stieber [July 05]: repacking can be quite CPU intensive and warhammer 40k is the only game so far that needs nonpower2 texture repacking so it's turned off by default but can be turned on via the following registry key:

HKEY_CURRENT_USER/Software/Wine/Direct3D Nonpower2Mode [repack]

L. Ulmer: Is there a way to automagically detect the need for this feature ? If not, how are we going to maintain the list of 'game-specific' WineD3D configurations ? Should we ship this as part of 'wine.inf' or create a new .inf that would install automatically the correct keys ? [The discussion ended at this point] Wine Archive

Troubleshooting

I get the error saying it requires DirectX 9

O.Stieber: Sometime that just means that the game is looking for/at d3d9.dll, copying one from Microsoft DirectX 9 usually does the job.

[Dec 05] I wanted to install "Need for Speed - Most wanted" under wine and the setup told me, that directx is not installed.

C. Frick: you should first found out (e.g. using WINEDEBUG=+reg) what the app really wants. i had the case, that a game wanted a very current directx-version and i just had to set a new number in wine.inf and everything worked fine then. imho faking the most current version is the best thing to do - i doubt that there are many apps out there that really ask for a certain (lower) version number?

T. Wickline: A quick and easy work around is to edit AutoRun/autorun.cfg and remove DirectXVersion=9.0c wine archive

Faking the version of DirectX

where would i find [The DirectX version] so i can fake a higher version? a grep found nothing in my source.

M. McCoramck:[Sept05] Have a look at the file: wine/dlls/d3d9/version.rc


How can I obtain some games for testing Directx

Hiji: FYI: http://half.ebay.com and the amazon.com marketplace (used) usually have pretty good deals on games! :) Also, if you're in the U.S., Target's clearance endrack has good deals too. (I bought Spiderman, Catwoman, and The Hobbit for about $5 USD each!)


DirectX Dlls

A user Tried FEAR Combat on Wine: [Aug 06] Looks like it needs a d3dx9_27.dll which we don't provide. Anyone else have any luck with this one?

T. Wickline: Native d3dx9_*.*.dll should work, I have to use d3dx9_28.dll to get 3DMark06 to run. H. Verbeet: generally the apps using them should install them. Otherwise the DX SDK has cabs that contain those dlls in the Redist dir. [...] They contain mostly utility stuff, eg for loading textures from files, matrix functions, loading models, creating geometry, etc. It also includes both a shader assembler and an HLSL compiler.

Another asked: Why would we not implement them, even as stub dlls? T. Wickline: Well, for one, they're not really part of d3d as such. Applications that use them should really come with them and install them. Also, there are quite a number of different versions of the dlls. There's at least d3dx9_24 through d3dx9_30 that I know of. F. Richter: Frank Richter wrote: The problem is probably that a game installer may rely on the DX redistributable package to install those DLLs. {...] FIY, my last three patches fix some issues that actually allow the redistributable installer(http://www.microsoft.com/downloads/details.aspx?FamilyID=a1788990-5e11-4ae2-b5e7-cc576822aed4&DisplayLang=en) to succeed. This will also install the d3dx_XX DLLs, so technically, these DLLs are available to apps on Wine through that way. wine archive


Error messages

Since progress with wine is ongoing, your first action would likely be to try the latest version of wine. These might fixed by now.

Incomplete stub

fixme:d3d:IWineD3DImpl_CreateDevice (0x7ff41940) Incomplete stub for d3d8
fixme:d3d_caps:IDirect3D8Impl_FillGLCaps found GL_VERSION ("1.2 (1.5 Mesa 6.2.1)")->(0x00000009)
fixme:d3d_caps:IDirect3D8Impl_FillGLCaps found GL_RENDERER ("Mesa GLXIndirect")->(0x0000)
fixme:d3d:IDirect3DDevice8Impl_SetRenderState (0x7ff422a0)->(40,0) not handled yet

R. Walls: DirectX support in Wine is not fully implemented (but getting better for certain) so you'll find unimplemented functions and stubs that can cause problems for certain programs.

C. Schmid: normally the use of mesa for rendering indices that there is no other "better" graphics-driver installed or availlable. i.e. no nvidia or ATI graphics card, no 3D-enabled driver installed. or for debian users, sometimes dist-upgrade kicks out the custom drivers so mesa gets used again. wine archive


fixme:xrandr:X11DRV_XRandR_SetCurrentMode Cannot change screen BPP from 16 to 32
A user reported [July 05] a problem with OpenGL: [After the following error messages] app quits. This really wasn't happening earlier. Should I do a regression test?

fixme:xrandr:X11DRV_XRandR_SetCurrentMode Cannot change screen BPP from 16 to 32
Created Win32Window 'OGRE Render Window' :640x480, 32bpp
err:opengl:X11DRV_ChoosePixelFormat glXChooseFBConfig returns NULL (glError: 0)
An exception has been thrown!

O. Stieber: Yes, I think the way that X11DRV_ChoosePixelFormat works has been changed, in your case it's not allowing you to run the application because your running in 16bit mode. I think this restriction is too tight, and I'm planning on using 32bit->16bit conversion for Direct, since once the textures are loaded there should be no real performance drop. There's still a bug in X11DRV_setup_opengl_visual, I'll send through a patch shortly.


D3DRENDERSTATE_VERTEXBLEND

 err:ddraw:set_render_state Unhandled dwRenderStateType D3DRENDERSTATE_VERTEXBLEND (00000097) value : 00000000 !

L. Ulmer: these warnings are displayed all the time when DirectX initializes the default states at start-up. If the warnings come later in the run of the game, then it's worth investigating.

O. Stieber: [Oct 05] Most of those states are 'impossible' to support because they don't have an OpenGL equivalent, a lot of them have also been dropped by Microsoft because either no one was using them or there are no new graphics cards that support the render states. I've started some work on D3DRENDERSTATE_ZVISIBLE and D3DRENDERSTATE_VERTEXBLEND, D3DRENDERSTATE_VERTEXBLEND is the only one that is commonly used by applications.

Missing Dll

A user reported that D3DX9_26.DLL is missing.

Raphael: d3dx9*.dll are redistribuables dlls so games should package it. Anyway you can download it (d3dx9*.dll) and use it on wine without problems (normally:) ) [...] PS: if you have time and mathematics/3d skills it should be easy to implement most of d3dx dll

A. Cyr: All of the d3dx9_*.dll's (note the underbar!) are simple helper dlls and as Raphael said should be bundled with the game.

O. Stieber: You can usually link d3dx9.dll to d3dx9_foo.dll without any problems. wine archive


Direct3D

WineD3D is the component of Wine that implements a replacement for Microsoft Direct3D and relies on OpenGL.

WineD3D and Windows - obtain support for more Direct3D versions

It appears that WineD3D can also be used on native Windows which, unlike Microsoft Direct3D can implement versions of Direct3D for Windows versions that Microsoft doesn't want to support (e.g. D3D10 on XP/2000/9x). Since it relies on OpenGL, it can provide Direct3D without need for specific D3D drivers (notably, on VMs like VirtualBox or QEMU). pre-packaged builds of WineD3D are found here:

Forum and bugzilla comments

R. Millan: The project at Savannah is a build system. I do not want any sort of information there unless it is related to the build system or is essential for operation of WineD3D on native win32.

Wined3d and Direct3D

A number of developers have been working on this. Stefan and H Verbeet are two a number of them. It has been making significant progress.


Raphael [Jun 06] Most of code is splitted in "logical" sources ... and documented when needed:

for shaders/declaration:

baseshader.c, glsl_shader.c, pixelshader.c, vertexshader.c,vertexdeclaration.c

for textures:

basetexture.c, cubetexture.c, texture.c, volumetexture.c

for surfaces:

surface.c, surface_gdi.c,

others who have d3d compliant names: :)

device.c, directx.c, drawprim.c, indexbuffer.c, palette.c, query.c, resource.c, stateblock.c, swapchain.c, utils.c, vertexbuffer.c, volume.c, wined3d_main.c

Only one thing to new hackers: never begin with device.c :) wine archive


The Wined3d driver
A programmer asked [July 05]: Ok simple question... should d3d8 be based off of d3d9 or wined3d? (or should it stay solo...)Since d3d9 is a fixed interface (d3d8 is basically a subset) and the fact that wined3d can change it could help maintenence in the long run mayhap?...just a simple question... nothing major

L. Ulmer: It will be based off 'wined3d' which is the Wine driver that will provide 3D support to all revisions of DirectX (for now, mostly D3D8 and 9, but in the future, migrating DX1-7 is planned also). Wine Archive


T. Mann April 2005 Wine Archive link: I was recently messing around with Oliver's new patch...So, in case anyone...doesn't want to ask, the command that I used to patch wine-20050419 from within the wine directory was :

patch -p2 < (path_to_patch)/d3d9patch.2005-04-28-2.diff

Links

Wine Links

WineHQ's Issues

Discussions

In wine-devel : 12/09/04 : Directx9 - Discussion begun by "Ann and Jason Edmeades".

External Links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox