st/glsl_to_nir: add more nir opts to st_nir_opts()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 31 Jan 2018 01:58:48 +0000 (12:58 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 31 Jan 2018 22:42:57 +0000 (09:42 +1100)
commit679e4e7a46c5b37004f8363fb273afcd47e1b1da
tree8631cbd4a9d9128101cc94e1a96040588815188a
parent5a7aba2e0a7fb3414a94d04d5970a2ed10c1f63e
st/glsl_to_nir: add more nir opts to st_nir_opts()

All of the current gallium nir driver use these optimisations but
they do so in their backends. Having these called in the backend
only can cause a number of problems:

- Shader compile times are greater because the opts need to do
  significant passes over all shader variants.
- The shader cache is partially defeated due to the significant
  optimisation passes over variants.
- We might miss out on nir linking optimisation opportunities.

Adding these passes to st_nir_opts() alleviates these problems.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/state_tracker/st_glsl_to_nir.cpp