From 7f332f4087500219f7fecc76ea268bd538f58c5e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 18 Jan 2024 15:56:16 -0600 Subject: [PATCH] nak: Enable NIR fuse_ffmaN This improves vkpeak perf by 40-50% on the Ada GPU in my laptop. There are probably more optimal things we can be doing (Intel's pass is pretty clever) but this is already an improvement. Part-of: --- src/nouveau/compiler/nak/api.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nouveau/compiler/nak/api.rs b/src/nouveau/compiler/nak/api.rs index 4a18faeaa14..ba74a61b7cd 100644 --- a/src/nouveau/compiler/nak/api.rs +++ b/src/nouveau/compiler/nak/api.rs @@ -81,6 +81,9 @@ fn nir_options(dev: &nv_device_info) -> nir_shader_compiler_options { let mut op: nir_shader_compiler_options = unsafe { std::mem::zeroed() }; op.lower_fdiv = true; + op.fuse_ffma16 = true; + op.fuse_ffma32 = true; + op.fuse_ffma64 = true; op.lower_flrp16 = true; op.lower_flrp32 = true; op.lower_flrp64 = true;