vulkan: optimize vk_dynamic_graphics_state_any_dirty

For drivers using the new state tracking, __bitset_test_range can be
surprisingly hot because we have a lot of dirty bits and __bitset_test_range has
to handle lots of special cases. __bitset_is_empty does not have to worry about
those special cases so can be much faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29008>
This commit is contained in:
Alyssa Rosenzweig 2024-04-21 12:20:54 -04:00 committed by Marge Bot
parent 602c62a273
commit 0549649bcf

View file

@ -1187,8 +1187,7 @@ vk_dynamic_graphics_state_clear_dirty(struct vk_dynamic_graphics_state *d)
static inline bool
vk_dynamic_graphics_state_any_dirty(const struct vk_dynamic_graphics_state *d)
{
return BITSET_TEST_RANGE(d->dirty,
0, MESA_VK_DYNAMIC_GRAPHICS_STATE_ENUM_MAX - 1);
return !BITSET_IS_EMPTY(d->dirty);
}
/** Copies all set state from src to dst