pcsx2_XP icon indicating copy to clipboard operation
pcsx2_XP copied to clipboard

DirectX11 renderer for PCSX2 XP

Open blueclouds8666 opened this issue 5 years ago • 5 comments

recently @andika207 mentioned about some unofficial ways to make DirectX 10 and 11 work under Windows XP, a feature i wasn't much aware of or informed. It turns out a russian group managed to port some of the DirectX components to said operating system, althought it seems to be experimental and far from perfect, i thought it could be a good idea to test it out with this project. there are currently several ways to make newer versions of DirectX run under XP:

This testing candidate feature will be first tested under the v1.5.0-dev Sep2018 version, located on the branch release-1.5.0. It seems code modification is needed in order to make GSDx detect the machine is indeed compatible with the DX11 renderer. Any code modifications will logically published on new branch. Also, I don't know what kind of performance and functionality to expect from this unofficial "patches", so if it doesn't mean any improvement in contrast with the other renderers, it might not be worth to invest much time on it.

inline

blueclouds8666 avatar Oct 17 '20 15:10 blueclouds8666

After testing for a while different unofficial DirectX implementations for XP, i've reached some conclusions and also results regarding PCSX2 in DX11 mode:

  • The unofficial DirectX 10 for Windows XP, origially published by the russian group "LWGame" at around 2008 seems to be legit, however it is very incomplete as essential components such as DXGI weren't re-implemented or adapted. Their trick might have worked with very certain DX10 components on early DX10 games. PCSX2 just doesn't pick the dxgi.dll as the file seems to basically be a placeholder, dependency watcher reporting it's a corrupted file. Trying to replace it with another dxgi.dll that does work and/or forcing PCSX2 to run on DX11 renderer regardless of the detected adapter configuration only results in crash at emulation start.
  • As opposed to my initial thoughts, there is no DirectX 11 adaptation for Windows XP. I could only find an installer which claimed to be that, but was only a botched package with Windows Vista unmodified libraries (thing i discovered by comparing vista libs and seeing missing functions under, which for obvious reasons don't work on XP.
  • However, the WineD3D OpenGL Wrapper library is indeed a real thing. It was (i believe) developed by @Svyatpro at around 2018 as a modification and adaptation of the WineD3D wrapper library, which converts DX to GL calls. The performance isn't obviously great as you can see in the chart below, but it is nice to know there is a conversion library allowing you to run DirectX 11 applications under Windows XP with a reasonably good compatibility (around ~70% of PS2 and PC games seem to run without major graphical bugs or glitches). This library can also be loaded without needing to modify the program or source code, so it's also easy to set up.
  • On the other hand, Federico Dossena's impmementation wasn't useful for our project, as the Windows XP compatible version was last updated in 2015, and WineD3D was incomplete and way slower by that time. I couldn't even make it run with a simple test program, so neither PCSX2 XP (it crashed). Any idea about this is welcome.

Here you can see a screenshot running PCSX2 XP on DirectX 11 mode under XP with said library. The bios blue color is messed up indeed which is a funny glitch. Most games don't seem to suffer from this bug, i've only seen it happening on the bios.

image

blueclouds8666 avatar Oct 18 '20 20:10 blueclouds8666

Performance Results:

I've tested 3 different games under my main machine (FX 8300, GTX 960). While compatibility seemed to be quite good for what it is, there's an important performance hit as a reason of the API conversion and wrapping.

I've measured around 20 ~ 50% of performance drop while using WineD3D for DX11 library and renderer in contrast with the OpenGL renderer. Maybe if Vulkan and DXVK could be made run under WinXP, the performance impact would be probably much lower. But nothing of that exists yet, or seems feasible to ever happen. For this reason and others, i've decided i'm not going to do further implementations or modifications into PCSX2 XP as this all can only be considered an experimental/testing feature, offering less than ideal performance and compatibility for stable releasing.

One of the games, Shadow of the Colossus, only showed a black screen while running with DX11 over WineD3D, making it unplayable. The other two ran without any noticable graphical glitch or anomaly. You coulnd't tell it was running a conversion wrapper in behind, leaving performance aside. More details about the benchmarks:

  • GTA San Andreas: benchmarked for 90 seconds one of the first scenes, just after Tenpenny starts driving the police car.
  • Shadow of the Colossus: The intro scene, also 90 seconds.
  • Gran Turismo 3: One of the replays that are already on the game, featuring a toyota on wet pavement, 60 seconds.
  • GSDx settings were left on defaults except large framebuffer (disabled). EE settings and speed hacks are also in defaults.

image

blueclouds8666 avatar Oct 18 '20 21:10 blueclouds8666

Guide on how to use PCSX2 XP DirectX 11 renderer under Windows XP:

First of all, you should know any PCSX2 version should be compatible with this method regarding it works on XP, including those from many years ago! However, PCSX2 XP v1.6.0 does NOT work with this method because DirectX was stripped down from that release.

  • 1. Set-up the desired PCSX2 version, including BIOS and essential settings. We recommend you use PCSX2 XP v1.5.0-dev, but you can as well use v1.4.0, v1.2.1 or even older

  • 2. Now you need to download the WineD3D wrapper library that works with XP. I originally found it as a component of the XomPie project made by @tumagonx. Download the latest release from here.

  • 3. The downloaded file is an installer. You can directly install XomPie and PCSX2's DX11 renderer will thereafter work without the need to change anything else. However i don't recommend you do that as it introduces bugs to other system software (New Moon/Mypal sometimes presents rendering issues and crashes). We can avoid that by doing the following.

  • 4. Right click on xompie-0.6a.exe and extract it with 7-Zip. A folder with dozens of files will appear, but we only need 3: "d3d11.dll", "dxgi.dll" and "wined3d.dll". Copy those 3 files and paste them into the root directory of your PCSX2 installation, that is, the same location as pcsx2.exe.

If you now run PCSX2 and open the GSDx plugin settings, you'll now find a DirectX 11 renderer option, which can be used right away, as you would on Windows Vista+. The performance of DirectX 9 and/or OpenGL renderers shouldn't be affected while having WineD3D "installed" into the PCSX2 directory, nevertheless you can always remove those 3 libraries whenever you want.

PS: You might find interesting checking the XomPie project, which tries to extend WinXP software compatibility. Thanks for your efforts towards the Windows XP scene!

blueclouds8666 avatar Oct 18 '20 21:10 blueclouds8666

You may want to try the WineD3D files from BlackWingCat Extended Kernel (Windows 2000) or OneCoreAPI since those should be more recent.

Extended Kernel for 2000 is in some ways more compatible than OneCoreAPI (XP) and is also updated more often, although Extended Kernel is for 2000 the WineD3D files may work. I haven't bothered yet to test if PCSX2 works on Windows 2000 with Extended Kernel but if it works on vanilla XP then it should.

DosFreak avatar Oct 22 '20 18:10 DosFreak

http://blog.livedoor.jp/blackwingcat/archives/1299806.html http://win2k.org/wlu/wlu.htm http://win2k.org/cgi-bin/dl.cgi?file=Windows2000-KB935839-v30fM-x86-ENU.wlu

DosFreak avatar Oct 22 '20 18:10 DosFreak