[PATCH 09/10] wined3d: Use wined3d_bit_scan() in context_update_stream_info().

Henri Verbeet hverbeet at codeweavers.com
Wed Jan 26 08:43:43 CST 2022


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/context.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index ed7fa32f74c..6aa5ae4e997 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -266,20 +266,19 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi
     const struct wined3d_d3d_info *d3d_info = context->d3d_info;
     DWORD prev_all_vbo = stream_info->all_vbo;
     unsigned int i;
-    WORD map;
+    uint32_t map;
 
     wined3d_stream_info_from_declaration(stream_info, state, d3d_info);
 
     stream_info->all_vbo = 1;
-    for (i = 0, map = stream_info->use_map; map; map >>= 1, ++i)
+    map = stream_info->use_map;
+    while (map)
     {
         struct wined3d_stream_info_element *element;
         struct wined3d_bo_address data;
         struct wined3d_buffer *buffer;
 
-        if (!(map & 1))
-            continue;
-
+        i = wined3d_bit_scan(&map);
         element = &stream_info->elements[i];
         buffer = state->streams[element->stream_idx].buffer;
 
-- 
2.30.2




More information about the wine-devel mailing list