Zebediah Figura : wined3d: Do not call list_remove() on a Vulkan query which has not been started.

Alexandre Julliard julliard at winehq.org
Wed Sep 29 15:54:09 CDT 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Tue Sep 28 13:05:14 2021 -0500

wined3d: Do not call list_remove() on a Vulkan query which has not been started.

Or call it twice on one which has.

This fixes a crash in Mafia: Definitive Edition.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/query.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 24892e42b34..8ee7ae07886 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1661,7 +1661,6 @@ static BOOL wined3d_query_vk_issue(struct wined3d_query *query, uint32_t flags)
     {
         context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0));
 
-        list_remove(&query_vk->entry);
         if (query_vk->pending_count)
             wined3d_context_vk_remove_pending_queries(context_vk, query_vk);
         memset((void *)query->data, 0, query->data_size);
@@ -1742,7 +1741,8 @@ static void wined3d_query_vk_destroy(struct wined3d_query *query)
     struct wined3d_query_vk *query_vk = wined3d_query_vk(query);
     struct wined3d_context_vk *context_vk;
 
-    list_remove(&query_vk->entry);
+    if (query_vk->flags & WINED3D_QUERY_VK_FLAG_STARTED)
+        list_remove(&query_vk->entry);
     if (query_vk->pending_count)
     {
         context_vk = wined3d_context_vk(context_acquire(query_vk->q.device, NULL, 0));
@@ -1942,7 +1942,6 @@ HRESULT wined3d_query_vk_create(struct wined3d_device *device, enum wined3d_quer
     data = query_vk + 1;
 
     wined3d_query_init(&query_vk->q, device, type, data, data_size, ops, parent, parent_ops);
-    list_init(&query_vk->entry);
 
     switch (type)
     {




More information about the wine-cvs mailing list