lima/ppir: clone uniforms and load_coords into each successor
authorVasily Khoruzhick <anarsoul@gmail.com>
Wed, 28 Aug 2019 06:02:12 +0000 (23:02 -0700)
committerVasily Khoruzhick <anarsoul@gmail.com>
Wed, 4 Sep 2019 00:02:13 +0000 (00:02 +0000)
commit1c1890fa707789aaf7e1ef265c521799b2f348c5
tree63014390c9419f22d1cdb9e3887f8d619fd62116
parente23fd2c3751500a64ef40bbc64cd2cb4bd7345f9
lima/ppir: clone uniforms and load_coords into each successor

Try more aggressive approach with cloning uniform and coord loads.

Uniform load can be inserted into any instruction, so let's do that. ARM site
claim that penalty for cache miss is one clock, so we don't lose anything if
we merge it into instruction that uses the result. As side effect we can also
pipeline it and thus decrease reg pressure.

Do the same for varyings that hold texture coords, but for different reason:
looks like there's a special path for coords that increases precision if
varying that holds it is pipelined. If we don't pipeline it and load coords
from a register its precision is fp16 and thus only 10 bits which is not enough
to accurately sample textures of size 1024 or larger.

Since instruction can hold only one uniform load and one varying load,
node_to_instr now creates a move using helper introduced in previous commit if
slot is already taken. As side effect of this change we can also try to
pipeline texture loads and create a move if attempt fails.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/ir/pp/lower.c
src/gallium/drivers/lima/ir/pp/nir.c
src/gallium/drivers/lima/ir/pp/node.c
src/gallium/drivers/lima/ir/pp/node_to_instr.c