aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-10-04 06:33:02 +1000
committerEmil Velikov <[email protected]>2017-10-17 16:59:31 +0100
commit41ec2af2a8bfefa7295e691bacb44e69a88fec21 (patch)
tree57ce80fb1f68f57a6049108864686aa67e254114
parent0bd7be01427d301b2c4dadd644e84c7f511eaa90 (diff)
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "17.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 2c61594d84911f486aa2edb4b8e561e780139d20) [Emil Velikov: use correct file radv_shader.c -> radv_pipeline.c] Signed-off-by: Emil Velikov <[email protected]> Conflicts: src/amd/vulkan/radv_shader.c
-rw-r--r--src/amd/vulkan/radv_pipeline.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bbcaeaa4e1f..ddd146424e8 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -65,6 +65,7 @@ static const struct nir_shader_compiler_options nir_options = {
.lower_unpack_unorm_4x8 = true,
.lower_extract_byte = true,
.lower_extract_word = true,
+ .lower_ffma = true,
.max_unroll_iterations = 32
};