panfrost: Fix ubo_mask calculation
authorIcecream95 <ixn@disroot.org>
Fri, 31 Dec 2021 13:15:21 +0000 (02:15 +1300)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 5 Mar 2022 19:55:00 +0000 (14:55 -0500)
commit9d4441c71aa60b275ae1fccfc11b37705b02c118
tree7026de1531219894cb5ddec63ad519f103002707
parent0b232b86598285a55f0b1d7d826ad08cd541ea46
panfrost: Fix ubo_mask calculation

BITSET_MASK returns ~0 when given an input of zero, when we need it to
return 0 instead.

Fixes shaders with only sysvals but no UBOs when push constants are
disabled.

This breaks when 31 or 32 UBOs are used, but PAN_MAX_CONST_BUFFERS is
currently set to 16.

Fixes: c246af0dd80 ("panfrost: Only upload UBOs when needed")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c