Commit Graph

118 Commits

Author SHA1 Message Date
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 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 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 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
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
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 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 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
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 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
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 e447e86ae2 winevulkan: Fail on explicit layer usage.
Fixes failure in dEQP-VK.api.device_init.create_instance_layer_name_abuse which
expects all layers passed in as part of test to cause instance creation to
fail.

A quirk bit WINEVULKAN_QUIRK_IGNORE_EXPLICIT_LAYERS has been added to
optionally restore the previous functionality.

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-09 21:00:30 +02:00
Brendan Shanks c5675ec615 winevulkan: Fix vkEnumerateInstanceExtensionProperties() behavior when no Vulkan driver is present.
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-08-18 21:36:39 +02:00
Liam Middlebrook 18d7bc9859 winevulkan: Harden calibrated_timestamps failure paths.
Addresses some comments that Zhiyi had made on the initial review thread.

Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 21:24:16 +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
Georg Lehmann 380b7f2825 winevulkan: Unwrap object for VK_EXT_private_data when needed.
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-07-08 22:13:12 +02:00
Brendan Shanks aec1968788 winevulkan: Don't initialize the Vulkan driver in DllMain().
Fixes an issue where winevulkan would not be registered if no Vulkan
driver was present during prefix creation (such as in a build VM).

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 09:15:37 +02:00
Zhiyi Zhang 8007d19c27 winevulkan: Fill Vulkan device LUID property.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 20:14:10 +02:00
Zhiyi Zhang 408a5a86ec winevulkan: Thunk vkGetPhysicalDeviceProperties2 and vkGetPhysicalDeviceProperties2KHR.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 20:14:07 +02:00
Brendan Shanks dfc159d874 winevulkan: Create JSON manifest and registry entry used by official Vulkan loader.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47109
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-03-31 15:53:53 +02:00
Francois Gouget 0d6f7d44a2 winevulkan: Fix the spelling of an ERR() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-13 09:58:53 +01:00
Józef Kucia df6b2381f8 winevulkan: Generate conversion function for VkDeviceCreateInfo structure extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-10 18:53:27 +02:00
Józef Kucia a4b9460ad6 winevulkan: Generate conversion function for VkInstanceCreateInfo structure extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-10 18:53:20 +02:00
Józef Kucia ec8a3a78b8 winevulkan: Convert VkPhysicalDeviceFeatures2 in VkDeviceCreateInfo chain.
We should teach make_vulkan to handle pNext chains...

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-20 20:17:04 +01:00
Józef Kucia f3f38eb8c7 winevulkan: Trace structure types as decimal numbers.
In Vulkan headers, structure types are specified as decimal numbers.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-20 20:17:02 +01:00
Józef Kucia 8692cf6e59 winevulkan: Implement VK_KHR_external_semaphore_capabilities.
We don't support any handle type yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-20 20:16:54 +01:00
Józef Kucia 76d2746306 winevulkan: Implement VK_KHR_external_memory_capabilities.
We don't support any handle type yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-20 20:16:50 +01:00
Józef Kucia 57bb5cce75 winevulkan: Implement VK_KHR_external_fence_capabilities.
We don't support any handle type yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-20 20:16:47 +01:00
Józef Kucia d71532df22 winevulkan: Implement VK_EXT_host_query_reset.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-19 18:32:28 +01:00
Józef Kucia 1eaa59765f winevulkan: Use VkBase{In, Out}Structure instead of custom structure.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-01 17:48:26 +01:00