Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building Direct3D renderers on Linux with DXVK-Native #1056

Closed
Firlaev-Hans opened this issue Jul 4, 2022 · 8 comments
Closed

Support building Direct3D renderers on Linux with DXVK-Native #1056

Firlaev-Hans opened this issue Jul 4, 2022 · 8 comments

Comments

@Firlaev-Hans
Copy link

Is your feature request related to a problem? Please describe.
Currently the OpenGL renderer is the only supported rendering backend on Linux, and for me it performs quite a bit worse than just running the Windows version in Wine with DXVK, but that is not ideal.

Describe the solution you'd like
DXVK-Native allows building native Linux binaries with support for Direct3D on Vulkan through DXVK. Supporting this in Linux builds for OpenXRay could help performance quite a bit.
(Additionally, once DXVK-native is implemented, it may be possible to use the D3D9 renderer with the native D3D9 implementation for AMD/Intel on Linux called "Gallium Nine" using the Xnine project, without any extra work, enabling good performance with DX9 on Linux even on GPUs that are too old for Vulkan.)

Describe alternatives you've considered
Ideally, to provide the best performance on all platforms, OpenXRay should get a proper, native and optimized Vulkan rendering backend. But while it would be cool to see this happen eventually, I understand that this would be a lot of work to implement, and DXVK could provide an acceptable solution for Linux users in the meantime.
(Also, I'm sure there is a lot of room for optimization in the OpenGL renderer)

@Xottab-DUTY
Copy link
Member

@eagleivg, @q4a, what do you think, guys?)

@Manuel-K
Copy link

Manuel-K commented Jul 5, 2022

This sounds like a great idea, but I'm not sure about the current status of that project. It seems that development has stalled until it is merged into main dxvk, but I haven't been able to find out how far along they are, although there are some related PRs.

@q4a
Copy link
Member

q4a commented Jul 5, 2022

DXVK-Native looks good, except 1 thing - it has no shader (HLSL) compiler for Linux, In Windows it uses native d3dcompiler_43.lib.
I have only 1 solution for that - add precompiled binary shaders - *.pso and *.vso and then load it with CTechnique::ProcessShaderBin

It looks not so good, when you have 10-20 shaders in your project, but still ok. OXR has much more shaders and they are not included in repository. So, I think that you need to find better solution for shaders.

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Jul 5, 2022

@q4a, precompiled shaders are included in the vanilla gamedata for R1 and R3/R4 renderers. (but not R2, for some reason)
It's not .pso or .vso, but just raw bytecode. I'm sure, it can be used with DXVK-Native too.

@TheEpicNoobZilla
Copy link

TheEpicNoobZilla commented Jul 13, 2022

DXVK-Native from what i see is few released behind main DXVK, also Gallium Nine is only for open source drivers, if you use for example Nvidia drivers you can't, both 340 and 390 branches of those drivers are still maintained on Ubuntu and Fedora so if you have nvidia GPU from range of 8xxx up to 5xx you won't be able to benefit from Gallium Nine, while performance of a lot of GPU's would be able to run it using native OpenGL 4.x. If you want to expand Linux support for this engine it would be better to implement OpenGL 3.x or 2.x as replacement of DirectX 9 and 10. I am not talking about newer branches since most if not all GPU's supported by those branches have Vulkan support. Currently using Gallium Nine at least for nvidia users are on the hope that nouveau will improve their drivers for GPU's below 6xx which will not happen soon enough. I know develepement of this engine went a lot so rewriting DX 9 and DX 10 to OpenGL 2 and 3 will not happen. Still if you want to use DXVK you should use wine since it's way easier to setup and download once a time binaries from GitHub actions than compile this engine for Linux if you do not use Ubuntu (even when you use sometimes binaries from Action will not install)

@TheEpicNoobZilla
Copy link

Especially since DX 10 renderer for Clear Sky is broken and OpenGL is the only one that works properly at the time of writing.

@Xottab-DUTY
Copy link
Member

  1. AFAIR, DXVK-Native was merged into the upstream DXVK. This is good.
  2. Anyway, I don't know how to use it yet, so here's a link to a project that uses DXVK. We can look into it to see how we can use DXVK.
    https://github.com/rrika/cdcEngineDXHR

@Xottab-DUTY
Copy link
Member

I'm currently cutting everything not too useful. The idea with DXVK-Native is good and interesting, but it has the above mentioned problems like shaders compilation, etc.
It's better to concentrate on #280 and #447.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

5 participants