radv: lower ffma in nir.
authorDave Airlie <airlied@redhat.com>
Tue, 3 Oct 2017 20:33:02 +0000 (06:33 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 10 Oct 2017 21:31:27 +0000 (07:31 +1000)
commit2c61594d84911f486aa2edb4b8e561e780139d20
tree24027381783da5fa7760e0fce94729d79c81f99d
parent25d76fd658105b06c241a441899e00c4d912d434
radv: lower ffma in nir.

So it appears the Vulkan SPIR-V fma opcode can be equivalent to a
mad operation, and the fma hw opcode on AMD hw is issued like a double
opcode so is slower. Also the radeonsi stack does this.

This appears to improve performance on a number of games from Feral,
and thanks to Feral for noticing the problem.

I'm reposting this one as Marek indicated he thinks this is what
we should be doing on AMD hw.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_shader.c