ac/surface: use blocksizebits instead of blocksize
authorSimon Ser <contact@emersion.fr>
Fri, 9 Apr 2021 11:58:40 +0000 (13:58 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 15 Apr 2021 09:43:17 +0000 (09:43 +0000)
commit19378dfe3c2a27ab2f9ed737d5553306233faf30
tree6dffd76c4b8ef2b18aa11965a12825ea10b53271
parent6e697b595f8a46348a41be673a37bc0a39a8e032
ac/surface: use blocksizebits instead of blocksize

util_format_get_blocksize asserts that the blocksize isn't zero.
However the blocksize will be zero if the format's channel encoding
is unspecified. The channel encoding is only meaningful for the
plain u_format layout, so util_format_get_blocksize can't be used
for formats with another layout. For example, YUV formats don't have
the channel encoding specified.

Use util_format_get_blocksizebits, which just returns zero without
an assertion for formats which don't have a channel encoding.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
src/amd/common/ac_surface.c