=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Implement vkd3d_write_mask_component_count() on top of vkd3d_popcount().

Alexandre Julliard julliard at winehq.org
Tue Oct 30 12:38:26 CDT 2018


Module: vkd3d
Branch: master
Commit: 6b9c58979507eb529a993b52bbe2537f553ada23
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=6b9c58979507eb529a993b52bbe2537f553ada23

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Oct 30 15:22:51 2018 +0100

vkd3d-shader: Implement vkd3d_write_mask_component_count() on top of vkd3d_popcount().

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>

---

 libs/vkd3d-shader/vkd3d_shader_private.h | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 1d79c91..dd3650b 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -866,16 +866,8 @@ static inline unsigned int vkd3d_write_mask_get_component_idx(DWORD write_mask)
 
 static inline unsigned int vkd3d_write_mask_component_count(DWORD write_mask)
 {
-    unsigned int i, count = 0;
-
     assert(write_mask);
-    for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
-    {
-        if (write_mask & (VKD3DSP_WRITEMASK_0 << i))
-            ++count;
-    }
-
-    return count;
+    return vkd3d_popcount(write_mask & VKD3DSP_WRITEMASK_ALL);
 }
 
 static inline unsigned int vkd3d_write_mask_from_component_count(unsigned int component_count)




More information about the wine-cvs mailing list