protonscr

Using dxvk to faciliate game engine porting

dxvkclosed question
doitsujin/dxvk#675 · opened 2018-09-28 by a1batross · updated 2019-02-28 · 5 comments · github
Aa1batross 2018-09-28 github

Hello, fellow developers.

I am wondering, how hard using DXVK as a wrapper for Linux ports to minimize work?

All that I understood on this moment: DXVK provides DXGI(which initializes the D3D10/11 driver) and D3D10/11 implementation DLLs. For build it requires Wine headers.
So, for example, I am porting some game engine with D3D10 and D3D11 renderer backends. Game engine successfully initializes Vulkan with SDL2. Windows build already works fine with DXVK on Wine. Then...

  1. Do I need DXVK's DXGI to be compiled-in to engine? Can I use just DXVK's D3D10/11 wrapper?
  2. Can I just use Wine's definitions, not the code(winelib) itself?

Don't know if it was posted before, if so, sorry for taking your time.

Ddoitsujin maintainer 2018-09-28 github

It's an interesting use case, but I don't think it's feasible to use DXVK for porting right out of the box unless your entire port is based on winelib. DXGI is tightly coupled to the win32 window management API, which causes a number of issues:

  • Implementations of IDXGISwapChain and IDXGIOutput would have to be rewritten against whatever you use for window management (in this case, SDL2). It currently uses raw win32 functions.
  • Linux window system support would need to be added to the backend so that DXVK can create a VkSurface for your window.
  • Some other win32-specific stuff would need to be rewritten or removed, but those should be simple.

I haven't explored the option of using DXVK for native apps yet, so there might be more potential issues.

Aa1batross 2018-09-28 github

Thanks for answer! :)

Port isn't based on winelib, as using wine is not an option.
If I will get something working, I will send a PR. Currently I just patched meson buildscripts a little.

Sshmerl 2018-09-30 github

Why using Wine/winelib is not an option though, if you are ready to use wrapping in general?

Ggasinvein 2018-10-05 github

Feral would be interested in this, for sure.

Aa1batross 2018-10-06 github

@shmerl because it needs wine as a dependency. Also, winelib doesn't give any serious advantages at all.
@gasinvein for sure.

Nothing extracted yet.