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_image.c | |
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_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 36d4ac13c75..a3aecb93901 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -32,6 +32,7 @@ #include "anv_private.h" #include "util/debug.h" #include "vk_util.h" +#include "util/u_math.h" #include "vk_format_info.h" @@ -814,7 +815,7 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo, assert(image != NULL); /* The aspect must be exactly one of the image aspects. */ - assert(_mesa_bitcount(aspect) == 1 && (aspect & image->aspects)); + assert(util_bitcount(aspect) == 1 && (aspect & image->aspects)); /* Determine the optimal buffer. */ @@ -942,7 +943,7 @@ anv_layout_to_fast_clear_type(const struct gen_device_info * const devinfo, const VkImageLayout layout) { /* The aspect must be exactly one of the image aspects. */ - assert(_mesa_bitcount(aspect) == 1 && (aspect & image->aspects)); + assert(util_bitcount(aspect) == 1 && (aspect & image->aspects)); uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect); @@ -1230,11 +1231,11 @@ static VkImageAspectFlags remap_aspect_flags(VkImageAspectFlags view_aspects) { if (view_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) { - if (_mesa_bitcount(view_aspects) == 1) + if (util_bitcount(view_aspects) == 1) return VK_IMAGE_ASPECT_COLOR_BIT; VkImageAspectFlags color_aspects = 0; - for (uint32_t i = 0; i < _mesa_bitcount(view_aspects); i++) + for (uint32_t i = 0; i < util_bitcount(view_aspects); i++) color_aspects |= VK_IMAGE_ASPECT_PLANE_0_BIT << i; return color_aspects; } |