Jan Sikorski : wined3d: Avoid waiting for a command buffer to finish executing to read off its queries.

Alexandre Julliard julliard at winehq.org
Fri Feb 11 14:33:59 CST 2022


Module: wine
Branch: master
Commit: 9a799898a1ff2d124b98e959637121628f92e64a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9a799898a1ff2d124b98e959637121628f92e64a

Author: Jan Sikorski <jsikorski at codeweavers.com>
Date:   Thu Feb 10 15:21:56 2022 +0100

wined3d: Avoid waiting for a command buffer to finish executing to read off its queries.

Some games wait for query results on the frame executing the query,
expecting that enough time have passed for it to be available. By
requiring that the entire command buffer is done, we risk stalling the
whole frame if it wasn't flushed along the way. This patch drops this
requirement.

Mainly, we need to ensure that we don't call vkGetQueryPoolResults()
before the reset command is executed, and accidentally retrieve result
from previous usage. Using host query reset doesn't quite solve the
problem, as it might get called too early, if the application decides to
reuse a query without waiting for results. Besides, we want to support
devices where host query reset is not available.

To make it work, when a Vulkan query is no longer needed, we queue it
for resetting at command buffer submission time, and only mark it free
for reuse after this command buffer is finished executing.

Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context_vk.c      | 89 ++++++++++++++++++++++++++++++++++++------
 dlls/wined3d/query.c           | 84 ++++++++++++++++++---------------------
 dlls/wined3d/wined3d_private.h | 13 +++++-
 3 files changed, 124 insertions(+), 62 deletions(-)

Diff:   https://source.winehq.org/git/wine.git/?a=commitdiff;h=9a799898a1ff2d124b98e959637121628f92e64a



More information about the wine-cvs mailing list