panfrost: Fix CLAMP wrap mode
authorIcecream95 <ixn@disroot.org>
Sat, 19 Dec 2020 11:21:58 +0000 (00:21 +1300)
committerMarge Bot <eric+marge@anholt.net>
Sun, 20 Dec 2020 02:31:39 +0000 (02:31 +0000)
commitf9ceab7b237d40ded7728457114e59ca6707dd71
tree3f66d6b2be519ada8ca9f60f730a7277f7ad6d10
parentac265c0a968d1f57e800ec9a2be9f1912f54359f
panfrost: Fix CLAMP wrap mode

MALI_WRAP_MODE_CLAMP doesn't work fully on either GPU generation, so
use other wrap modes instead in some cases.

With nearest filtering, Midgard only clamps to the edge for two of the
edges, and uses the border colour for the other two. Using the clamp
mode on Bifrost causes broken rendering and/or GPU faults.

Fixes piglit test "texwrap" on both Midgard and Bifrost, and fixes
Chromium B.S.U. rendering on Bifrost.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8176>
src/gallium/drivers/panfrost/pan_cmdstream.c