Commit 36916804 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 57d5314a
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment