From 61f2e8d9bbde0d4416663fd61c4f63a5a763e96a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Mon, 9 Mar 2020 16:27:54 +0100 Subject: [PATCH] aco: Don't store TCS outputs to LDS when we're sure that none are read. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This allows us not to write an output to LDS, even if it has an indirect offset. No pipeline DB changes. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Tested-by: Marge Bot Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 386616f52ef..1de79f01da8 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3339,6 +3339,10 @@ bool should_write_tcs_patch_output_to_lds(isel_context *ctx, nir_intrinsic_instr unsigned off = nir_intrinsic_base(instr) * 4u; nir_src *off_src = nir_get_io_offset_src(instr); + /* When none of the appropriate outputs are read, we are OK to never write to LDS */ + if (per_vertex ? ctx->shader->info.outputs_read == 0U : ctx->shader->info.patch_outputs_read == 0u) + return false; + /* Indirect offset, we can't be sure if this is read or not, always write to LDS */ if (!nir_src_is_const(*off_src)) return true; -- 2.30.2