Commit 2c61594d authored by Dave Airlie's avatar Dave Airlie
Browse files

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: default avatarNicolai Hähnle <>
Reviewed-by: default avatarMarek Olšák <>
Cc: "17.2" <>
Signed-off-by: default avatarDave Airlie <>
parent 25d76fd6
......@@ -63,6 +63,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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment