wined3d: Poll Vulkan queries directly on the application thread.
commit1a7a50a140ea6f0c15bc5da2c22adfaae952fed2
authorJan Sikorski <jsikorski@codeweavers.com>
Fri, 4 Mar 2022 17:12:58 +0000 (4 18:12 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 7 Mar 2022 19:32:57 +0000 (7 20:32 +0100)
tree20f2eb19abda35b0d3fbd2a47261a8d12aa19b55
parent7f1473e4beab6f1a6128f431cb8af74b634208d8
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>
dlls/wined3d/query.c
dlls/wined3d/wined3d_private.h