[PATCH 4/5] wined3d: Simplify logic in wined3d_event_query_issue().

Józef Kucia jkucia at codeweavers.com
Wed Apr 5 08:38:06 CDT 2017


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/query.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 1927e7e..685c5ce 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -214,27 +214,17 @@ enum wined3d_event_query_result wined3d_event_query_finish(const struct wined3d_
 
 void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device)
 {
+    struct wined3d_context *context = NULL;
     const struct wined3d_gl_info *gl_info;
-    struct wined3d_context *context;
 
-    if (query->context)
-    {
-        if (!(context = context_reacquire(device, query->context))
-                && !query->context->gl_info->supported[ARB_SYNC])
-        {
-            context_free_event_query(query);
-            context = context_acquire(device, NULL, 0);
-            context_alloc_event_query(context, query);
-        }
-        if (!context)
-            context = context_acquire(device, NULL, 0);
-    }
-    else
-    {
+    if (query->context && !(context = context_reacquire(device, query->context))
+            && !query->context->gl_info->supported[ARB_SYNC])
+        context_free_event_query(query);
+    if (!context)
         context = context_acquire(device, NULL, 0);
-        context_alloc_event_query(context, query);
-    }
     gl_info = context->gl_info;
+    if (!query->context)
+        context_alloc_event_query(context, query);
 
     if (gl_info->supported[ARB_SYNC])
     {
-- 
2.10.2




More information about the wine-patches mailing list