Later patches are on https://gitlab.winehq.org/giomasce/wine/-/commits/chianti, though they still require some cleanup and cosmetic changes.
Currently the D3D12 swapchain accesses the low level Vulkan queue backing a vkd3d `ID3D12CommandQueue` using the `vkd3d_acquire_vk_queue()` call in order to submit frames for presentation. This causes a number of bugs because `vkd3d_acquire_vk_queue()` lets the caller submit to the Vulkan queue even if some operations are enqueued in the vkd3d internal op …
[View More]queue, which can lead to a frame being presented even if drawing work on it isn't finished (and not even queued, from the viewpoint of Vulkan!).
In order to fix this, I propose to introduce to add a few calls to vkd3d (currently [in this branch](https://gitlab.winehq.org/giomasce/vkd3d/-/commits/mongibello)), to allow the caller to enqueue calls to `vkQueueSubmit()` and `vkQueuePresentKHR()` through the vkd3d internal queue. The D3D12 swapchain would then use this new API instead of directly calling `vkQueueSubmit()` and `vkQueuePresentKHR()` as it does now. Eventually a similar call for `vkQueueWaitIdle()` should be added too. [That's already implemented in vkd3d](https://gitlab.winehq.org/giomasce/vkd3d/-/commit/b5ce799dbaf8c0fc13…, but not used yet in DXGI.
These changes also require introducing a worker thread for each D3D12 swapchain. The worker thread owns the Vulkan (backend) resources associated to the swapchain. Swapchain methods `Present()` and `ResizeBuffers()` do little more than pushing operations to a queue consumed by the worker thread. In this way the swapchain can immediately return on the calling thread, and the worker thread can wait on the operations submitted to the vkd3d queue, ensuring they're executed in the right order without fearing deadlocks. Notice that both `Present()` and `ResizeBuffers()` currently wait on a number of conditions (the availability of a swapchain image, its associated fence, device idleness when destroying Vulkan resources), and even if they shouldn't deadlock there could be a performance impact on the thread calling them. Since this is not a specific design objective, I didn't do any measurement, but hopefully the effect is at least nonnegative.
I considered (and partially implement) some alternative designs, but found them ultimately less satisfying:
* Just implement a generic callback in vkd3d ([in this way](https://gitlab.winehq.org/giomasce/vkd3d/-/commit/ad51ee2ad9597f275603…), that is queued and called with a `VkQueue` argument when dequeued. This is somewhat nicer for the vkd3d public interface, because only one call must be exposed (the one that enqueues a callback); however, DXGI would have to perform waits in the callbacks, which is a great recipe for deadlocks and for making performance harder to measure and debug.
* Use an event-based synchronization, but without a worker thread. Unfortunately that means that the swapchain can only make progress when called by the client. If for some reason a call to `Present()` must wait in the vkd3d internal queue and the client doesn't call the swapchain for some time, the frame presentation could be excessively delayed.
Patches in this MR don't implement those changes yet, but prepare the ground with some tests and light refactoring.
--
v2: dxgi: Split D3D12/Vulkan resource creation and destruction.
dxgi: Pass a VkImage to d3d12_swapchain_queue_present().
dxgi: Free the frontend images memory only once.
dxgi: Consider vk_format a frontend field.
dxgi/tests: Test that the present count is updated when Present() is called.
dxgi/tests: Test that the back buffer index is updated when Present() is called.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3165
[View Less]
`getpeername()` is currently handled in ntdll. This merge request changes ntdll to forward `getpeername()` to wineserver. The implementation utilises new `peer_addr` and `peer_addr_len` fields in wineserver's `struct sock`.
This fixes multiple `todo_wine`s in `ws2_32/tests` and allows for more accurate peer names to be provided in case the address the socket is bound to on the Unix side does not match what `bind()` was called with on the Windows side.
*This merge request was originally …
[View More]intended to be included in !2786 (Add support for AF_UNIX sockets) but was split into its own merge request because this is not an insignificant change.*
--
v9: ws2_32/tests: Remove todo_wine from now-successful tests.
server: Move getpeername() implementation from ntdll/unix.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3074
[View Less]
gnutls now may fail signature verification for the old hash algorithms which are considered insecure (e. g., md5). The test added in the patch fails on Fedora 38 without the flag.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3203
Fixes Age of Empire 2 failing to start due to WinVerifyTrust failing to successfully verify game files' signatures which are signed with ECC key.
I added a test in patch 1 to show that ECC certificate signature raw data indeed has bytes reversed (unlike the signature in messages). The existing code appears to be correct but removing this reversal wasn't resulting in test failures.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3201
Initialize the calendars variable after checking if locale is NULL before using it to avoid NULL
pointer references. Fix a Excel 2016 crash when formatting dates with the custom format 'ddd'.
--
v4: kernelbase: Check if locale is NULL before using it in Internal_EnumDateFormats().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3190
On Windows, `sendto()` ignores its destination parameters when provided with a connection-based socket (currently only SOCK_STREAM), even if they contain invalid data. This patch implements this behavior.
--
v4: ws2_32/tests: Add test for sendto() and recvfrom() on TCP sockets.
ntdll/unix: Skip address conversion for TCP sockets in try_send().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3186