vulkan/util: Use util_bitcount

__builtin_popcount is not available on all compilers.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10159>
This commit is contained in:
James Park 2021-04-10 21:31:19 -07:00 committed by Marge Bot
parent 80b96a2158
commit d32512effc

View file

@ -245,7 +245,7 @@ struct vk_pipeline_cache_header {
static inline gl_shader_stage
vk_to_mesa_shader_stage(VkShaderStageFlagBits vk_stage)
{
assert(__builtin_popcount((uint32_t) vk_stage) == 1);
assert(util_bitcount((uint32_t) vk_stage) == 1);
return (gl_shader_stage) (ffs((uint32_t) vk_stage) - 1);
}