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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user