From c07a9dca65845d30971fd0c88392f569338dd8c4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 20 Aug 2023 12:51:02 -0400 Subject: [PATCH] nir/opt_sink: Sink load_local_pixel_agx MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is the AGX version of load_output, which shaders can use for framebuffer fetch. It is beneficial to sink framebuffer fetch as late as possible, both to reduce register pressure but also to reduce serialization of overlapping fragments. Results on a collection of ubershaders: total bytes in shared programs: 1468928 -> 1468550 (-0.03%) bytes in affected programs: 495300 -> 494922 (-0.08%) helped: 24 HURT: 0 Bytes are helped. total halfregs in shared programs: 14162 -> 13946 (-1.53%) halfregs in affected programs: 5148 -> 4932 (-4.20%) helped: 27 HURT: 0 Halfregs are helped. total threads in shared programs: 216896 -> 217664 (0.35%) threads in affected programs: 6912 -> 7680 (11.11%) helped: 12 HURT: 0 Threads are helped. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir_opt_sink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/nir/nir_opt_sink.c b/src/compiler/nir/nir_opt_sink.c index 447fa68..e19ad09 100644 --- a/src/compiler/nir/nir_opt_sink.c +++ b/src/compiler/nir/nir_opt_sink.c @@ -66,6 +66,7 @@ nir_can_move_instr(nir_instr *instr, nir_move_options options) case nir_intrinsic_load_uniform: return options & nir_move_load_uniform; case nir_intrinsic_load_constant_agx: + case nir_intrinsic_load_local_pixel_agx: return true; default: return false; -- 2.7.4