Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51419 Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/context_vk.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index eac4eacff5a..8df416851f2 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -1314,12 +1314,15 @@ void wined3d_context_vk_end_current_render_pass(struct wined3d_context_vk *conte context_vk->vk_framebuffer = VK_NULL_HANDLE; }
- LIST_FOR_EACH_ENTRY_SAFE(pool_vk, pool_vk_next, &context_vk->completed_query_pools, - struct wined3d_query_pool_vk, completed_entry) + if (vk_command_buffer) { - list_remove(&pool_vk->completed_entry); - list_init(&pool_vk->completed_entry); - wined3d_query_pool_vk_reset(pool_vk, context_vk, vk_command_buffer); + LIST_FOR_EACH_ENTRY_SAFE(pool_vk, pool_vk_next, &context_vk->completed_query_pools, + struct wined3d_query_pool_vk, completed_entry) + { + list_remove(&pool_vk->completed_entry); + list_init(&pool_vk->completed_entry); + wined3d_query_pool_vk_reset(pool_vk, context_vk, vk_command_buffer); + } } }
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/query.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 527d5f6c809..c84fcba7d7d 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -1838,12 +1838,14 @@ static BOOL wined3d_query_timestamp_vk_issue(struct wined3d_query *query, uint32 context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0)); vk_info = context_vk->vk_info;
- wined3d_context_vk_end_current_render_pass(context_vk); command_buffer = wined3d_context_vk_get_command_buffer(context_vk); - if (!query_vk->pool_idx.pool_vk) - wined3d_context_vk_allocate_query(context_vk, query_vk->q.type, &query_vk->pool_idx); - VK_CALL(vkCmdResetQueryPool(command_buffer, query_vk->pool_idx.pool_vk->vk_query_pool, - query_vk->pool_idx.idx, 1)); + if (query_vk->pool_idx.pool_vk) + wined3d_query_pool_vk_mark_complete(query_vk->pool_idx.pool_vk, query_vk->pool_idx.idx, context_vk); + if (!wined3d_context_vk_allocate_query(context_vk, query_vk->q.type, &query_vk->pool_idx)) + { + ERR("Failed to allocate new query.\n"); + return FALSE; + } VK_CALL(vkCmdWriteTimestamp(command_buffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, query_vk->pool_idx.pool_vk->vk_query_pool, query_vk->pool_idx.idx)); wined3d_context_vk_reference_query(context_vk, query_vk);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com