• Jan Sikorski's avatar
    wined3d: Avoid waiting for a command buffer to finish executing to read off its queries. · 9a799898
    Jan Sikorski authored
    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: 's avatarJan Sikorski <jsikorski@codeweavers.com>
    Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    9a799898
wined3d_private.h 250 KB