=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Introduce wined3d_bit_scan().

Alexandre Julliard julliard at winehq.org
Tue Feb 6 15:55:50 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Feb  6 11:40:02 2018 +0100

wined3d: Introduce wined3d_bit_scan().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/wined3d_private.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 05576cd..3347245 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4352,6 +4352,13 @@ static inline BOOL is_rasterization_disabled(const struct wined3d_shader *geomet
             && geometry_shader->u.gs.so_desc.rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM;
 }
 
+static inline int wined3d_bit_scan(unsigned int *x)
+{
+    int bit_offset = ffs(*x) - 1;
+    *x ^= 1u << bit_offset;
+    return bit_offset;
+}
+
 static inline DWORD wined3d_extract_bits(const DWORD *bitstream,
         unsigned int offset, unsigned int count)
 {




More information about the wine-cvs mailing list