Commit Graph

10717 Commits

Author SHA1 Message Date
Henri Verbeet 1765c4594f wined3d: Spawn a separate thread to adjust the window state of windows belonging to other threads.
Sending messages to windows on other threads can deadlock if those threads
aren't processing messages. The deeper issue is that we shouldn't be touching
the window styles in the first place, but avoiding that may not be feasible
without specific support from winex11/winemac.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-04 19:52:45 +02:00
Jan Sikorski 8676f28a8a wined3d: Reset and reuse Vulkan descriptor pools.
Creating and destroying them is fairly slow.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-01 20:47:02 +02:00
Jan Sikorski 801f1bb433 wined3d: Increase the CS queue size.
Final Fantasy XIV routinely runs out of space in the queue, which
affects the frame rates.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-30 18:32:33 +02:00
Henri Verbeet e58f596cd3 wined3d: Add GPU information for NVIDIA Tesla T4.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-30 18:32:32 +02:00
Dmitry Timoshkov 0e4f31ac93 wined3d: Avoid calling _strnicmp() with limit -1.
It's considered invalid by native ucrtbase (installed with winetricks).

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-29 20:53:50 +02:00
Henri Verbeet 4b3019142f wined3d: Return the correct length from config_list_get_value().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-28 22:21:47 +02:00
Paul Gofman 2ce72c6872 wined3d: Add full dirty region at texture creation.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:52:36 +01:00
Jan Sikorski eae36aab81 wined3d: Reuse deferred uploads heaps.
Avoids needing to fault-in the memory on each recording.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-25 17:52:26 +01:00
Jan Sikorski 2b3bb9e868 wined3d: Check map queue when executing command lists.
Increases performance of The Evil Within, and possibly other games that
render using command lists and map resources in the meantime.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-24 23:22:06 +01:00
Jan Sikorski a7815d352c wined3d: Flush on texture download to avoid stalling on readout.
Fixes a stall during a map operation in The Evil Within.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-24 23:22:06 +01:00
Jan Sikorski 670a1e81b4 wined3d: Pass mask to wined3d_next_cs_packet().
It's not just used on the CS queue, but also on packet lists in deferred
contexts.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-15 23:54:33 +01:00
Zebediah Figura 93217a4ad2 wined3d: Try to load winevulkan.dll instead of vulkan-1.dll.
The Khronos Vulkan loader calls into dxgi, which results in infinite recursion.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52640
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 12:47:40 +01:00
Alexandre Julliard a3e9ed6fc8 wined3d: Only use __builtin_popcount in PE builds.
It's not compatible with -mabi=ms.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 11:26:22 +01:00
Stefan Dösinger 50b6b72d30 wined3d: Replace while (1) with for (;;).
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Stefan Dösinger b854c12a3e wined3d: Replace the GE_WRAP macro with a function.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Stefan Dösinger bff2bbc904 wined3d: Rename resource_acquire to resource_reference.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Matteo Bruni 32799848e3 wined3d: Use list_empty() in shader_glsl_destroy().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zebediah Figura ee12556960 wined3d: Prevent buildup of retired OpenGL buffer objects' memory.
Analogous to d71358f5e9 for the Vulkan backend.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52574
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zebediah Figura 94c08e6dd1 wined3d: Trace GL buffer object creation more accurately.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zebediah Figura 1eabd77422 wined3d: Do not print a d3d_perf warning in adapter_vk_alloc_bo() for unmapped BOs.
BOs will always be unmapped here. This is a relic from an older form of the code
where mapping was done in wined3d_context_vk_create_bo().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 18:27:43 +01:00
Zebediah Figura fdf2995604 wined3d: Allow changing settings using a new WINE_D3D_CONFIG environment variable.
This can be significantly more convenient than modifying the registry.

config_list_get_value() is based on vkd3d_debug_list_has_member() by Józef
Kucia.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-09 20:54:17 +01:00
Stefan Dösinger 10baf0cb9e wined3d: Remove the no-op wined3d_resource_release.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-09 20:54:17 +01:00
Stefan Dösinger cb4385ea87 wined3d: Use the default queue index for resource fencing.
This removes tracking work entirely from the CS thread and replaces
interlocked with regular writes on the main thread. It also avoids
accessing access_count in read-write mode from two threads.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-09 20:54:17 +01:00
Stefan Dösinger e308f53aa6 wined3d: Use extra bits in the queue head and tail counters.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-09 20:54:17 +01:00
Jan Sikorski 8e0ab7363d wined3d: Implement event queries using Vulkan events.
This makes event results available sooner, i.e. after they are executed
by the GPU, and also moves the polling from CS to application's thread.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 20:33:00 +01:00
Jan Sikorski 1a7a50a140 wined3d: Poll Vulkan queries directly on the application thread.
We want to avoid using the poll list, for occlusion queries especially,
as in some games the number of occlusion queries can reach the hundreds.
OpenGL backend already does this by using ARB_QUERY_BUFFER_OBJECT.
We could mimic this in Vulkan too using compute shaders to accumulate
pending queries, however, unlike with OpenGL, we can also just directly
call vkGetQueryPoolResults() from the application's thread.
A downside of the approach taken here is that Vulkan queries allocated
to a wined3d_query are only released after the query is reused or
destroyed. In principle, if this ever becomes a problem, it could be
avoided by protecting the query pool with a mutex and releasing queries
after reading the results.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 20:32:57 +01:00
Jan Sikorski 7f1473e4be wined3d: Track pending Vulkan queries separately for each query.
This is mostly to enable polling queries from the application thread by
removing the need to access the shared context.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 20:32:54 +01:00
Jan Sikorski 9204569061 wined3d: Add poll_in_cs field to wined3d_query().
Its eventual purpose is to allow for skipping the poll list mechanism
by calling query_poll() in the application thread. In this patch it is
only used for when we don't have a separate CS thread.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 20:32:50 +01:00
Matteo Bruni 6b7ccb76ab wined3d: Fix typo in WARN() message.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 18:59:24 +01:00
Alexandre Julliard 5d62e5603a wined3d: Export all the vkd3d functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 10:07:16 +01:00
Alexandre Julliard 24432a24d5 wined3d: Use the bundled vkd3d and build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-03 10:07:16 +01:00
Zebediah Figura 1b893093fd wined3d: Allocate a heap memory buffer in wined3d_cs_map_upload_bo() if possible.
Based on patches by Matteo Bruni and Michael Müller.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-25 19:02:18 +01:00
Zebediah Figura 125f5b7210 wined3d: Accelerate texture DISCARD maps as well.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:32 +01:00
Zebediah Figura aa9b1fb3a3 wined3d: Allocate texture BOs from heap.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:28 +01:00
Zebediah Figura 1632b8e7a4 wined3d: Use WINED3D_LOCATION_CLEARED for the initial location of textures.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:24 +01:00
Zebediah Figura 4103a7085c wined3d: Consider WINED3D_LOCATION_CLEARED to be a CPU-accessible location.
For the purposes of texture2d_blt(). The main goal here is to allow uploading
from WINED3D_LOCATION_CLEARED to a multisample texture (and hence initializing
it).

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:20 +01:00
Zebediah Figura f4e65025b6 wined3d: Handle DISCARDED and CLEARED locations in wined3d_texture_get_memory().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:15 +01:00
Zebediah Figura 3a67b7f2fb wined3d: Handle WINED3D_LOCATION_CLEARED in wined3d_texture_load_location().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:10 +01:00
Zebediah Figura 23fbec2722 wined3d: Remove the now redundant "locations" parameter from wined3d_texture_get_memory().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:04 +01:00
Zebediah Figura 71b8ec3fd2 wined3d: Introduce a wined3d_texture_get_bo_address() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-24 18:37:00 +01:00
Zebediah Figura 81068b89d8 wined3d: Introduce a wined3d_texture_update_sub_resource() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-21 22:33:54 +01:00
Zebediah Figura 5dd3b178ce wined3d: Set a valid map pointer in adapter_gl_alloc_bo() if possible.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Zebediah Figura 83fc1807f9 wined3d: Treat NOOVERWRITE maps on a previously discarded buffer as if they were DISCARD maps.
For the purposes of wined3d_cs_map_upload_bo().

That is, if a buffer was just created or just discarded [e.g. with
wined3d_device_evict_managed_resources()], and then subsequently mapped with
WINED3D_MAP_NOOVERWRITE, treat it as if it had been mapped with
WINED3D_MAP_DISCARD instead, thus allowing the adapter_alloc_upload_bo callback
to allocate a new buffer from the client thread.

This was the source of a bunch of stalls in Grand Theft Auto V, although it's
hard to measure a difference in performance.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Zebediah Figura 1b1b03055d wined3d: Try to allocate new OpenGL BOs from the client thread for DISCARD maps.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Zebediah Figura f257daf390 wined3d: Do not allocate upload bufers for resources pinned to system memory.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Zebediah Figura c724df3b8e wined3d: Move the "pin sysmem" flag to struct wined3d_resource.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Zebediah Figura 4f54f4591a wined3d: Protect wined3d_chunk_gl map fields with a mutex.
Parallel to a5efc1d5e0. Unlike with the Vulkan
backend, we cannot map chunks from the client thread, but we can access the
mapped pointer and increase the map count of already mapped chunks.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-17 18:57:27 +01:00
Zebediah Figura ec5a71068b wined3d: Don't use persistent BOs from the client thread if we might need to do vertex attribute conversion.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:33 +01:00
Zebediah Figura 95173d6f65 wined3d: Allow passing a NULL context to wined3d_device_gl_create_bo().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:33 +01:00
Zebediah Figura 4a3cefab75 wined3d: Protect access to the OpenGL wined3d_allocator with a critical section.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:33 +01:00