mesa/st: Simplify st_choose_matching_format().
authorEric Anholt <eric@anholt.net>
Tue, 17 Sep 2019 22:13:30 +0000 (15:13 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 15 Nov 2019 20:32:17 +0000 (20:32 +0000)
commite5b06008f15fd916c53b1f7be2353ac6ecfbbc8f
treebaedaa347eb9a249b42e5f5f542f2bb87b37a270
parent69f109cc37fff6300ea9e1914779620b7a117bf9
mesa/st: Simplify st_choose_matching_format().

We now have a nice helper function for finding those memcpy formats,
without needing to go through each entry of the mesa format table to
see if it happens to match.

While looking at sysprof of a softpipe GLES2 CTS run, we were spending
~8% of the CPU on ChooseTextureFormat.  With this, roughly the same
region of the testsuite was .4%.

v2: Add Ken's fix for canonicalizing array formats.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/state_tracker/st_format.c