Henri Verbeet : wined3d: Simplify context_update_stream_sources().

Alexandre Julliard julliard at winehq.org
Thu Apr 19 16:54:20 CDT 2018


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Apr 19 16:08:15 2018 +0430

wined3d: Simplify context_update_stream_sources().

Note that this slightly changes behaviour, in that no loads or unloads happen
anymore when "use_immediate_mode_draw" is set.

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

---

 dlls/wined3d/context.c | 30 ++++++++++--------------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index d2bcedc..9ba6253 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -5479,32 +5479,22 @@ static void context_load_numbered_arrays(struct wined3d_context *context,
 
 void context_update_stream_sources(struct wined3d_context *context, const struct wined3d_state *state)
 {
-    BOOL load_numbered = context->d3d_info->ffp_generic_attributes
-            || (use_vs(state) && !context->use_immediate_mode_draw);
-    BOOL load_named = !context->d3d_info->ffp_generic_attributes
-            && !use_vs(state) && !context->use_immediate_mode_draw;
 
-    if (context->numbered_array_mask && !load_numbered)
-    {
-        context_unload_numbered_arrays(context);
-        context->numbered_array_mask = 0;
-    }
-    else
-    {
-        context_unload_vertex_data(context);
-    }
+    if (context->use_immediate_mode_draw)
+        return;
 
-    if (load_numbered)
+    context_unload_vertex_data(context);
+    if (context->d3d_info->ffp_generic_attributes || use_vs(state))
     {
         TRACE("Loading numbered arrays.\n");
         context_load_numbered_arrays(context, &context->stream_info, state);
+        return;
     }
-    else if (load_named)
-    {
-        TRACE("Loading vertex data.\n");
-        context_load_vertex_data(context, &context->stream_info, state);
-        context->namedArraysLoaded = TRUE;
-    }
+
+    TRACE("Loading named arrays.\n");
+    context_unload_numbered_arrays(context);
+    context_load_vertex_data(context, &context->stream_info, state);
+    context->namedArraysLoaded = TRUE;
 }
 
 static void apply_texture_blit_state(const struct wined3d_gl_info *gl_info, struct gl_texture *texture,




More information about the wine-cvs mailing list