Commit Graph

235 Commits

Author SHA1 Message Date
Jacek Caban 250072f91e winevulkan: Move Vulkan calls to Unix lib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Jacek Caban 187e4d7e2f winevulkan: Don't use heap.h.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Jacek Caban 9e34b8b0d6 winevulkan: Implement Vulkan entry points as wrappers around unix_funcs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Jacek Caban c7eeeb0191 winevulkan: Introduce unix_funcs struct.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Georg Lehmann 62cb6ace2c winevulkan: Fix queue creation with mixed queue flags.
The Vulkan spec says:
The queueFamilyIndex member of each element of pQueueCreateInfos must be unique
within pQueueCreateInfos, except that two members can share the same
queueFamilyIndex if one is a protected-capable queue and one is not a
protected-capable queue.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:52:00 +02:00
Jacek Caban cc3c23c312 winevulkan: Move wine_vk_init to loader.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:51:46 +02:00
Jacek Caban 2d3309d854 winevulkan: Move fill_luid_property and its callers to loader.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:51:41 +02:00
Jacek Caban 1cc6b4921a winevulkan: Remove native_vkGetInstanceProcAddrWINE.
It was needed for use cases like DXVK winelib builds. It was never
really adopted and it's problematic for PE builds.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:51:35 +02:00
Jacek Caban 08c1b0a039 winevulkan: Move ICD functions to loader.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:34:47 +02:00
Jacek Caban 4278a30e63 winevulkan: Move registration functions to new loader.c file.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:34:21 +02:00
Jacek Caban 504213c9a7 winevulkan: Use pthread_rwlock_t in VkInstance_T.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:34:11 +02:00
Jacek Caban a27d5bae11 winevulkan: Use standard CRT memory allocators.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:34:09 +02:00
Georg Lehmann 3b63afeeba winevulkan: Simplify thunk declaration.
Previously
"thunk" : True, "private_thunk" : True
and
"thunk" : False, "private_thunk" : True
had the same effect and make_vulkan used both variant.
Replacing the two bools with an enum should reduce confusion.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:33:46 +02:00
Georg Lehmann 67000f2969 winevulkan: Implement vk_icdGetPhysicalDeviceProcAddr.
When using the windows vulkan loader vk_icdGetPhysicalDeviceProcAddr
is used for unknown physical device functions.
Fixes Red Dead Redemption 2 with vkd3d-proton. The game replaces wine's
vulkan-1.dll with a windows version that doesn't know functions used by
vkd3d-proton.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 22:44:35 +02:00
Georg Lehmann 88da78ef42 winevulkan: Generate a separate physical device dispatch table.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 22:44:35 +02:00
Victor Hermann Chiletto 2c548247c9 winevulkan: Implement vkEnumerateDeviceLayerProperties.
Currently, this function is passed through winevulkan to the system's
Vulkan loader, which causes the loader to write the system's device
layers properties in pProperties.

Unreal Engine 4 then calls vkEnumerateDeviceExtensionProperties, using
VkLayerProperties::layerName as the pLayerName.

winevulkan's implementation of vkEnumerateDeviceExtensionProperties then
returns VK_ERROR_LAYER_NOT_PRESENT, crashing UE4.

This issue was found while debugging Project Wingman (Steam appid
895870), but it should also happen to any UE4 application using the
Vulkan RHI.

Signed-off-by: Victor Hermann Chiletto <v@hnn.net.br>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-24 20:43:48 +01:00
Victor Hermann Chiletto dff2f63210 winevulkan: Adequate vkEnumerateInstanceLayerProperties to the Vulkan spec.
The section for vkEnumerateInstanceLayerProperties states [1]:

On success, this command returns
 * VK_SUCCESS
 * VK_INCOMPLETE

On failure, this command returns
 * VK_ERROR_OUT_OF_HOST_MEMORY
 * VK_ERROR_OUT_OF_DEVICE_MEMORY

Always setting the layer count to zero and returning VK_SUCCESS is
valid, as even if the function is given an array in pProperties, it's
filled with zero layers

[1]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceLayerProperties.html

Signed-off-by: Victor Hermann Chiletto <v@hnn.net.br>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-19 10:08:53 +01:00
Georg Lehmann 5a3b5c9689 winevulkan: Fix 64bit enums on old gcc versions.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-11 21:52:17 +01:00
Georg Lehmann d49cbc7f14 winevulkan: Generate constants for 64bit flags.
Fixes one of the issue related to the changes for VK_KHR_synchronization2.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 11:58:41 +01:00
Georg Lehmann 3a359feb85 winevulkan: Rework VkEnumValue creation.
Makes future changes to VkEnumValue easier by deduplicating creation logic.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 11:58:41 +01:00
Rémi Bernon 2eae345d8c winevulkan: Fix host command_buffers allocation size.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-03 21:54:45 +01:00
Francois Gouget 949e4e764b winevulkan: Add a trailing linefeed to FIXME() messages.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-02 20:43:16 +01:00
Liam Middlebrook 7e85f53d28 winevulkan: Update to VK spec version 1.2.170.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 16:20:42 +01:00
Liam Middlebrook 746b27f97d winevulkan: Handle bitmask types backed by VkFlags64.
Previously bitmask types were always treated as 32-bit values, now the basetype of each bitmask must
be checked.

Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 16:20:42 +01:00
Georg Lehmann 4f1b297a14 winevulkan: Fix vkDestroyDebugReportCallbackEXT with NULL object.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Georg Lehmann ffd58f6275 winevulkan: Fix vkDestroyDebugUtilsMessengerEXT with NULL object.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Georg Lehmann c1824d578a winevulkan: Fix surface functions if they aren't called by winevulkan.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50549
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 21:58:13 +01:00
Georg Lehmann 88eb322830 winevulkan: Don't advertise VK_EXT_headless_surface.
This extension never worked.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 21:57:42 +01:00
Liam Middlebrook c681a0732f winevulkan: Update to VK spec version 1.2.168.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:00:37 +01:00
Liam Middlebrook 60eff6d65a winevulkan: Skip commands which are declared but not defined.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:00:05 +01:00
Georg Lehmann 2d4dd4252b winevulkan: Unwrap VkSurfaceKHR if required.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50422
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 21:39:40 +01:00
Georg Lehmann d9c9b5ea61 winevulkan: Wrap VkSurfaceKHR in winevulkan.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 21:39:23 +01:00
Georg Lehmann 6b2199c3da winevulkan: Update to VK spec version 1.2.166.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:22:46 +01:00
Georg Lehmann eb9f3dd3ad winevulkan: Skip extensions that require a skipped extension.
Needed to skip VK_NV_acquire_winrt_display in the next version bump.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:22:16 +01:00
Liam Middlebrook 7d8c50e437 winevulkan: Update to VK spec version 1.2.162.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 21:05:04 +01:00
Liam Middlebrook b84d11d18e winevulkan: Make_vulkan handle VkDeviceAddress basetype.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 21:05:04 +01:00
Georg Lehmann 80fcfbc25a winevulkan: Initialize Vulkan in native_vkGetInstanceProcAddrWINE.
In the past this was done in DllMain, the removal broke winelib applications.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 21:06:18 +01:00
Liam Middlebrook 572aa09de1 winevulkan: Update to VK spec version 1.2.160.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 21:38:06 +01:00
Georg Lehmann 219359dddd winevulkan: Enable VK_EXT_validation_features and VK_EXT_validation_flags.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-02 22:41:25 +01:00
Georg Lehmann fc893489fe winevulkan: Implement VK_EXT_debug_marker.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49813
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 10:34:13 +01:00
Georg Lehmann 4a213cae61 winevulkan: Remove comment from VkEnumValue.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 11:04:26 +01:00
Georg Lehmann 44500d3cfc winevulkan: Don't use comments for object types.
We shouldn't do that according to the Vulkan xml maintainer.
https://github.com/KhronosGroup/Vulkan-Docs/pull/1379

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 11:04:14 +01:00
Georg Lehmann 28d75542b7 winevulkan: Implement VK_EXT_debug_report.
Messages from the driver/layers won't be reported twice.
Messages during instance creation by the host loader won't be reported,
since the information is partly wrong and the windows loader reports the
correct information.
Other messages by the loader will be reported twice if lunarg's vulkan-1.dll
is used. This shouldn't be a problem because the messages are just used
for logging/debugging.

Needed for Quake2RTX.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49813
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-29 11:04:12 +01:00
Liam Middlebrook 02458faa43 winevulkan: Update to VK spec version 1.2.158.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-19 22:21:53 +02:00
Georg Lehmann bff6bc6a79 winevulkan: Implement VK_EXT_debug_utils.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49813
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-14 11:02:11 +02:00
Georg Lehmann af3d292343 winevulkan: Store a mapping from native handles to wrappers.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-14 11:01:51 +02:00
Georg Lehmann e2518f6887 winevulkan: Generate helpers for wrapped handles.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-14 11:01:49 +02:00
Liam Middlebrook a8ddba3576 winevulkan: Update to VK spec version 1.2.155.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-30 10:56:22 +02:00
Liam Middlebrook 844dbbffb3 winevulkan: Add --xml argument to make_vulkan.
This eases development and of Vulkan extensions by allowing developers
to locally override the specification XML file used by winevulkan.

Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Piers Daniell <pdaniell@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-30 10:51:00 +02:00
Georg Lehmann d4b162509f winevulkan: Forward declare required structs for function pointer.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-23 15:44:53 +02:00