diff options
author | Dylan Baker <[email protected]> | 2018-08-21 09:46:46 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-09-07 10:21:26 -0700 |
commit | 8396043f304bb2a752130230055605c5c966e89f (patch) | |
tree | ee2e8a5494b88bff3b5e67ece8ffdba70d12c087 /src/intel/vulkan/anv_private.h | |
parent | 80825abb5d1a7491035880253ffd531c55acae6b (diff) |
Replace uses of _mesa_bitcount with util_bitcount
and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem
in nir for platforms that don't have popcount or popcountll, such as
32bit msvc.
v2: - Fix additional uses of _mesa_bitcount added after this was
originally written
Acked-by: Eric Engestrom <[email protected]> (v1)
Acked-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 5537c8cab57..d15a91dd014 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -54,6 +54,7 @@ #include "util/set.h" #include "util/u_atomic.h" #include "util/u_vector.h" +#include "util/u_math.h" #include "util/vma.h" #include "vk_alloc.h" #include "vk_debug_report.h" @@ -2557,7 +2558,7 @@ anv_plane_to_aspect(VkImageAspectFlags image_aspects, uint32_t plane) { if (image_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) { - if (_mesa_bitcount(image_aspects) > 1) + if (util_bitcount(image_aspects) > 1) return VK_IMAGE_ASPECT_PLANE_0_BIT << plane; return VK_IMAGE_ASPECT_COLOR_BIT; } @@ -2968,7 +2969,7 @@ anv_image_aspects_compatible(VkImageAspectFlags aspects1, /* Only 1 color aspects are compatibles. */ if ((aspects1 & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) != 0 && (aspects2 & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) != 0 && - _mesa_bitcount(aspects1) == _mesa_bitcount(aspects2)) + util_bitcount(aspects1) == util_bitcount(aspects2)) return true; return false; @@ -3179,7 +3180,7 @@ struct anv_subpass { static inline unsigned anv_subpass_view_count(const struct anv_subpass *subpass) { - return MAX2(1, _mesa_bitcount(subpass->view_mask)); + return MAX2(1, util_bitcount(subpass->view_mask)); } struct anv_render_pass_attachment { |