r300: Request NIR shaders from mesa/st and use NIR-to-TGSI.
authorEmma Anholt <emma@anholt.net>
Mon, 6 Dec 2021 20:11:43 +0000 (12:11 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 9 Dec 2021 22:15:53 +0000 (22:15 +0000)
commit7d2ea9b0edef2176140629ac3dee6a6809c4abe2
tree7857a0a27a8ab41487e41efe46b33888e4594b05
parente68a9b033997c9de485c2914717d25e55fbb053e
r300: Request NIR shaders from mesa/st and use NIR-to-TGSI.

This brings us into parity on state tracker paths with most other
supported drivers, and a lot of additional optimization on our shaders.

Results on a subset of shader-db that doesn't crash:

instructions in affected programs: 59502 -> 47991 (-19.35%)
vinst in affected programs: 17633 -> 15197 (-13.82%)
sinst in affected programs: 9296 -> 7319 (-21.27%)
flowcontrol in affected programs: 627 -> 310 (-50.56%)
presub in affected programs: 4220 -> 1554 (-63.18%)
temps in affected programs: 5775 -> 8570 (48.40%)
lits in affected programs: 215 -> 37 (-82.79%)

The temps (register usage) increase is unfortunate, but it seems that
instruction counts tend to be our limit before reg counts are.

Fixes: #3354
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14096>
src/gallium/drivers/r300/ci/r300-rv515-fails.txt
src/gallium/drivers/r300/ci/r300-rv515-skips.txt
src/gallium/drivers/r300/meson.build
src/gallium/drivers/r300/r300_debug.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_screen.h
src/gallium/drivers/r300/r300_state.c