From e8007c93259bd1ae3d6d2056fed1291edff0eef7 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 10 Aug 2022 17:33:40 -0700 Subject: [PATCH] intel/fs/xe2+: Don't lower barycentric load offsets to fixed-point format on Xe2+. Floating-point offsets work fine in combination with the floating-point arithmetic we're about to lower these intrinsics into, and they require less instructions than converting to fixed-point and then back. No reason to take the precision/range hit nor the extra instructions. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_nir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 2a3d4950a74..42c90d4adfc 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -618,9 +618,10 @@ brw_nir_lower_fs_inputs(nir_shader *nir, NULL); } - nir_shader_intrinsics_pass(nir, lower_barycentric_at_offset, - nir_metadata_control_flow, - NULL); + if (devinfo->ver < 20) + nir_shader_intrinsics_pass(nir, lower_barycentric_at_offset, + nir_metadata_control_flow, + NULL); /* This pass needs actual constants */ nir_opt_constant_folding(nir);