iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
272 stars 23 forks source link

Gallium Nine description, - some suggestions for improvements ;-) #90

Closed lorn10 closed 3 years ago

lorn10 commented 3 years ago

Hi there

Okay this is not a bug report. I just want to give here some possible suggestions for improvement regarding the main Gallium Nine description. (Well, yes just to be clear I am a noob and totally new to this topic.)

After studying most information, the following aspects regarding the working principle of Gallium Nine are for me somewhat unclear.

  1. Is Gallium Nine really DirectX 9 only? Or are also some older DirectX version like 8, 7 and 6 supported? This could be an quite important point in conjunction with retro-gaming. For example, I have here a quite old DirectX 6 game called "Populous: The Beginning". It supports only the DX6 and the Glide API (no support for OpenGL was ever present).

  2. If only DirectX 9 is supported by Gallium Nine, can I use some sort of a DirectX to DirectX 9 wrapper? There a different versions and concepts available, - some can be found here: https://github.com/elishacloud/DirectX-Wrappers

  3. A final Technical point related question. If I look at the working method of Gallium Nine, would it be theoretically possible to extend it also for older DirectX API versions? And in theory it should be possible to implemented even newer DirectX version like 10, 11 and 12 with that nice "Gallium DX direct pass-through" principle, right?

axeldavy commented 3 years ago

Hi here are some answers to your questions:

1) Yes 2) Some wrappers can map old directx and gdi to direct3D9, but there is no fully complete one to my knowledge. They always have some not-implemented/unoptimized spots, and are tuned for a subset of applications. 3) Direct3D 8 should be easily implementable duplicating the Direct3D 9 code. However older versions should be significantly harder to port. Newer Direct3d require a complete rewrite. It is possible to write a Gallium Direct3D 10, 11 driver, but it is a hell lot of work (likely much more than Direct3D 9). Direct3D 12 driver cannot be implemented efficiently with Gallium (look for Vulkan instead).

lorn10 commented 3 years ago

Many thanks axeldavy for that super detailed response! This answers all of my questions. :-)

I have now found out that it has already existed once a "Gallium Direct3D 10/11 state tracker" called "D3D1x". It was introduced in 2010 but removed again in 2013 because it was incomplete (and therefore buggy) and no longer maintained. There was also some "legal uncertainty" back then about the status of implementing the Microsoft API. (https://www.phoronix.com/scan.php?page=news_item&px=MTMyNDU)

Whatever, you are all GREAT keep up that amazing work! It looks that Gallium Nine is almost final. Maybe the Gallium Nine devs may find in the future some time to begin a new project called Gallium Eleven (based on the above mentioned project). Maybe Microsoft will pay for that. :-P No seriously, to be fair, they are definitively no longer as "evil" as they were in the past. ;-)

Venemo commented 3 years ago

@lorn10 There is DXVK which does a pretty decent job for newer games. It overlaps with Nine, and Nine is better in some cases, but they are both in the same ballpark.

Note that Vulkan is lower level than Gallium, so it should theoretically possible for both of them to reach "native" level of performance. For D3D12 the solution in Wine which translates it to Vulkan is also a good one, many games work with that on Steam out of the box.

For older games, I suggest to use what Wine has by default, that should work all right, and any relatively new (made in the past 10 years) hardware will give you decent performance in these games.

Hope this helps.

lorn10 commented 3 years ago

Thanks @Venemo for this additional information. Yes, DXVK seems to be the solution for hardware which is Vulkan compliant. This is true for graphics hardware which dates up to eight years back.

However, the really SUPER GREAT thing about Gallium Nine is that it works also on really OLD HARDWARE. As an example I can name here an Apple Intel C2D iMac from 2006 which contains an ATi Radeon X1600 (R520/RV530) DirectX 9.0c GPU. Thanks to Gallium Nine I can enjoy in Linux a low level, hardware near (=low overhead) DX9 performance on 14 year old hardware (and games). ;-) If you look at even older original DX9 class hardware then this is true for up to 18 years GPU hardware. Awesome!

The same argument would be theoretically true for a hypothetical Gallium 11 implementation. It would allow in Linux "low overhead" DX10/DX11 performance on non-Vulkan capable DX10/11 class hardware. Again referring to the Apple iMac series, this would apply to all 2007-2011 models. So that's the main reason why I don't see DXVK as an universal alternative.

And finally, regarding DX retro-gaming. The cool thing of DX wrappers like dxwrapper is that some makes it possible to remove old artificial DX API restrictions like the resolution limit. Furthermore it adds functions like AntiAliasing even to older original DX8 games which never supported it. In the end, this makes higher class 4K retro gaming at all possible. :-D So far I know the original Wine D3D-OpenGL implementation doesn't have such nice "additional tuning" features.

More information and a nice DirectDraw to Direct3D9 status overview can be found here: https://github.com/elishacloud/dxwrapper/wiki/DirectDraw-to-Direct3D9-Conversion-Status