Commit Graph

245 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 da5248bcfa winevulkan: Use wide string literals.
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 48bcb13393 winevulkan: Build with msvcrt.
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 bd5408493a winevulkan: Don't use vulkan_private.h in loader.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 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 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