From 20222cd9566ecff2e109d00ec2d680c865aae0c6 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 7 Feb 2025 19:32:04 -0800 Subject: [PATCH] anv: Use the new nir_opt_acquire_release_barriers pass Improves performance of Phasmophobia with the "Eye Adaptation" video setting enabled on Arc B570 by about 9.5%. fossil-db results on Battlemage: Totals: Instrs: 148797922 -> 148797865 (-0.00%) Send messages: 7066341 -> 7066317 (-0.00%) Cycle count: 21459978352 -> 21459975048 (-0.00%) Totals from 8 (0.00% of 574410) affected shaders: Instrs: 4633 -> 4576 (-1.23%) Send messages: 479 -> 455 (-5.01%) Cycle count: 611886 -> 608582 (-0.54%) Observed to cut 15% of sends in a Phasmophobia shader, 8.3% in a Far Cry New Dawn shader, 7% in a Borderlands 3 DX11 shader, and 3.4-3.7% of sends in a few Witcher 3 and Dark Souls 3 shaders. Reviewed-by: Caio Oliveira Part-of: --- src/intel/vulkan/anv_pipeline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 74d91b2737a..805517dfe7d 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2070,6 +2070,8 @@ anv_pipeline_nir_preprocess(struct anv_pipeline *pipeline, brw_preprocess_nir(compiler, stage->nir, &opts); NIR_PASS(_, stage->nir, nir_opt_barrier_modes); + NIR_PASS(_, stage->nir, nir_opt_acquire_release_barriers, + SCOPE_QUEUE_FAMILY); nir_shader_gather_info(stage->nir, nir_shader_get_entrypoint(stage->nir)); }