st/glsl_to_tgsi: disable the merge registers pass conditionally
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 24 Apr 2017 22:31:47 +0000 (00:31 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 26 Apr 2017 17:15:37 +0000 (19:15 +0200)
commit066a5729552925fc53e345b9e86a8699ba7ac451
tree9278e8f896e7f8f82451e03875e7a43339e34735
parent3a927e0aa34d2d27583063732eadfddccd1ebdd2
st/glsl_to_tgsi: disable the merge registers pass conditionally

The main goal of this pass to merge temporary registers in order
to reduce the total number of registers and also to produce
optimal TGSI code.

In fact, compilers seem to be confused when temporary variables
are already merged, maybe because it's done too early in the
process.

Skipping the pass, reduce both the register pressure and the code
size, at least for Nouveau and RadeonSI because they have a real
backend compiler.

Found by luck while fixing an issue in the TGSI dead code elimination
pass which affects tex instructions with bindless samplers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp