From 2543f5a594f969722de4d3e4632aedebb5acbb73 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 3 Sep 2023 13:37:38 +0200 Subject: [PATCH] radv: use ac_nir_opt_pack_half Foz-DB Navi21: Totals from 20425 (25.73% of 79395) affected shaders: MaxWaves: 525608 -> 525690 (+0.02%); split: +0.02%, -0.00% Instrs: 13570442 -> 13531690 (-0.29%); split: -0.29%, +0.00% CodeSize: 74246928 -> 74312000 (+0.09%); split: -0.03%, +0.12% VGPRs: 814736 -> 813384 (-0.17%); split: -0.18%, +0.02% Latency: 103675193 -> 103574328 (-0.10%); split: -0.12%, +0.02% InvThroughput: 25189130 -> 25114931 (-0.29%); split: -0.30%, +0.00% VClause: 314579 -> 314573 (-0.00%); split: -0.00%, +0.00% SClause: 526551 -> 526548 (-0.00%); split: -0.00%, +0.00% Copies: 772147 -> 772999 (+0.11%); split: -0.01%, +0.12% PreVGPRs: 661914 -> 661923 (+0.00%) VALU: 9612901 -> 9574094 (-0.40%); split: -0.40%, +0.00% SALU: 1244130 -> 1244176 (+0.00%) Reviewed-by: Rhys Perry Part-of: --- src/amd/vulkan/radv_pipeline.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 4752d9189fa..6e9e58bf8f6 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -710,6 +710,14 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_graphics_stat /* cleanup passes */ NIR_PASS(_, stage->nir, nir_lower_alu_width, opt_vectorize_callback, device); + + /* This pass changes the global float control mode to RTZ, so can't be used + * with LLVM, which only supports RTNE, or RT, where the mode needs to match + * across separately compiled stages. + */ + if (!radv_use_llvm_for_stage(pdev, stage->stage) && !gl_shader_stage_is_rt(stage->stage)) + NIR_PASS(_, stage->nir, ac_nir_opt_pack_half, gfx_level); + NIR_PASS(_, stage->nir, nir_lower_load_const_to_scalar); NIR_PASS(_, stage->nir, nir_copy_prop); NIR_PASS(_, stage->nir, nir_opt_dce);