doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.44k stars 868 forks source link

[native] Include all supported wsi backend headers #4493

Closed Blisto91 closed 5 days ago

Blisto91 commented 5 days ago

So applications actually can support multiple backends with the same .so

pchome commented 5 days ago
  1. Are you sure #if not defined(DXVK_WSI_SDL3) || DXVK_WSI_SDL2 || DXVK_WSI_GLFW will work? should be #if !defined(DXVK_WSI_SDL3) && !defined(DXVK_WSI_SDL2) && !defined(DXVK_WSI_GLFW)
  2. Are you sure those headers are not overlap? I know almost nothing about SDL, so maybe yes or maybe not (overlap).

EDIT: add DXVK_WSI_WIN32 too. EDIT2: https://onlinegdb.com/DvzVQPy3f -- playground (firs from "google"), hit "Run"

Blisto91 commented 5 days ago

No it was indeed wrong. I drafted it because i had to go away so couldn't fix it immediately

Blisto91 commented 5 days ago

The second question I'll CC @flibitijibibo for

flibitijibibo commented 5 days ago

Can confirm that this would cause conflicts. For native applications that actually plan to support multiple backends, odds are the backends in the application itself would also be split up to avoid the same kind of issues, so each backend can separately include the correct wsi.h without having to worry about collisions.

Blisto91 commented 5 days ago

Thank you for the input both of you. I'll go ahead and close this.

pchome commented 5 days ago

Just do a separate targets maybe.