On Wed, Nov 1, 2017 at 3:44 AM, Alexandre Julliard julliard@winehq.org wrote:
Józef Kucia joseph.kucia@gmail.com writes:
On Wed, Nov 1, 2017 at 11:26 AM, Alexandre Julliard julliard@winehq.org wrote:
Roderick Colenbrander thunderbird2k@gmail.com writes:
The amount of code sharing between ICDs, I expect to be mostly in generated code and maybe a few helper functions. For now I think it is best to duplicate code and longer-term if a little bit of sharing makes sense put this in a staticly linked helper library. I want to avoid implementing our own 'winevulkan' glue ICD library in between loader and display driver as I fear this will cause many issues, because the object design didn't lend for this (assumes 1 ICD = 1 driver). Besides some applications load the ICD directly.
This first wave of patches gets some initial ICD infrastructure in place. Enough to create a minimal Vulkan Instance and get some function loading going. It will take another 6-7 patches or so before 'vulkaninfo' the Vulkan equivalent of glxinfo will work to some degree.
For now the easiest way to load the ICD is to add a registry key: [HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers] "C:\Windows\System32\winex11.json"=dword:00000000
winex11.json: { "file_format_version": "1.0.0", "ICD": { "library_path": "c:\windows\system32\winex11.drv", "api_version": "1.0.51" } }
How would this be able to support multiple drivers with the same install? It seems to me that an intermediate library that calls the currently active driver would be better. What sort of issues do you think it would cause?
In the current approach our Vulkan ICD uses the Linux Vulkan loader internally. The Linux Vulkan loader should discover all drivers. In other words, our Vulkan ICD may expose multiple Vulkan physical devices.
I mean multiple Wine drivers. For instance, once we have a Wayland driver, a proper Wine package would include both Wayland and X11 drivers, and they would be selected at run-time based on the DISPLAY variable. So it seems to me the Vulkan ICD should retrieve the current driver from the HWND, similar to what opengl32.dll is doing.
There is not guaranteed to be an HWND, you can use Vulkan for offscreen rendering with no interaction with X11 / Win32 concepts. Any driver like enumeration is triggered through some of the 'global vulkan calls' e.g. vkEnumerateInstanceProperties / vkEnumeratePhysicalDevices. It is more about adapter enumeration across drivers. To make things more fun in some use cases you can use multiple GPUs across different drivers to work together, to some extend managed by the loader.