[PATCH] wined3d: Avoid ending the renderpass when issuing a query.

Henri Verbeet hverbeet at gmail.com
Mon Jun 28 10:12:47 CDT 2021


On Mon, 28 Jun 2021 at 15:38, Jan Sikorski <jsikorski at codeweavers.com> wrote:
>
> Allocate a fresh query index that does not need to be reset.
> Reset query pools at creation and when the render pass is ended.
>
> Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
> ---
>  dlls/wined3d/context_vk.c      | 19 +++++++++++---
>  dlls/wined3d/query.c           | 47 ++++++++++++++++++++++++++--------
>  dlls/wined3d/wined3d_private.h |  6 ++++-
>  3 files changed, 57 insertions(+), 15 deletions(-)
>
Seems fine, just some nit-picks:

> @@ -1300,6 +1299,15 @@ void wined3d_context_vk_end_current_render_pass(struct wined3d_context_vk *conte
>                  context_vk->vk_framebuffer, context_vk->current_command_buffer.id);
>          context_vk->vk_framebuffer = VK_NULL_HANDLE;
>      }
> +
> +    while (!list_empty(&context_vk->dirty_query_pools))
> +    {
> +        struct wined3d_query_pool_vk *pool_vk = LIST_ENTRY(list_head(&context_vk->dirty_query_pools),
> +                struct wined3d_query_pool_vk, dirty_entry);
> +        list_remove(&pool_vk->dirty_entry);
> +        list_init(&pool_vk->dirty_entry);
> +        wined3d_query_pool_vk_reset(pool_vk, context_vk, vk_command_buffer);
> +    }
>  }
>
We'd normally use LIST_FOR_EACH_ENTRY_SAFE here.

> @@ -2023,16 +2023,19 @@ struct wined3d_pipeline_statistics_query
>  struct wined3d_query_pool_vk
>  {
>      struct list entry;
> +    struct list dirty_entry;
>
[...]
> @@ -2574,6 +2577,7 @@ struct wined3d_context_vk
>
>      struct list active_queries;
>      struct wined3d_pending_queries_vk pending_queries;
> +    struct list dirty_query_pools;
>      struct list free_occlusion_query_pools;
>      struct list free_timestamp_query_pools;
>      struct list free_pipeline_statistics_query_pools;

Perhaps "completed" would be slightly more descriptive (and
consistent) than "dirty". It may also be worth adding a small comment
explaining why we don't just call vkCmdResetQueryPool() from
wined3d_query_vk_begin(), perhaps in
wined3d_query_pool_vk_mark_complete() or
wined3d_query_pool_vk_reset().



More information about the wine-devel mailing list