Commit Graph

181 Commits

Author SHA1 Message Date
Georg Lehmann 9ca95e3265 winevulkan: Override VK_USE_64_BIT_PTR_DEFINES instead of handle definition.
A bit simpler and more consistent because currently VK_USE_64_BIT_PTR_DEFINES
can be 1 but non dipatchable handles are always unit64_t.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 09:52:06 +02:00
Jacek Caban 0fce8076f2 winevulkan: Use wine_ prefix for Unix thunks.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Jacek Caban 007a4bc9b0 winevulkan: Don't use wine_ prefix on PE side.
There is no ABI ambiguity, so we may just use public names.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-29 23:37:45 +02:00
Liam Middlebrook 9c1d52dff4 winevulkan: Update to VK spec version 1.2.176.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 22:57:11 +02:00
Liam Middlebrook 108e093f01 winevulkan: Explicitly define VK_NULL_HANDLE.
This fixes a mismatch that occurred when the default type of VK_NULL_HANDLE and
VK_DEFINE_NON_DISPATCHABLE_HANDLE had changed in the upstream XML. Because WineVulkan overrides the
definition of VK_DEFINE_NON_DISPATCHABLE_HANDLE we must do the same for VK_NULL_HANDLE so that the
types match.

Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 22:57:11 +02:00
Liam Middlebrook de87cc6d5b winevulkan: Ignore Zircon handle type.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Daniel Koch <dkoch@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 22:57:11 +02:00
Jacek Caban 171fe51b79 winevulkan: Don't use vulkan_private.h in loader_thunks.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 20:08:48 +02:00
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 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
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 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
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
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 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
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 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
Georg Lehmann 51b3191cd3 winevulkan: Add is_alias for VkFunctionPointer.
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:42 +02:00
Liam Middlebrook de508759c6 winevulkan: Update to VK spec version 1.2.154.
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-09-22 11:37:39 +02:00
Brendan Shanks de68f33dae winevulkan: Change make_vulkan interpreter to '/usr/bin/env python3'.
Fixes running on macOS and BSDs where Python 3 isn't installed in
/usr/bin.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-09 20:30:31 +02:00
Liam Middlebrook 72517ff187 winevulkan: Update to VK spec version 1.2.149.
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Signed-off-by: Jeff Bolz <jbolz@nvidia.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-07 15:36:03 +02:00
Georg Lehmann 1e074c39f6 winevulkan: Avoid returning 0 for swapchain maxImageCount.
Many Windows games do not expect that maxImageCount can be set to 0.
A value of 0 means that there is no limit on the number of images.
Nvidia reports 8 on Windows, AMD 16.

Based on a patch by Józef Kucia.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-01 11:32:53 +02:00
Joshua Ashton 8bd62231c3 winevulkan: Implement VK_EXT_calibrated_timestamps.
Map performance counter to the appropriate monotonic clock
used by ntdll/unix/sync.c

The performance counter timestamp clock won't be available
under Mac and platforms without clock_gettime.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:42:19 +02:00